IPtables for Asterisk
From KlavoWiki
This is my recommend IPtables for use with Asterisk that is connect to the internet. My goal here is ti block all SIP traffic except those to an ISP but allowing IAX2 inbound.
iptables -A INPUT -p tcp --dport 22 -j ACCEPT iptables -A INPUT -p udp --dport 4569 -j ACCEPT iptables -A INPUT -p udp --dport 10000:12000 -j ACCEPT iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT iptables -A INPUT -s 202.169.178.10 -j ACCEPT iptables -A INPUT -s 202.85.243.105 -j ACCEPT iptables -A INPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT iptables -P INPUT DROP
The two IP address listed above are for ClubTelco and PennyTel.