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!
hmaupinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.