Help with dual nics and routing

Need a little assistance as I am still a little new if possible.

I have a new freepbx setup on a hyper v machine with two NICs ;

eth0 is local network (phones, computer, and server)
netmask -
GW - 192.168.1.X

Eth1 (dedicated port on modem from SIP/ISP provider for SIIP traffic)
IP - 10.0.30.X/29
GW - 10.0.30.X

I have had a few struggles, phones connect no issues, but outgoing calls no audio and timeout, in coming hangs up very quickly.
Now also have no internet on the freepbx machine.

I have specified the default nic as the 10.0.30.X (eth1)

tried adding a route command route -add 192.168.1.X via 10.0.30.X eth1 (or similar) and that seemingly lost connection to the machine

I would appreciate some help getting the route for this to work properly, as they would like this going asap.
Keep in mind, I am still new to the whole Freepbx thing

Assign the gateway to your network, assuming its your main network with internet.
Don’t assign a gateway to your network. Leave it out completely in your ifcfg-eth1 file.

Lets say your SIP provider has some sort of IP on ETH1 as network, and their voip gateway is

Just put a route into your pbx that points to your SIP provider gateway specifically out that ETH1 network. Something like this:

route add -net netmask gw dev eth1

This will push all traffic from your pbx for the entire 173.16.10.X IP range to the gateway address of teh /29 network in my example which would be 137.

Should work.

IF it does, you’ll then want to make it static

To make it persistent, add it to this file


Put this into the file


reset the network (or reboot to test)
service network restart

Should be golden.

Also with hyperV, edit the settings of the MAC address of the NIC and make sure its “STATIC”. If you move VM’s around, you’ll loose the MAC address and the nic will go all screwed and you’ll loose the PBX while you attempt to rebuild the 70-persistent-net.rules files.


Thanks, I will attempt that tomorrow!

Well Dickson, yes that was definitely part of the problem, feel like that fixed a few hurdles. Outbound calls work, audio works both ways, and can keep the call going more than 30 seconds, as well I also have internet (but that was another change)
The last struggle, not sure if this is even related, inbound calls I get the freepbx server responding with number is not in service, but I cant help but think it is the inbound trunk settings, as the trunk provider said it could be blank…?

Take a look at the live log for the inbound call
When the call comes in to see what the logging says.
See if it says something like “…you probably want a did for this…”

If you get the message “this number is not in service” you might have a problem with your inbound route. You need to check the log while you try an inbound call.

Yes I checked the inbound route and even changed the inbound to go directly to 1 extension, that extension was the phone that could make the outbound call and seems to be working.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.