Created
July 20, 2012 18:47
-
-
Save ottomata/3152516 to your computer and use it in GitHub Desktop.
iptables
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
# deny all incoming traffic, but allow outgoing | |
iptables -P OUTPUT ACCEPT | |
iptables -P INPUT DROP | |
# allow ping | |
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT | |
# allow loopback | |
iptables -A INPUT -i lo -j ACCEPT | |
# allow any incoming established traffic | |
iptables -A INPUT -i eth0 -m state --state ESTABLISHED -j ACCEPT | |
# allow any incoming traffic from 10.64.21.0/24 | |
iptables -A INPUT -i eth0 -s 10.64.21.0/24 -m state --state NEW,ESTABLISHED -j ACCEPT | |
# allow any incoming traffic on port 8085 (apache http proxy w http auth) | |
iptables -A INPUT -i eth0 -p tcp --dport 8085 -m state --state NEW,ESTABLISHED -j ACCEPT | |
# allow any incoming traffic on ssh port 22 | |
iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment