Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2011 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9268ef1dcd5875c025be to your computer and use it in GitHub Desktop.
Save anonymous/9268ef1dcd5875c025be to your computer and use it in GitHub Desktop.
# Dropping incoming connections that don't have explecit rules bellow
:INPUT DROP [68:4456]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1628:151823]
# Allow established connections for both public and private connections
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
# Opening ports wide open for FTP(21), SSH/SFTP(22), SMTP(25), HTTP(80), POP3(110), IMAP(143), HTTPS(443), and MySQL(3306),
-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 110 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 143 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
# Commmiting the rules to the firewall
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment