-1

I have FreePBX setup and it has 2 NICs. I've been trying to configure it out so that:

  • eth0 will continue to be the one used for all the office phones and internal calls; and
  • eth1 is the new NIC that would be connected to the internet so that I can make and receive outside calls through to Faktortel, our SIP provider.

I've been working with this great example, but the routing still isn't correct.

The difference is, both NICs are using the same IP address ranges. The server address on eth0 is: 192.168.0.20/255.255.255.0. I would rather the eth1 use DHCP from our internet router, but it is also using 192.168.0.1/255.255.255.0. I'm not sure if this is possible or should it really be on different networks?

The way I understand it is if you make a call it would first check eth0. Then I should have a route (like route-eth0) for sip.faktortel.com.au to eth1 (what if is the same IP address?)? Or does it only need to be in route-eth1?

ifcfg-eth0:

DEVICE=eth0
IPADDR=192.168.0.20
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes

ifcfg-eth1:

DEVICE=eth1
IPADDR=192.168.0.10
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes

/etc/sysconfig/network:

NETWORKING=yes
GATEWAY=192.168.0.1

/etc/sysconfig/network-scripts/route-eth1:

202.43.66.5/24 via 192.168.0.1

Is 202.43.66.5 for sip.faktortel.com.au the right address to add here?

And then how does this whole process work in reserve in order to receive calls?

Ourx
  • 1
  • 1
    What problem are you trying to solve by putting this FreeBSD box in place? If you already have a router, what makes you think that you need a second? – EEAA Sep 27 '15 at 12:58
  • @EEAA I believe he is not trying to get it into routing, just into taking different paths for "internal" and "external" traffic - possibly a crude attempt to have QoS – the-wabbit Sep 27 '15 at 14:05

3 Answers3

1

Your problem is that both interfaces are in the same subnet. When you provide a route to next hop 192.168.0.1, the routing on the server sees that it can use either interface to get there. It may be possible to have it done otherwise, but you're going against the programming, and I wouldn't recommend it.

If you put the phones subnet onto a new subnet, then your problem will resolve itself.

Theo
  • 989
  • 5
  • 11
0

Technically, you are allowed to use the same subnet for VOIP and data, but it's highly not-recommended. Ideally, you'd want to create at least 2 subnets; 1 for your VOIP and 1 for your data. If you do this, you can use proper static routes to manage which subnet traverse which NIC on your server.

CIA
  • 1,604
  • 2
  • 13
  • 32
0

There are two parts to the solution. First, your NIC's must be on different subnets. Your setup above will give you some strange behaviour (like traffic going out one NIC and coming back in the other)

Second, you need to setup on or more static routes to tell your system which route to take for internet traffic, and optionally (if your phones are on another subnet) which route to take for phones.

TSG
  • 1,674
  • 7
  • 32
  • 51