[asterisk-users] iax2 bindaddress: how to reload so iax2 can bind to an alias IP

Vieri rentorbuy at yahoo.com
Sat Jan 10 07:22:36 CST 2009


--- On Fri, 1/9/09, Josiah Bryan <jbryan at productiveconcepts.com> wrote:

> >>> --- On Fri, 1/9/09, Josiah Bryan
> >> <jbryan at productiveconcepts.com> wrote:
> >>>> Is this right after bringing online the
> alias IP?
> >>>> If so, you might try using arp-sk to
> broadcast an
> >> ARP
> >>>> packet to kick-start the IP lookup...
> >>>> http://sid.rstack.org/arp-sk/
> >>> Thanks for the link.
> >>> However, it's not that the two boxes
> don't
> >> "see" each other: they can ping,
> >>> do HTTP, etc. The only service not working is
> IAX (ie.
> >> "iax2 show peers"
> >>> says that the peer is unreachable). So
> basically, if I
> >> try to communicate
> >>> with the alias IP address via several
> protocols such
> >> as HTTP, ICMP, SSH,
> >>> etc, then all works fine. However, if I setup
> a iax
> >> trunk, it does not
> >>> work.
> >>> I also tested the connection with a softphone
> (zoiper)
> >> and it fails too (it
> >>> fails to connect to the alias IP but it
> connects fine
> >> to the nic's
> >>> "standard" IP address).
> >>> 
> >>> So, I'm puzzled by the following:
> >>> 
> >>> These WORK:
> >>> telnet <alias_IP> 80
> >>> ssh <alias_IP>
> >>> ping <alias_IP>
> >>> iaxclient <standard_IP>
> >>> 
> >>> But this doesn't:
> >>> iaxclient <alias_IP>
> >>> 
> >>> even though iax.conf has bindaddr=0.0.0.0
> >>> 
> >>> Any clue as to why it's behaving this way?
> >> Yes.  All protocols prior to 1.6.0 use the routing
> table to
> >> determine what
> >> address to use when sending out packets related to
> a call. Normally, the
> >> alias address is not in the routing table at all,
> which is
> >> why it is not
> >> 'seen' by IAX2.  Now, starting in 1.6.0,
> we have
> >> the capability within
> >> Asterisk to use alias addresses within certain
> protocols,
> >> but AFAIK, that
> >> has only been implemented within the SIP stack.
> > 
> > Thanks for your helpful feedback.
> > 
> > Curiously, UDP SIP works with alias IP addresses even
> in 1.2.30.
> > I guess that the IAX implementation is lagging behind
> in this particular field.
> > 
> 
> 
> With re: to the routing table - it may be a silly question,
> but is that an arp routing table? If so, could you use
> arp-sk to force populate the routing table for the alias?

Thanks, that made me try the following:

Host voip1 (192.168.250.111) has alias IP address 192.168.250.115
Host voip2 (192.168.250.110) fails to establish a IAX trunk with voip1's alias IP address.

voip1 # ip route list
192.168.250.0/24 dev eth1  proto kernel  scope link  src 192.168.250.111
192.168.251.0/24 dev eth2  proto kernel  scope link  src 192.168.251.111
10.215.144.0/22 dev eth0  proto kernel  scope link  src 10.215.147.111
127.0.0.0/8 dev lo  scope link
default via 10.215.144.91 dev eth0

voip1 # ip route add 192.168.250.110/32 dev eth1 proto kernel scope link src 192.168.250.115

voip1 # ip route flush cache

voip1 # ip route list
192.168.250.110 dev eth1  proto kernel  scope link  src 192.168.250.115
192.168.250.0/24 dev eth1  proto kernel  scope link  src 192.168.250.111
192.168.251.0/24 dev eth2  proto kernel  scope link  src 192.168.251.111
10.215.144.0/22 dev eth0  proto kernel  scope link  src 10.215.147.111
127.0.0.0/8 dev lo  scope link
default via 10.215.144.91 dev eth0

Now, host voip2 (192.168.250.110) can establish a IAX trunk with voip1's alias IP address (192.168.250.115) as testifies a "iax2 show peers".

This is fine for my setup (trunk). However, if I have dynamic clients in a whole subnet then it won't be feasible.

If I do:

voip1 # ip route del 192.168.250.110/32 dev eth1 proto kernel scope link src 192.168.250.115
voip1 # ip route flush cache

Then on voip2 I get:

voip2 *CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status
coinbound        192.168.250.115 (S)  255.255.255.255  4569          UNREACHABLE

voip2 # arp -a
? (10.215.144.91) at 00:01:02:A4:3A:1E [ether] on eth0
? (192.168.250.115) at 00:1D:60:B0:25:10 [ether] on eth1
? (192.168.250.112) at 00:1D:60:39:E9:1B [ether] on eth1
? (192.168.250.111) at 00:1D:60:B0:25:10 [ether] on eth1

As you can see, the arp cache seems OK.

How could I use arp-sk (first time I deal with it)?

voip1 # arp-sk -w -d 192.168.250.110 -S 192.168.250.115 -D 192.168.250.110

Or better yet, can anyone suggest a correct usage of "ip route" when adding alias IP addresses? (obviously, I'm not an iproute2 expert)

Thanks again,

Vieri

PS: it may sound off-list but my routing questions are due to the fact that the SIP and IAX implementations have a different "network behavior".
 



      



More information about the asterisk-users mailing list