IPtables for Asterisk: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 8: Line 8:
iptables -A INPUT -s 202.85.243.105 -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 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT
iptables -P INPUT DROP
iptables -P INPUT DROP
</pre>
</pre>

Latest revision as of 08:41, 4 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 -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.