Does my IPTables setup look ok?

Hi, all!

I am trying to set up an Asterisk server that has two NIC’s, where one is directly connected to the Internet and the other to a switch with phones.

I am very much a newbie. I am wondering if the following looks like a correct way of setting up IPTables. Here it goes:

[code]# /etc/sysconifg/iptables

/etc/init.d/iptables restart after edit

Based on Martin’s workstation iptables ruleset and others

My ip: 195.159.164.46

*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]

Handle loopback addresses

-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT

Allow outbound packets if state related, and inbound if established

-A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
-A INPUT -m state --state ESTABLISHED -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Drop if no flags set or all flags set

-A INPUT -p tcp -s 0/0 -d 195.159.164.46 --tcp-flags ALL NONE -j DROP
-A INPUT -p tcp -s 0/0 -d 195.159.164.46 --tcp-flags ALL ALL -j DROP

Drop stealth scans

-A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE
-A INPUT -i eth0 -p tcp -m tcp --tcp-flags SYN,FIN SYN,FIN
-A INPUT -i eth0 -p tcp -m tcp --tcp-flags SYN,RST SYN,RST
-A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,RST FIN,RST
-A INPUT -i eth0 -p tcp -m tcp --tcp-flags ACK,FIN FIN
-A INPUT -i eth0 -p tcp -m tcp --tcp-flags ACK,URG URG

Allow ssh, http, https, sip, fop, rtp

-A INPUT -p tcp --syn --dport 22 -j LOG --log-prefix "SSH SYN "
-A INPUT -s 0/0 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -s 0/0 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -s 0/0 -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -s 0/0 -m state --state NEW -m udp -p udp --dport 5060 -j ACCEPT
-A INPUT -s 0/0 -m state --state NEW -m udp -p tcp --dport 5060 -j ACCEPT
-A INPUT -s 0/0 -m state --state NEW -m udp -p udp --dport 4445 -j ACCEPT
-A INPUT -s 0/0 -m state --state NEW -m udp -p tcp --dport 4445 -j ACCEPT
-A INPUT -s 0/0 -m state --state NEW -m udp -p udp --dport 10000:10100 -j ACCEPT

Allow ICMP pings to the world, drop all others

-A OUTPUT -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -s 0/0 -d 195.159.164.46 -j DROP

COMMIT
[/code]
Thanks for any comments!

Frode