Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
iptables_conntrack_configuration
# Generated by iptables-save v1.4.2 on Fri Jan 8 01:03:20 2010
*filter
:INPUT DROP [3:180]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [288:65758]
# allow traffic from loopback
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
# allow ping --icmp-type echo-request
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
# allow related
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# This packet is associated with no known connection. These packets should be dropped.
-A INPUT -m state --state INVALID -j DROP
# secure ssh
#-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name ssh_secure --rsource
#-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name ssh_secure --rsource -j DROP
# allow hosting services
# ssh
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT
# http
-A INPUT -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT
# https
-A INPUT -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT
# smtp
#-A INPUT -p tcp -m tcp --dport 25 -m state --state NEW -j ACCEPT
# alternative smtp
#-A INPUT -p tcp -m tcp --dport 587 -m state --state NEW -j ACCEPT
# secure smtp
#-A INPUT -p tcp -m tcp --dport 465 -m state --state NEW -j ACCEPT
# ftp
#-A INPUT -p tcp -m tcp --dport 21 -m state --state NEW -j ACCEPT
# pop3
#-A INPUT -p tcp -m tcp --dport 110 -m state --state NEW -j ACCEPT
# secure pop3
#-A INPUT -p tcp -m tcp --dport 995 -m state --state NEW -j ACCEPT
# imap
#-A INPUT -p tcp -m tcp --dport 143 -m state --state NEW -j ACCEPT
# secure imap
#-A INPUT -p tcp -m tcp --dport 993 -m state --state NEW -j ACCEPT
# DNS
#-A INPUT -p tcp -m tcp --dport 53 -m state --state NEW -j ACCEPT
#-A INPUT -p udp -m udp --dport 53 -m state --state NEW -j ACCEPT
COMMIT
# Completed on Fri Jan 8 01:03:20 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.