Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Solved 2 Network Cards help

Discussion in '3CX Phone System - General' started by Gonzalo, Nov 2, 2017.

Thread Status:
Not open for further replies.
  1. Gonzalo

    Joined:
    Nov 2, 2017
    Messages:
    5
    Likes Received:
    0
    Hello, I have a server configured with 3cx15, I have it in its original version based on Debian. I have 2 network cards installed, one I connect to my SIP and the other I connect to the internet in general with my extensions.

    I can't get the 2 cards to work with their respective configurations.

    I found this guide in which the last point describes my situation but offers a solution for Windows Server but not for my current Debian configuration.

    Is there anything like that solution to apply to my debian-based 3cx15?

    thanks for your help
     
  2. cobaltit

    cobaltit Well-Known Member

    Joined:
    Mar 22, 2012
    Messages:
    1,564
    Likes Received:
    237
    So yes you do the exact same steps substituting the Linux commands for the Windows ones. If you aren't familiar with how to do it, the I'd recommend installing 3CX on a Windows machine. If you don't know how to do it in Debian, then you shouldn't use Debian because when something goes wrong (and it will) you won't know what to do. Don't put yourself in that position.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    YiannisH_3CX likes this.
  3. Gonzalo

    Joined:
    Nov 2, 2017
    Messages:
    5
    Likes Received:
    0
    Thanks for the answer, at this moment we can't think about buying windows server licenses, so from the beginning we did it in debian.

    The guide solution talks about "Windows Routing and Remote access", I haven't find a similar feature in Debian and I find it curious that the same official 3cx guides don't talk about that solution outside Windows.

    isn't there something like that in debian?
     
  4. cobaltit

    cobaltit Well-Known Member

    Joined:
    Mar 22, 2012
    Messages:
    1,564
    Likes Received:
    237
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Thomas 3CX likes this.
  5. sip.bg

    sip.bg Active Member

    Joined:
    Nov 7, 2016
    Messages:
    704
    Likes Received:
    220
    There are issues with 2 network cards in Debian, if web interface is installed from Debian.org ISO.

    If you install Debian from 3CX ISO there are no issues, you may have as many cards as you like, VLAN interfaces, aliases.
    The main interface (e.g. eth0) must have default gateway, all other cards -- no gateway, only IP address and netmask. Use static routes to send traffic over these interfaces. The 3CX must be installed on default interface (with gateway), where you have also access to internet (with NAT). The IP address on this interface can't be changed without reinstalling the 3CX.

    Code:
    #edit network configuration file
    nano  /etc/network/interfaces
     
    # 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 eth0
    auto eth0
    iface eth0 inet static
        address 10.10.10.10             #default IP address of 3CX, can't be changed after installation
        netmask 255.255.255.0
        gateway 10.10.10.1
    dns-nameservers 8.8.8.8
    
    # second interface to SIP provider
    allow-hotplug eth1
    auto eth1
    iface eth1 inet static
        address 10.250.250.2           #IP address of LAN card, used for SIP provider (private LAN)
        netmask 255.255.255.252
    
    #static route to provider
    up route add -net 213.226.61.0/24 gw 10.250.250.1 dev eth1
    
    The above is the code for adding second LAN card (with sample IP addresses), if installed from 3CX ISO. You need to restart network services or better reboot the machine, in order settings to take effect.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 sip.bg, Nov 2, 2017
    Last edited: Nov 2, 2017
    Gonzalo, YiannisH_3CX and eddv123 like this.
  6. Gonzalo

    Joined:
    Nov 2, 2017
    Messages:
    5
    Likes Received:
    0
    Thanks @sip.bg, this makes more sense, all works but can't make calls.

    I've seen the routes and found that the netmask doesn't match my SIP.

    Can I in the last line of my /etc/network/interfaces add that netmask?
     
  7. sip.bg

    sip.bg Active Member

    Joined:
    Nov 7, 2016
    Messages:
    704
    Likes Received:
    220
    The line:
    Code:
    #static route to provider
    
    up route add -net 213.226.61.0/24 gw 10.250.250.1 dev eth1
    defines route with netmask 255.255.255.0 to the provider via your gateway (example: 10.250.250.1) to your SIP provider. Is this what you are asking ?
    You can check current routes with the following command:
    Code:
    route
    If not seeing expected results, check for typos in the 'interfaces' file. Note machine must be rebooted before settings take effect.

    Note in Debian 9 the syntax for defining address of a network card may be:
    Code:
    address: 10.250.250.2/30
    Refer to primary card for proper format.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Gonzalo

    Joined:
    Nov 2, 2017
    Messages:
    5
    Likes Received:
    0
    Yes, i put the command route and i see the default netmask (255.255.255.0) but not my sip mask (255.255.255.248)

    i try to put manually the netmask with the following command:

    Code:
    route add -net 192.168.155.0/24 netmask 255.255.255.248 gw 192.168.150.1 dev eth1
    but, i restart the network services and nothing change applies. i restart the server and again, nothing change aplies.

    i'm google it some other comands to put in the route for fix it but at the moment I haven't found.
     
  9. sip.bg

    sip.bg Active Member

    Joined:
    Nov 7, 2016
    Messages:
    704
    Likes Received:
    220
    The command should look like:
    Code:
    up route add -net 192.168.155.0/24 gw 192.168.155.1 dev eth1
    
    but this is strange, what is the address of your eth1 card ?
    Are you using Debian 8 or 9 ?

    Send me a Private message with all the details about eth0, eth1 configuraton, SIP provider address, etc., if you don't want to make them visible to everybody (i.e. sensitive information).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. sip.bg

    sip.bg Active Member

    Joined:
    Nov 7, 2016
    Messages:
    704
    Likes Received:
    220
    Route must be:
    Code:
    up route add -net 192.168.155.0/29 gw 192.168.155.1 dev eth1 
    and will work if the SIP server has address between 192.168.155.3 and 192.168.155.6
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Gonzalo likes this.
  11. daneke

    Joined:
    May 8, 2017
    Messages:
    46
    Likes Received:
    4
    I love Linux...no registry to get hosed.
     
  12. Gonzalo

    Joined:
    Nov 2, 2017
    Messages:
    5
    Likes Received:
    0
    Yes! that is the right code.

    all works perfectly. thanks a lot for your help :D
     
  13. YiannisH_3CX

    YiannisH_3CX Support Team
    Staff Member 3CX Support

    Joined:
    May 10, 2016
    Messages:
    7,341
    Likes Received:
    535
    Glad to hear the issue in now resolved
     
Thread Status:
Not open for further replies.