Created
February 26, 2013 14:41
-
-
Save piscis/5038892 to your computer and use it in GitHub Desktop.
Its a start :-)
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
# Allow outgoing traffic and disallow any passthroughs | |
iptables -P INPUT DROP | |
iptables -P OUTPUT ACCEPT | |
iptables -P FORWARD DROP | |
# Allow traffic already established to continue | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allow ssh, web services | |
iptables -A INPUT -p tcp --dport ssh -j ACCEPT | |
iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 443 -j ACCEPT | |
# Allow local loopback services and internal network | |
iptables -A INPUT -i lo -j ACCEPT | |
# Allow pings | |
iptables -I INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT | |
iptables -I INPUT -p icmp --icmp-type source-quench -j ACCEPT | |
iptables -I INPUT -p icmp --icmp-type time-exceeded -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment