No option to configure gateway for VoIP NIC

Configuring synchronization, sensors, and optimizations
User avatar
CRM User
Posts: 124
Joined: Sun Nov 27, 2016 3:41 pm

No option to configure gateway for VoIP NIC

Postby CRM User » Sun Mar 25, 2018 1:05 pm

I am using the [voipnic] settings in haast.conf and am able to successfully create a vNIC with an address on my vLAN. The command ifconfig shows:

Code: Select all

eth0.haast: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        ether 02:22:5d:f2:28:ac  txqueuelen 1000  (Ethernet)
        RX packets 14010138  bytes 3242747570 (3.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13347852  bytes 3208082831 (2.9 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But I don't see a gateway set above, and there is no gateway setting in the [voipnic] settings. I tried placing the default gateway into a file called ifcfg-eth0.haast file but that isn't having any effect. Is HAAst missing this setting in the [voipnic] stanza?
Account for questions transferred from CRM system
User avatar
Telium Support
Posts: 162
Joined: Sun Nov 27, 2016 3:27 pm

Re: No option to configure gateway for VoIP NIC

Postby Telium Support » Sun Mar 25, 2018 1:16 pm

Some Linux distributions allow you to configure routing information along with the NIC (in the same NIC configuration file); however, this is misleading - in fact, newer Linux distros no longer allow this practice. Routing information has nothing to do with the NIC. Routing information (eg: default gateway / subnet gateway) is added to the routing table not the NIC.

If you would like to add a route to the routing table from a terminal window then enter a command like:

Code: Select all

route add -net netmask gw

If you would like this route to persist between reboots you would have to enter this information into a config file/script. If you are using the Commercial Unlimited edition of HAAst then you can add the above line to the pre-start event handler /usr/local/haast/events/asterisk.start.pre This event handler will run before the vNIC is brought up so the route will be present when needed. If you like you can also delete this route by adding a line to the the post-stop event handler /usr/local/haast/events/

If you are not using the Commercial Unlimited Edition of HAAst, then you will need to find the most suitable place for these routing rules (which varies considerably between Linux distributions). In your case I suspect you are using a RedHat flavour of Linux, so you could create a file called /etc/sysconfig/network-scripts/route-eth0 with:

Code: Select all

default dev eth0 via dev eth0 via dev eth0

but you should check the guides for your Linux distro to confirm the best place to place 'persistent routes'.