Skip to content

Instantly share code, notes, and snippets.

@AndreasOM
Created February 20, 2016 14:46
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 AndreasOM/e86f7288f9a4f8ee20dd to your computer and use it in GitHub Desktop.
Save AndreasOM/e86f7288f9a4f8ee20dd to your computer and use it in GitHub Desktop.
iptables -F
iptables -N LOGALL
iptables -N INPUT_LOGGED
iptables -A LOGALL -m state --state NEW -j LOG --log-level 7 --log-prefix "IPTABLES NEW: "
## iptables -A LOGALL -j LOG --log-level 7 --log-prefix "IPTABLES ALL: "
iptables -A LOGALL -j INPUT_LOGGED
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -j LOGALL
### iptables -A INPUT_LOGGED -p tcp --dport 990 -j ACCEPT # FTP
### iptables -A INPUT_LOGGED -p tcp --dport 989 -j ACCEPT # FTPS
### iptables -A INPUT_LOGGED -p tcp --dport 21 -j ACCEPT # FTP
iptables -A INPUT_LOGGED -p tcp --dport 953 -j ACCEPT # RNDC
### iptables -A INPUT_LOGGED -p tcp --dport 5984 -j ACCEPT # couchdb
iptables -A INPUT_LOGGED -p tcp --dport 4444:5555 -j ACCEPT
iptables -A INPUT_LOGGED -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT_LOGGED -p tcp -j DROP
# /etc/init.d/iptables save active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment