Created
February 20, 2018 20:19
-
-
Save dongalor/a709415156d9108f2c8838c7a68ca115 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -F | |
iptables -t nat -F | |
iptables -X | |
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
iptables -I INPUT 1 -i lo -j ACCEPT | |
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A INPUT -p tcp --dport 22 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 443 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 1337 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 4040 -j ACCEPT | |
iptables -t nat -A PREROUTING -i en0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
iptables -t nat -A PREROUTING -i en0 -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