• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

IP Forwarding on CENTOS box.

I have an Asterisk installation on CentOS on a box with four ethernet cards (actually two dual port cards) eth0, eth1, eth2, eth3.  I am currently having a problem with dropped calls and to reduce the finger pointing want to put the box directly on the providers circuit using a static IP address (I have several available from the provider).

Eth2 is currently facing the subnet with the phones.  I would like to use eth3 to interface to the internet using the fixed IP from the provider as I do not have enough IP address for all the phones, and do not want to reprovision all of them.  How do I set up IP forwarding to & from eth2 & eth3?  

To rephrase, I would like eth2 to service the phone subnet, and eth3 to connect to the internet via a fixed IP, and for the asterisk traffic to and from phones (subnet) and trunks (internet) to be automagically routed to the correct place and the connections with the trunk maintained.  Since the trunk can originate connections when inbound calls are received, I need to provide for that in the rules as well.
 
Thanks!
0
hmaupin
Asked:
hmaupin
  • 7
  • 4
1 Solution
 
feptiasCommented:
It depends on the routing table. Make sure there is just one default gateway and that it is the one on the Internet reached through eth3. The default route to the phones will automatically be through eth2 as long as the phones and eth2 are all on the same subnet. You can check the routing table by typing the command "route" at the Linux prompt.

You will also need to fix some settings in Asterisk as follows:
sip.conf > [general] > externip=<ip_address_of_eth3>
sip.conf > [general] > localnet=<subnet_on_eth2>
sip.conf > [trunk_peer_definition] > canreinvite=no
0
 
hmaupinAuthor Commented:
Great, thanks, will give this a go over the weekend and update you.  Thanks!
0
 
hmaupinAuthor Commented:
Apologies, did not have a chance, will have to wait for another opportunity to configure the box.  FYI, Harold
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
hmaupinAuthor Commented:
Well, this did not work, none of the trunk registered after making the changes, changing the network connections, and rebooting.  Had to fall back to the status quo.  Must be missing something basic.
0
 
feptiasCommented:
Please can you post here the output of the Linux "route" command. Also confirm the IP addresses assigned to eth0 to eth3 using the Linux command "ifconfig" and post here the output of the Asterisk CLI command "sip show settings".
0
 
hmaupinAuthor Commented:
The settings (as currently exist in production) are attached as a text file.  Currently eth2 handles all the traffic to/from phones and to/from SIP.  Eth3 is not connected at the moment, but connected it for test.

Thanks!


asterisk-settings.txt
0
 
feptiasCommented:
Did you change the default gateway when you connected eth3?
0
 
hmaupinAuthor Commented:
Yes, but changed it back after things did not register.  Still working on a window to try it again, thanks!
0
 
feptiasCommented:
When you try it again, please capture the same output as before and post back here (if still having problems). Also check if ping works to internal and external addresses and if DNS is working. You may need to change the DNS server addresses in /etc/resolv.conf to the address of a DNS server operated by the ISP and reachable through eth3.

I would expect the routing table to look approximately like the example in the attached file. The new gw_address needs to be an IP address in the subnet 206.205.52.96/255.255.255.252.

I was expecting to see some network settings output for the "sip show settings" command, but perhaps this additional output was only added in version 1.6. I have included an example in the attached file.

myasterisk-settings.txt
0
 
hmaupinAuthor Commented:
Thanks, this is very helpful.  Will be trying it this weekend if all goes well.
0
 
hmaupinAuthor Commented:
Still trying to work out a window ...
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now