Skip to content

Instantly share code, notes, and snippets.

@thash
Created November 9, 2011 08:24
Show Gist options
  • Save thash/1350836 to your computer and use it in GitHub Desktop.
Save thash/1350836 to your computer and use it in GitHub Desktop.
*filter
:INPUT DROP [0:0] # drop every input packets by default.
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
# ssh, http, https
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
# IMPORTANT: Change ssh port for better security.
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
# accept already established connection
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# MongoDB port. better way: define bind_ip = 127.0.0.1 into /etc/mongod.conf
# -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment