Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Created January 23, 2014 18:50
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 hellwolf/8584479 to your computer and use it in GitHub Desktop.
Save hellwolf/8584479 to your computer and use it in GitHub Desktop.
iptables nat redirect
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat --flush
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8000
iptables -t nat -A POSTROUTING -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment