Created
August 3, 2015 10:28
-
-
Save gin1314/acdb5c937bfcc75ab8cc to your computer and use it in GitHub Desktop.
linux: example of enabling IP forwarding and redirection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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