[asterisk-dev] Feature planned? Ability to specify per sip trunk network interface - if not workaround?

jwexler at mail.usa.com jwexler at mail.usa.com
Wed Jul 28 06:30:31 CDT 2010


Hi, a year and a few months ago, this feature did not exist and was not on
the radar yet:

http://www.mail-archive.com/asterisk-dev@lists.digium.com/msg37756.html

 

Has there been any progress, plans, or other on adding this since then?

 

If not, I have been having a dog of a time trying to create a work around
for this on the Asterisk box (Ubuntu 10.04 LTS). Asterisk is 1.4.33.1
compiled with the patch for registering to router rt200ne
(http://voip-info.jp/index.php/RT-200NE%E5%AF%BE%E5%BF%9C%E3%83%91%E3%83%83%
E3%83%81).

 

NTT RT-200NE router at 192.168.40.1

 

Asterisk Server:

eth0 192.168.40.2

eth1 192.168.40.3

 

I have tried the following and nearly made it work but still not dice:

 

iptables -t nat -A OUTPUT -p all -d 192.168.40.3 -j DNAT --to-destination
192.168.40.1

(Note: -A PREROUTING did not work at all but -A OUTPUT got me closer)

 

iptables -t nat -A POSTROUTING -p all -j MASQUERADE

 

 

iptables -t nat -n -L

 

Chain PREROUTING (policy ACCEPT) target prot opt source destination 

 

 

Chain POSTROUTING (policy ACCEPT)

target          prot  opt  source    destination 

MASQUERADE  all   --   0.0.0.0/0   0.0.0.0/0 

 

Chain OUTPUT (policy ACCEPT)

target  prot  opt source    destination 

DNAT  all    --  0.0.0.0/0  192.168.40.3    to:192.168.40.1 

 

"ping 192.168.40.3 -I eth1" and "ping 192.168.40.3" both work fine.

I can access the router and login to it via http://192.168.40.3/. Therefore
port 80 is working.

 

route -n

Receipt Site   Gateway      Netmask        Flags  Metric Ref  Use #
Interface

192.168.40.1   0.0.0.0       255.255.255.255  UH    0     0   0      eth0

0.0.0.0        192.168.40.1  0.0.0.0          UG    0     0   0      eth0

 

ip route show

192.168.40.1 dev eth0 proto static scope link

default via 192.168.40.1 dev eth0 proto static 

 

ip rule show

0: from all lookup local

32766: from all lookup main

32767: from all lookup default 

 

 

ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope
host lo etc....

 

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UNKNOWN qlen 1000

 

inet 192.168.40.2/32 brd 192.168.40.2 scope global eth0 etc....

 

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UP qlen 1000

 

inet 192.168.40.3/32 brd 192.168.40.3 scope global eth1 etc....

 

5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UP qlen 1000

etc....

(eth2 is currently down)

 

In sip.conf:

bindport=5060

bindaddr=0.0.0.0

rt200ne=192.168.40.1

rt200ne=192.168.40.3

 

register => 3:username:password at 192.168.40.1/123456789

will register but

register => 3:username:password at 192.168.40.3/123456789

will not register

 

Any ideas why ping and http to 192.168.40.3 is successfully directed to

192.168.40.1 but the asterisk registration to 192.168.40.3 on port 5060 is

not? Any ideas as to things to try to get this workaround or another
workaround to solve the issue?

 

Thanks!!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20100728/7b282ddb/attachment.htm 


More information about the asterisk-dev mailing list