Answer the question
In order to leave comments, you need to log in
How to set up two network interfaces for Asterisk?
Good afternoon, colleagues!
Tell me how to configure two network interfaces in Asterisk on CentOS. Recently, our mini-automatic telephone exchange failed and we had to abruptly switch to this automatic telephone exchange. Unfortunately, I have never worked with Unix systems before. I had to study a huge amount of material in a short time. Now to the essence of the problem:
I have a local network with the following parameters ip:10.101.33.26, dns 10.101.33.251, netmask 255.255.255.0;
During the initial setup: I set up the network, freepbx started working and I was able to connect to the web interface. I set up internal subscribers and made several test calls within the local network. Then I agreed with the provider, who provides us with analog telephony for test data for asteriska. (Initially, the provider brought optics to our premises and installed his switch). On this switch, we were allocated a port and given an IP, gateway, logs, password and test number. I inserted a second network card into asterisk, connected ethernet to it, in the eth1 interface settings I wrote similarly to these:
DEVICE=eth1
BOOTPROTO=static
ONBOOT='yes'
IPADDR=11.22.33.45 //here will be your IP address
NETMASK=255.255.255.252
GATEWAY=11.22.33.46 //your gateway address
HWADDR=00:15:5d:01:02:00 //mac - NIC address
ZONE=trusted
Saved. Restarted the network interfaces with the command: service network restart. I got an error: Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.
Tell me what could be the problem. How to properly configure two network interfaces. 1-interface - our network, in which clients connect to the PBX, 2-interface - the provider's interface.
Answer the question
In order to leave comments, you need to log in
If I understand the situation correctly:
If so, then it's a routing problem.
- Remove GATEWAY line from eth1 settings (in /etc/sysconfig/network-scripts/ifcfg-eth1 file).
- Write a route to the SIP server in the /etc/sysconfig/network-scripts/route-eth1 file (you will need to create it): ***IP of the provider's SIP server*** via ***IP of the provider's gateway*** dev eth1
Reboot/restart the network.
Now the server will go to the Internet through the local network, and to the provider's SIP server through the provider's channel.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question