Link to home
Start Free TrialLog in
Avatar of cleard
cleardFlag for Canada

asked on

Asterisk with 2 ip's on different nic card

Hi all,

My sip provider as supplied me with 2 trunk
my Linux server as 2 nic card 2 different ips
trunk 1 external ip is xxx.xxx.xxx.189 router with static route going to internal ip 192.168.2.22 should be for long distance calls.
trunk 2 external ip is xxx.xxx.xxx.190 going to internal ip 192.168.2.29 should be for local calls
my problem is that when I do long distance call is going on ip 2.29 and when I do local calls it goes to the same ip.
My question i how can I get long distance calls to route from Asterisk to the right ip (xxx.xxx.xxx.189)?

Cleard  
Avatar of José Méndez
José Méndez

This is interesting, I don´t think Asterisk can differentiate. When it writes SIP packets it fills the headers with whatever your sip.conf is configured with, but then passes the data to the TCP/IP stack (linux) for routing. I believe once the packet is encapsulated in UDP datagrams by the OS, the routing is left to it making it use the best route to reach the LD carrier. Can you post a route -n here?
Avatar of cleard

ASKER

Willlywiburwonka,

here it is:

192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         192.168.2.4     0.0.0.0         UG    0      0        0 eth0
Avatar of cleard

ASKER

don't forget I did my static route on my cisco pix
ASKER CERTIFIED SOLUTION
Avatar of José Méndez
José Méndez

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 cleard

ASKER

Thanks