IPtables for Asterisk: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
Created page with "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..."
 
No edit summary
Line 2: Line 2:
<pre>
<pre>
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p udp --dport 5060 -j ACCEPT
iptables -A INPUT -p udp --dport 4569 -j ACCEPT
iptables -A INPUT -p udp --dport 4569 -j ACCEPT
iptables -A INPUT -p udp --dport 10000:12000 -j ACCEPT
iptables -A INPUT -p udp --dport 10000:12000 -j ACCEPT

Revision as of 07:01, 3 August 2014

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 -P INPUT DROP

The two IP address listed above are for ClubTelco and PennyTel.