Skip to content

Instantly share code, notes, and snippets.

@ctavan
Created July 20, 2012 09:19
Show Gist options
  • Save ctavan/3149813 to your computer and use it in GitHub Desktop.
Save ctavan/3149813 to your computer and use it in GitHub Desktop.
Forward port 80 traffic to different host
TARGET=192.168.2.10
sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination $TARGET:80
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