Iptables Firewall Rules

This is a list of some simple firewall rules that can be added to any of our Asterisk servers using iptables.

iptables -P INPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p udp --dport 922 -j ACCEPT
iptables -A INPUT -p tcp --dport 922 -j ACCEPT
iptables -A INPUT -p udp --dport 5060:5061 -j ACCEPT
iptables -A INPUT -p udp --dport 10000:20000 -j ACCEPT
iptables -A INPUT -p udp -j DROP
iptables -A INPUT -p tcp --syn -j DROP

To view the rules

iptables -L

To make the rules persistent on reboot

service iptables save
  • firewall, rules, iptables, security

Related Articles

I have a bunch of anonymous call attempts showing up in my call logs

I have a bunch of calls that look like this. 2011-11-18 00:27:10SIP/xx.xx...unknown"unknown"...

Do I need to do anything on the server/linux side of things?

You should not have to do anything on the server/linux side unless you want to tweak things or...

How hard is it to upgrade my server?

Upgrading resources such as memory, processing, hard drive space is instantaneous and does not...

Do you automatically upgrade our software when a newer version comes out?

Software upgrades are not automatic because they usually require service interruption.  We can...

Do you provided automatic backups.

Our premium plan includes automatic online backups.  All other plans can be backed up manually...