Linux dual NIC configuration

Usage

In our experience, a 3CX server with dual Network cards are typically the following scenarios. One network card is used to connect to the internal network for internal extension registration. One network card is used to connect SIP Trunk.

3CX share Windows Server dual network interface cards configuration guide here.

We will share Linux Server’s configuration today.

Configuration in Debian

First of all, we should check two network interface cards name:

$ ip address

In this example, names of the two netowrk interface cards are ens192 and ens224. ens192 for internal extension registration, ens224 for SIP Trunk connection.

we can see that the network card ens224 is not getting an IP address, we need to set it manually.

$ sudo nano /etc/network/interfaces

NIC ens224 only needs to set the IP address and subnet mask, no need to set the gateway address.

After modification, press Ctrl + O to save, then press Ctrl + X to exit.

We need to reboot this server, after reboot enter command route check routing table.

We can see that default data will go to the network card ens192, data will go to the network card ens224 if destination is 172.16.2.0 segment network.

If 3CX second NIC and remote end are not on the same segment, we need add following information of the /etc/network/interfaces file.

#static route to provider
  • 213.226.61.0/29 is the remote side SIP trunk IP address and subnet mask.
  • 172.16.2.1 is the gateway of SIP trunk
  • ens224 is the network interface card that connect to SIP trunk

Configruation in 3CX

In SIP Trunk -> edit SIP Trunk -> Options -> Advanced -> Select which IP to use in ‘Contact’ (SIP) and ‘Connection’ (SDP) fields.

Chooe option Use thie IP address

Enter the second NIC cards IP address, in this example is IP address of ens224.