[Home]

Summary:ASTERISK-06469: SIP Responds on incorrect IP
Reporter:Jason Burbage (jburbage)Labels:
Date Opened:2006-03-03 12:43:10.000-0600Date Closed:2006-03-03 17:12:48.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) tcpdump.txt
Description:When Asterisk receives any type of request via SIP, it always responds on (apparently) the first IP bound to the first ethernet interface, even when sip is bound to all.

From sip.conf:
bindaddr=0.0.0.0

I attempted to register a SIP device from 64.58.2.6 to the server configured as above, which has a single ethernet interface configured with two IP addresses.  eth0 is set to 64.58.2.12 and eth0:1 is set to 64.58.2.51.  The phone can register and place calls if it is configured to register with 64.58.2.12, but not 64.58.2.51.

I ran:
tcpdump -An udp port 5060 and host 64.58.2.6

Attempted to register to 64.58.2.51, and saw the output in the attached file.  SIP debug output is not helpful in this case since it does not contain originating IP information for outgoing packets.

However, you can see from the tcpdump that asterisk repeatedly attempts to respond to the SIP device on an IP from which it received no requests.

This behavior also appears to extend to all SIP methods including NOTIFY and INVITE, as you can see from the tcpdump.  It may even be broader than just chan_sip, however that's what I was able to test.

****** ADDITIONAL INFORMATION ******

I mentioned this briefly to OEJ at AstriCon Training in Miami December 5-9.

To reproduce, configure your ethernet interface with two IP addresses and attempt to use the second, with SIP bound to all addresses (0.0.0.0).

SIP does appear to bind to the second address if explicitly configured to do so.
Comments:By: Andrey S Pankov (casper) 2006-03-03 16:06:29.000-0600

Why do you think asterisk should respond from 64.58.2.51?
I'm about sure that 'ip route get 64.58.2.6' will show you that your kernel would chose 64.58.2.12 as src address.

By: Tilghman Lesher (tilghman) 2006-03-03 17:12:48.000-0600

This has been asked many times before, and the answer is still the same.  We simply don't support this behavior.  We do, however, support a multihomed host, as long as the system routes match up to use a different interface to send to that address.  Or, in other words, you cannot alias your Ethernet interface to multiple addresses and expect it to work.