Skip to content

Instantly share code, notes, and snippets.

@kesonno
Created August 7, 2014 12:57
Show Gist options
  • Save kesonno/dca2ccf8fd526bb1589e to your computer and use it in GitHub Desktop.
Save kesonno/dca2ccf8fd526bb1589e to your computer and use it in GitHub Desktop.
iptables config for allow only ssh, http and https access
# Generated by iptables-save v1.4.7 on Fri May 30 11:43:24 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [4464:613754]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 10050 -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 9102 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Fri May 30 11:43:24 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment