Friday, October 11, 2019

Two NIC's on same Debian Machine

Hello everyone!

I am kind of n00b in networking, but I successfully installed a Debian machine who runs my 3CX server. The main ideea is that my SIP Trunk provider requires me to connect to the SIP Server through a dedicated VPN MPLS connection that is made by the ONT installed in location. Good, 3CX requires also internet connection in order to be accessible from the internet (Mobile 3CX App, and stuff like this). So, my configuration looks in the following way:

  • Debian Server with 2 NIC's -> NIC 1 - in my router (IP class: 10.11.12.0/24) where I have internet connection / NIC 2 - in my ONT - for MPLS VPN, in order to be able to connect to the SIP Trunk (on this NIC I don't have internet connection).

Also, I need to specify to the network card that I use an IP, NM and GW. Also, in order to access the SIP Server I have to pass 2 different DNS servers, hosted by my ISP (SIP Trunk).

My concern is that now I successfully managed to install 3CX on Debian server, but now I don't have internet connection to the server, even that I added routes to manage this.

Can I receive some advice in how to setup it in order to be both NIC's accessible by the server, first NIC for internet connection and the second NIC to connect to the SIP Provider?

Here is my /etc/network/interfaces config:

(enp2s0 - LAN CARD 1 - Internet Connection / enp5s0 - LAN CARD 2 - Connected to the SIP Server)

source /etc/network/interfaces.d/*

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

allow-hotplug enp2s0

iface enp2s0 inet static

address 10.11.12.150

netmask 255.255.255.0

dns-nameservers 1.1.1.1

dns-search 3cx

post-up ip route add 10.11.12.1/24 dev enp2s0 src 10.11.12.150 table rt2

post-up ip route add default via 10.11.12.1 dev enp2s0 table rt2

post-up ip rule add from 10.11.12.150/32 table rt2

post-up ip rule add to 10.11.12.150/32 table rt2

allow-hotplug enp5s0

iface enp5s0 inet static

address 192.168.30.94

netmask 255.255.255.252

gateway 192.168.30.93

My /etc/resolv.conf:

search 3cx

nameserver 82.xx.xx.xx

nameserver 82.xx.xx.xx

nameserver 1.1.1.1

Thank you in advice!



No comments:

Post a Comment