Messed up IP Routes

Status
Not open for further replies.

SimonLessard

Customer
Joined
Nov 30, 2018
Messages
38
Reaction score
1
Hello,
I installed 3CX in a VM but I think I just messed up with the IP routing tables... I'm no longer sure how should it be configured. I'm using Debian 9.5.
Setup is like this :
  • My 3CX server is Debian 9.5 running in a VM. That computer (192.168.1.12) has a SINGLE NIC and is connected to the business's main switch.
  • The SIP trunks are delivered on a dedicated DSL connexion. The output of the SIP provider modem/router (192.32.21.65) is connected to that same big switch.
  • SIP channels host : 86.178.128.41

I added a virtual interface (enp0S3:1) with static ip address 192.32.21.67 (this static IP address is provided by the provider's modem/router)

Here is my IFCONFIG printout :
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a00:27ff:fecc:542 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:cc:07:54 txqueuelen 1000 (Ethernet)
RX packets 2094579 bytes 185953373 (177.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 136098 bytes 61355810 (58.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s3:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.32.21.67 netmask 255.255.255.0 broadcast 192.32.21.255
ether 08:00:27:cc:07:54 txqueuelen 1000 (Ethernet)

Then I added a static route in order to have the VOIP trafic reach the provider
ip route add 86.178.128.41 via 192.32.21.65 dev enp0s3:1
Now that I added this static route, I can initiate calls to the external world but I have sound incoming only, no outgoing sound.
Although the Firewall checker tool in 3CX report all open ports.

Here is my ROUTE printout :
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.3 0.0.0.0 UG 0 0 0 enp0s3
sip2.provider.ca 192.32.21.65 255.255.255.255 UGH 0 0 0 enp0s3
192.32.21.64 0.0.0.0 255.255.255.252 U 0 0 0 enp0s3
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3

I don't really understand this table but I feel that the issue is somewhere in there. If I don't add the static route, no external call can be made. The sip2.provider.ca gets listed when I create the static route so I guess that it translates to 86.178.128.41. I have no idea where the 192.32.21.64 comes from.

So, is there a way to have this working by using a single NIC + a virtual ethernet adapter (enp0s3:1) like I am trying to do?
Thanks for your help!

Simon
 
Hello Simon,

192.32.21.64 is probably the broadcast address of ISP dedicated IP address.

You should ask your ISP if the registrar IP address (which is 86.178.128.41) is the media GW for SIP Trunk or do they have Media GW on other IP's. If so than you need to add additional routes for media to pass through.

Regards
 
Hello Khorny,

Thanks for your reply. By the time I posted the original message, my setup evolved a little bit and I am closer to something that works. I abandoned the idea of using a single NIC with virtual IPs. I installed a second NIC (enp0s8) with static IP of 192.32.21.67. What solved my outgoing sound issue was to set the External IP address to dynamic (stun) instead of static ip.
My last issue is with the static route I need to have to have my VOIP traffic be routed by 192.32.21.67 to reach 86.178.128.41
If I add the route manually by
ip route add 86.178.128.41 via 192.32.21.65 dev enp0s8

everything works great. But it is non persistent. Obviously the usual way is to edit /etc/network/interfaces and add this
post-up route add -net 86.178.128.41/29 gw 192.32.21.65 dev enp0s8

But it does nothing... the route is not created at reboot.
Any idea?
 
Hello Simon,

Glad to see that you solved the initial problem :)

Did you install Debian distro and than install 3CX on it or did you install from 3cx Debian distro from ISO?
Did you VI etc/network/interfaces with sudo?

If 3cx was installed from 3cx debian ISO and tried to change the file with vi (sudo) and after reboot isn't there, than I sugest to conntact 3cx support and ask them.
I had a problem with setting up local static IP address for 3cx debian distro and after an hour I gave up and set the MAC reservation on DHCP server... (was pissed) but had to work fast as I was installing at costumer site and wasn't having all the cards in my hands.

Will post when I'll try at my demo site if I can replicate your problem.

Regards
 
Dear Khorny,

I used the 3CX Debian distro from ISO.
I solved my problem! While I still don't understand why it was not working, with the command
post-up route add -net 86.178.128.41 netmask 255.255.255.255 gw 192.32.21.65 dev enp0s8

It works now. That is weird since from the documentation and many examples I found, the /xx after the IP address is supposed to work to specify the network mask.

Thanks for your help,
Simon
 
Status
Not open for further replies.

Forum statistics

Threads
111,923
Messages
589,752
Members
164,796
Latest member
Dame24