Forwarding RTP ports 20000-20011 not working

  • I am having a problem getting VoIP working. This VoIP provider allows you to send RTP packets to any port but they only send RTP packets back to ports 20000-20011. I setup a nat which created an automatic firewall rule for this however it doesn't work. I have a traffic capture below. i am not showing any drops if i look at the real-time filter logs.

    my external ip:
    isp's sip server:
    my voip adapter:

    I setup the following nat rule:
    If  Proto  Ext. port range  NAT IP  Int. port range  Description 
    OPT1 TCP/UDP 20000 - 20011

    It has the following firewall rule:
    Proto  Source  Port  Destination  Port  Gateway  Schedule  Description 
    TCP/UDP * * 20000 - 20011

    tcpdump -i fxp1 net (this is my outside interface)
    12:29:25.151991 IP > UDP, length 172
    12:29:25.163855 IP > UDP, length 172
    12:29:25.174259 IP > UDP, length 172
    12:29:25.184090 IP > UDP, length 172
    12:29:25.192346 IP > UDP, length 172
    12:29:25.203235 IP > UDP, length 172
    12:29:25.209521 IP > UDP, length 172
    12:29:25.223461 IP > UDP, length 172
    12:29:25.233807 IP > UDP, length 172
    12:29:25.243673 IP > UDP, length 172
    12:29:25.249459 IP > UDP, length 172

    • you can see 2 way traffic here

    tcpdump -i em0 net (inside interface)
    12:29:25.143454 IP > UDP, length 172
    12:29:25.163814 IP > UDP, length 172
    12:29:25.184049 IP > UDP, length 172
    12:29:25.203167 IP > UDP, length 172
    12:29:25.223394 IP > UDP, length 172
    12:29:25.243630 IP > UDP, length 172
    12:29:25.263864 IP > UDP, length 172
    12:29:25.282975 IP > UDP, length 172
    12:29:25.303209 IP > UDP, length 172
    12:29:25.323445 IP > UDP, length 172

    • here you only see one way traffic.

    the result of this is that i can talk to people over voip but i cannot hear them. very annoying. any ideas how i can get this inbound traffic onto my network?

  • as a workaround i have a 1:1 nat setup for my external ip to the sip box ip.

    i say this is a workaround because i don't need all ports open on the sip box, and it's a dynamic ip address so if my ip changes, my voip will stop working until i change this setting.

  • Could it be that your provider also expects that outbound connections originate from 20000-20011 as well?
    Have you tried to enable static ports for your voip device?

  • Give us screenshots of your nat and rules please.
    There it no traffic coming from OPT1 to LAN, that is why you can not hear them.

  • sounds like static ports will resolve this. the problem was that the ports were getting re-written, 1:1 nat resolved this.

    if static ports didn't require enabling advance outbound nat, I'd do it. it's too bad I can't have both automatic nat and advanced nat at the same time.


    I've removed the 1:1 nat and setup static port. RTP works perfectly. the problem of course was that the port number was being changed in the nat process and my VoIP provider didn't like this.

    advanced outbound nat is incredibly simple. If I new how easy it was to setup, I would have done this on day 1.

Log in to reply