Security

Iptables Rule Minimal for ‘Secure’ Server

Here is iptable rule minimal for ‘secure’ server,

iptables -A INPUT -m conntrack –ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -s 212.212.212.x/32 -p tcp -m tcp –dport 202 -j ACCEPT
iptables -P INPUT DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 8080 -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 443 -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 8080 -j ACCEPT
iptables -A INPUT -s 212.212.212.x/32 -p icmp -m icmp –icmp-type 8 -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -i eth0 -p tcp -m tcp –dport 3306 -j ACCEPT
iptables -A INPUT -s 212.212.212.x/32 -i eth1 -p udp -m udp –dport 10050 -j ACCEPT
iptables -A INPUT -s 212.212.212.x/32 -i eth1 -p tcp -m tcp –dport 10050 -j ACCEPT

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s