FreePBX Dual Nic Config

I know this has been posted multiple times but I am still confused about the configuration and whether this applies to my scenario. I have a new install of FreePBX Distro with v.13 and we have a PC with dual nics cards. The application is the SIP provider gives up a direct trunk through one NIC to their service (with no internet) and the second connection is for the internal network with phones and internet.

eth0 - 192.168.1.x/24 gw 192.168.1.1
eth1 - 10.185.85.x/29 gw 10.185.85.243

All calls need to be routed through the trunk on eth1 while all other traffic is on eth0. Most of the previous posts are for earlier versions and i am not proficient in Linux so i am looking for any config i need to confirm in the web interface.

Sorry for the newbie post!

As long as the Ethernet ports are correctly configured, this should work fine. It’s how almost all of my systems are set up. The only thing that I do different is I hand-configure the Ethernet ports so that the external port is eth0 and the internal port is eth1. Asterisk couldn’t care less about which port is which - as long as the addresses match the networks you’re using, you should be good to go.

What’s your actual question?

Hi Dave,

Guess i was just paranoid about the config! We ended up getting it running without too much issue. The provider required several lines of code to register the trunk correctly.

Our only issue now is the inbound route is not passing the CID correctly and we are unable to route calls to destinations unless i use a catch all route without a CID. I have an output of the SIP invite and the provider is adding a suffix to the CID…

INVITE sip:250595xxxx;[email protected];user=phone SIP/2.0

Any thoughts? We are using FreePBX Distro 13 and Asterix 11. I can start a new string if more appropriate

Check /var/log/asterisk/full and your CDR report to see what the inbound CID actually looks like. I’ll bet it’s something like a country code or e164 format that’s messing you up.

I’m going to repost in the string again because we have been having some major call quality issues with this system and I am at a loss as to where to turn to troubleshoot. The system as described in the original post has 2 network cards, one for the dedicated SIP connection and one for the phones. The calls we are receiving have had varying issues - dropped calls, audio issues where one side can hear you and not the other etc. We have had the provider running traces on their end to try and source the problems and they keep coming up with varying results. The one thing that we have been able to do it to reboot the PBX and that seems to resolve any quality issues but they do re-appear within a day or so. We have even gone as far as replacing the PBX with a new PC to see if that fixes anything.

I am looking for anyone who has experienced any issues with this kind of setup or if there is any info on a possible interface issue between the network connections but in all honesty I feel like I am grasping at straws.

As a test today we set up a test trunk with another provider that ran through our regular internet connection rather than the dedicated sip connection and we ran test calls on both trunks. The dedicated Trunk (where we had all the issues) was garbled and sounded like you were talking under water, while a call on the test trunk worked just fine. Call was clear and quite honestly has less delay and less echo. But again a reboot of the PBX restored the calls with the dedicated trunk back to “normal”.

Any thoughts??

This is always a NAT issue. Without fail. Investigate your router, and make sure it is NOT doing any fiddling with the packets. You may need to enable TLS, or, move the SIP port away from 5060 so the router stops changing things.

Also validate that you have your ports forwarded correctly.

Once you have Asterisk handling the NAT correctly (Settings -> Asterisk Sip Settings) all your problems will go away.

Thats where i run into an issue, the router is handled by the provider, i dont have access to anything. I could enable NAT on the PBX and see if that makes a difference but there aren’t any ports to configure that i have access to. They are running a Cisco 881.

But wouldn’t there always be an issue with audio if there was a NAT issue? This seems to happen periodically not all the time. I could understand if we were running through our own router, modem and connecting to a SIP service via a dynamic ISP but this connection is dedicated to the SIP service and is static.

Okay so I am looking at the wiki with the NAT config, do i have to add both the IP addresses that i am using on the box? for example 192.168.1.0/255.255.255.0 and 10.185.85.0/255.255.255.248?

Sorry maybe i am not thinking this through correctly… I would normally associate NAT with ensuring communications through a firewall for devices on 2 separate networks to talk properly. I would use NAT when the PBX and phones and gateway were all on the same subnet. In this case the primary SIP trunk connection is going through one physical network connection and the phones are connected on another physical network connection with the PBX running the data between subnets. By enabling NAT will this prompt the PBX to translate the IP address of the packets to the SIP connection properly?

Yes. When it sends an INVITE connection it will say ‘Connect to [my external ip address]’ when the host it’s talking to is not in the local networks list.

It sounds like your router is doing this for you, but it’s not working all the time.

Okay that’s what I figured. But this all has to do with the translation from the Wan side to the LAN side which is fine and we can absolutely do that. Does enabling NAT do anything for the transfer of data between the two subnets that the PBX is connected to? Essentially all of the audio data is running through the PBX and it responsible for the translation between the 10.x.x.x network and the 192.x.x.x networks. My assumption was no given that NAT is usually used for translation on the WAN side but essentially I guess that’s what we are doing. I just wanted to make sure that the config was correct if I was to enable it.

I have enabled NAT on the box, calls are going through inbound and outbound no problem so far. Will wait to see how things go for the next day or so.

We have had the same result today even after enabling NAT. Last night we enabled NAT and everything worked great. Calls were coming through nice and clear, very little delay. This morning calls are garbled and delayed. I am not on site yet but my suspicion is that a reboot of the PBX will resolve the issue at least for a little while. It seems to happen overnight each day.

This PBX was running our office phone system for months without issue. The only change was that we loaded the customer config and added the second network card, before we just had the one network card running a single trunk.

I am at a loss here, if there was a suspect piece of hardware I would expect to see an issue all the time. Could it be a buffer or a cache that isn’t clearing properly? It’s not like there were a lot of calls between 11pm and 6am, it’s a small office.

I managed to get to the PBX before anyone else rebooted it and I found and error which hadn’t been reported before. I’ve attached a pic…

@xrobau Could the IRQ be trying to “wake up” the system after a long period of inactivity? If thats the case if the IRQ is ignored and disabled would that explain the slow response to the and call audio problems? I’m not an expert on IRQs so Im not sure if I am just reaching here.

Ive added the irqpoll to the kernel to see if that helps.

Post the output of:-

cat /proc/interrupts|grep 16:

16: 0 0 0 0 IO-APIC-fasteoi pata_via
CAL: 45 161 138 163 Function call interrupts
TLB: 5132 1816 2906 3248 TLB shootdowns

It looks like you have quite old hardware and your PATA hardrive and the realtek NIC are not playing nice together.

That’s what i figured but we dont have a PATA drive, only a SATA. So the conflict is between the PATA and the second NIC. I cannot find any setting to change the IRQ for the NIC or drive port in the BIOS.

And the LSPCI dump shows the two nics at IRQ at 39 and 19…