I was wanting to add another NIC to my FreePBX but I am experiencing some trouble with this. It’s a virtual machine and I currently have one virtual NIC. I was hoping to add a second NIC so that I have the following -
NIC 0 - Management VLAN and used for accessing the web GUI of FreePBX etc.
NIC 1 - VoIP VLAN, used for phones connecting to SIP etc. on FreePBX and used for the FreePBX to call out and receive calls.
The trouble that I am having is that when I add the second NIC and configure it, the first NIC stops working. Unable to ping etc. and the second NIC takes over?
The VLAN’s are on different subnets. The management VLAN has 10.0.1.1 as the default gateway and the VoIP VLAN has 10.0.20.1 as the default gateway. I created a firewall rule for 10.0.20.0/24, but every time I enable this NIC, the first NIC loses it’s default gateway when I check network under System Admin, default gateway shows as having no value. If I disable the second NIC, the default gateway value returns for the first NIC.
You can’t have more than one gateway defined on a system, since that would make it “multi-homed”. Windows machines you can, but it does cause problems.
What you can do is set routing rules on the box itself for routing rules. That’s what I do with one of our phone carriers. We have a separate WAN connection for them and I simply set a rule that routes traffic to a specific gateway. For example, in my case:
Create or Edit a new file at: /etc/sysconfig/network-scripts/route-eth1
18.104.22.168/24 via 22.214.171.124 (example, as you would replace the voice subnet that your carrier uses and the default gateway, which is the “via”)
Then that will route traffic out that specific gateway.
Thank you both, I appreciate the support. I’ll investigate this, I may end up just having the single NIC and put it onto the VoIP VLAN and do administration from there. Before reading these responses, I tried setting up two NIC’s with different VLAN’s but ended up losing connection to the VM, so ended up reverting the snapshot that I took prior.
I am not currently using any VoIP providers, I’m using a PSTN line that’s converted to VoIP with a Grandstream HT813. My plan was to have two NIC’s on the FreePBX VM. One NIC on the 10.0.1.0/24 network and the other on the 10.0.20.0/24 network. The first NIC would be for the management of FreePBX, accessing the web interface etc. and the second NIC would be for anything VoIP related… in-bound/out-bound calls etc.