Two NIC and two modems - configuration

Status
Not open for further replies.

Null

Joined
Apr 12, 2021
Messages
10
Reaction score
2
Hello everyone,
I would be thankful if someone can guide me where to find issue. So we have latest 3cx running on VM via debian 10, unregister SIP, with two modems. Once was for internet, and other was for SIP. All was working fine until we changed setup from two modems to one modem because some of issue with provider.

But once we did switch to use one mode we cant make connection to SIP trunk server. Im quite sure that issue is somewhere in interface configuration, but im not sure where to look and what to change.

To be sure we have right connection to server, we did new install with windows setup and was able to make connection to SIP trunk server, but not without issue. When we added two gateways to NIC there was conflict, so solution was found on https://www.3cx.com/docs/sip-trunk/cyta-cyprus/#h.66ylxkz8bf4y by simply adding static routes.

We did try to do same with debian version, but without luck. Im sure we need to reconfigure interface rules and add some static routes. So here is technical info

3cx: latest
running on debian 10
working on windows 10 right now
2 modems
two NIC ens192 internet and ens224 SIP trunk

Example interface file:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens192
auto ens192
iface ens192 inet static
      address 192.168.10.10/21
      gateway 192.168.10.1
      dns-nameservers 8.8.8.8

# Interface to provider
allow-hotplug ens224
auto ens224
iface ens224 inet static
   address 10.100.22.50/21



up /sbin/ip route add 10.100.254.0/23 via 10.100.22.1 dev ens224
down /sbin/ip route delete 10.100.254.0/23 via 10.100.22.1 dev ens224
//SIP gateway 10.100.22.1
//sip trunk IP 10.100.22.50

SIP domain added to host files
10.100.255.228 ims.mytelecom.com

This configuration above was working fine with two different modems, where ens192 was connected to internet, and ens224 only to sip.
Any advice, or more info needed? (IPs are example, real info edited)
 
There are a few things that you can check to see if the 3CX VM is talking to the right gateway:
  1. Ping the gateway to make sure you're getting a response: ping -c 4 10.100.22.1
  2. Ping the domain IP: ping -c 4 10.100.255.228
  3. Run a trace route to make sure the SIP traffic is going through the correct connection: traceroute 10.100.255.228
If step 1 fails then the VM can't even talk to the gateway and you will need to make sure that your routes are correct.
If step 2 fails make sure you do step 3 to see where the network traffic is going.

PS: the "-c 4" in the ping command just tells it to send 4 pings otherwise it will keep running until to press "^C".
 
  • Like
Reactions: jed
  1. Ping the gateway to make sure you're getting a response: ping -c 4 10.100.22.1
  2. Ping the domain IP: ping -c 4 10.100.255.228

No, unfortunately, cant ping as host is unreachable. Any advice with routes, where to start? Can i use any logics from working window 10 that works right now?

It looks like that is easier option to ask provider to bring back another modem. :)

Thank you for your time Macaroni!
 
@Null but if you are running over a single modem now, why do you still have the static routes pointing to the removed 2nd modem?
 
No, unfortunately, cant ping as host is unreachable. Any advice with routes, where to start? Can i use any logics from working window 10 that works right now?

It looks like that is easier option to ask provider to bring back another modem. :)

Thank you for your time Macaroni!

I have tried setting up a temporary 3CX instance with 2 NICs to see what you might need to do and, from that, I suggest the following changes to the /etc/network/interfaces files:

Change this:
Code:
# Interface to provider
allow-hotplug ens224
auto ens224
iface ens224 inet static
   address 10.100.22.50/21

up /sbin/ip route add 10.100.254.0/23 via 10.100.22.1 dev ens224
down /sbin/ip route delete 10.100.254.0/23 via 10.100.22.1 dev ens224

To this:
Code:
# Interface to provider
allow-hotplug ens224
iface ens224 inet static
   address 10.100.22.50/21
   up ip route add 10.100.254.0/23 via 10.100.22.1 dev ens224

Remove these:
Code:
up /sbin/ip route add 10.100.254.0/23 via 10.100.22.1 dev ens224
down /sbin/ip route delete 10.100.254.0/23 via 10.100.22.1 dev ens224

Reboot your 3CX server and then try pinging the gateway and SIP server to see what happens.
 
  • Like
Reactions: SweetAction
Also, if you want to see what routes your server has, run the comman: ip route show

You should see something like this (I think I got the IPs right):
Code:
default via 192.168.10.1 dev ens192 onlink
10.100.254.0/23 via 10.100.22.1 dev ens224
192.168.8.0/21 dev ens192 proto kernal scope link src 192.168.10.1
10.100.16.0/21 dev ens224 proto kernal scope link src 10.100.22.50/21

If the line 10.100.254.0/23 via 10.100.22.1 dev ens224 is missing then the system hasn't created the static route properly.
 
  • Like
Reactions: SweetAction
Status
Not open for further replies.

Forum statistics

Threads
111,974
Messages
590,081
Members
164,899
Latest member
mazet