Skip to content

Instantly share code, notes, and snippets.

@pwlin
Last active December 14, 2017 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwlin/ea7258ebaeea79d7f5b8d7350c73934f to your computer and use it in GitHub Desktop.
Save pwlin/ea7258ebaeea79d7f5b8d7350c73934f to your computer and use it in GitHub Desktop.
iptables -t nat -A PREROUTING -p tcp --dport <origin-port-WAN> -j REDIRECT --to-port <destination-port-LAN>
service iptables save
service iptables restart
iptables -t nat --line-numbers -L
iptables -t nat -D PREROUTING <line-number>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment