Wednesday, October 03, 2012

Iptables Rule for Asterisk

The default iptables ruleset will block SIP traffic. To allow it, we
need below:

# SIP on UDP port 5060. Other SIP servers may need TCP port 5060 as well
iptables -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
# RTP - the media stream
# (related to the port range in /etc/asterisk/rtp.conf)
iptables -A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT
#

Or we use -I to insert the rules at specified rule number (the topmost
rule is numbered 1)
iptables -I INPUT 2 -p udp -m udp --dport 5060 -j ACCEPT
iptables -I INPUT 2 -p udp -m udp --dport 10000:20000 -j ACCEPT

8 comments:

  1. The Cloud Shop offers Cloud Hosted Asterisk in Asia including virtual numbers and SIP lines. Virtual numbers for Hong Kong, Singapore, China, Vietnam, Australia, New Zealand and more.

    ReplyDelete
  2. Cloud Shop web is www.cloudshop.com.hk.

    Also offered is Polycom, SNOM and Yealink IP based phones.

    On premise IP-PBX is Asterisk Switchvox.

    ReplyDelete
  3. i have a problem am using asterisk on a server in a call center..but there risk of hacking with entering in my server by the net(i have a fix ip adress)..how can block the distant access to my server.thank you

    ReplyDelete
  4. wissem, if you know the hacker's ip x.x.x.x, you can block it by 'iptables -A INPUT -s x.x.x.x -j DROP'.

    ReplyDelete

  5. Thank you very much for your information.
    Australia ETA/eVisitor Visa
    is quiet easy to apply online from Singapore,
    Malaysia, United Kingdom, United States, Canada, France and including all others ETA Eligible Countries from our website.

    ReplyDelete
  6. Abu Dhabi is the largest of the seven Emirates and the Federal capital of the United Arab Emirates. Abu Dhabi is best known for its culture & heritage; one of the most progressive and pioneering spots, being ranked as the world’s richest city.abu dhabi city tour

    ReplyDelete
  7. Hatta Trip is a desert safari with mountain driving along the valleys of the Hajjar Mountains beside the Oasis of Hatta. We pick up the tourists by 4WD vehicles at 8.30 Hrs, pass through Al Aweer and drive through the Golden sand dunes towards the Oasis of Hatta. Enroute we have enough opportunity to see the Desert life including few of the Bedouin tents and grazing camelsHatta tour

    ReplyDelete
  8. Dubai city tour is all about remarkable transformation – from a small pearl village to a world class epicenter of 5 star experiences – that is Dubai, UAE’s pride! Over the years Dubai has become the leading destination for holidays around the world. It has to be; with so many attractions and beautiful sandy beaches to claim, no wonder that millions flock to this city to see what it’s about. Take a city tour Dubai and experience for yourself.
    Dubai city tour

    ReplyDelete