Skip to content

Instantly share code, notes, and snippets.

@gin1314
Created August 3, 2015 10:28
Show Gist options
  • Save gin1314/acdb5c937bfcc75ab8cc to your computer and use it in GitHub Desktop.
Save gin1314/acdb5c937bfcc75ab8cc to your computer and use it in GitHub Desktop.
linux: example of enabling IP forwarding and redirection
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment