Link to home
Start Free TrialLog in
Avatar of hmaupin
hmaupinFlag for United States of America

asked on

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!
Avatar of Member_2_1968385
Member_2_1968385
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of hmaupin

ASKER

Great, thanks, will give this a go over the weekend and update you.  Thanks!
Avatar of hmaupin

ASKER

Apologies, did not have a chance, will have to wait for another opportunity to configure the box.  FYI, Harold
Avatar of hmaupin

ASKER

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.
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".
Avatar of hmaupin

ASKER

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
Did you change the default gateway when you connected eth3?
Avatar of hmaupin

ASKER

Yes, but changed it back after things did not register.  Still working on a window to try it again, thanks!
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1968385
Member_2_1968385
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hmaupin

ASKER

Thanks, this is very helpful.  Will be trying it this weekend if all goes well.
Avatar of hmaupin

ASKER

Still trying to work out a window ...