Home > Trixbox > Trixbox behind Fritzbox

Trixbox behind Fritzbox

September 28th, 2009 Leave a comment Go to comments

As of today I’ve replaced my Netgear DG835GB routers, by two identical Fritzbox models 7170. I had to do this, because the Netgear model was not supported for a migration to the “1und1 Komplettanschluss”. I already had replaced the remote end, but because of not being able to establish a VPN between a Netgear and a Frtizbox, I now replaced the central site router as well.
Given that this one has the Trixbox behind it, as expected, it brought some challenges.

Out of the box, Asterisk is registering with external SIP providers via UDP port 5060. Traffic received by the fritzbox using UDP port 5060 is not passed on to devices behind the Fritzbox, because being considered for the Fritzbox itself.
Trying to setup port forwarding on the Fritzbox for UDP port 5060 gives the following error “FEHLER: Eintrag kollidiert mit interner Regel”.

Another solution found on the web suggests to change the port or bindport in sip.conf on the Asterisk server, to a different value than the default 5060. I tried this, including setting up port-forwarding on the router. My trixbox registered now correctly with the various SIP providers I’m using, but my internal extension failed to register correctly.

The solution turned out to be a modification in the fritzbox. I’m using software version 29.04.76.
First of all, you need to make sure telnet access is enabled.

I made the following modifications (using nvi):

In file /var/flash/voip.cfg change:

"sip_srcport = 5060;"

to

"sip_srcport = 5061;"

In file /var/flash/ar7.cfg :

                        forwardrules = "tcp 0.0.0.0:443 0.0.0.0:443 0",
                                       "udp 0.0.0.0:5060 0.0.0.0:5060",

to

                        forwardrules = "tcp 0.0.0.0:443 0.0.0.0:443 0",
                                       "udp 0.0.0.0:5060 192.168.1.3:5060",

192.168.1.3 being the IP address of my Asterisk/Trixbox.

Note that it is important to use the editor nvi on the fritzbox to edit the config files

Categories: Trixbox Tags:
  1. Jeroen
    February 26th, 2010 at 14:01 | #1

    Hi,

    I was testing your configuration, but it seems you need to put the Asterisk ip address in the forwarding rule. I first configured the FB as you said, but I’m getting all lot of strange redirections, but no sip packets are forwarded to the fritzbox. I addition I noticed that the changes made in the voip.cfg and ar7.cfg are not persistent, after 30 minutes or so or after a reboot everything is back to the original states.
    How did you manage to make these changes persistent?

    Kind regards,

    Jeroen

  2. February 26th, 2010 at 16:45 | #2

    @Jeroen
    Hi Jeroen, as mentioned in my email, I’ll check my own configuration again, firmware version etc. because in my case the changes are permanent. Even needed, I’ll update you and the website with corrected information.

    After reviewing I made some changes to the article; it is important to use the nvi editor, there was a typo in the ip-address.

  3. July 11th, 2010 at 17:34 | #3

    I was testing your configuration, but it seems you need to put the Asterisk ip address in the forwarding rule. I first configured the FB as you said, but I’m getting all lot of strange redirections, but no sip packets are forwarded to the fritzbox. I addition I noticed that the changes made in the voip.cfg and ar7.cfg are not persistent, after 30 minutes or so or after a reboot everything is back to the original states.How did you manage to make these changes persistent?
    +1

  4. Steltek
    July 21st, 2010 at 02:16 | #4

    Just FYI: On newer boxes, you need to run ar7changed (or similar) to make the changes stick.

  5. July 21st, 2010 at 23:02 | #5

    @Teodoro
    Trixbox, Fritzbox, it all might become a bit confusing… Trixbox is my Asterisk server, Fritzbox is the router.
    The forward rule should indeed be configured to forward the traffic to your Asterisk server, in my case 192.168.1.3. I use the Trxibox version of Asterisk. The Fritzbox is using internal address 192.168.1.1.
    To make the changes permanent, you could try the ar7changed command, as suggested by Steltek.
    In my case (running firmware 29.04.70) it is not necessary. Mind however that I use the editor nvi.

  1. No trackbacks yet.