Summary:ASTERISK-14009: externip is ignored for Audio unless localnet is defined
Reporter:Michael Rack (rcrack2k)Labels:
Date Opened:2009-04-23 14:17:46Date Closed:2011-06-07 14:07:19
Versions:Frequency of
Environment:Attachments:( 0) audio-setup.log
Description:As described in http://bugs.digium.com/view.php?id=8821 the same issue is existing in Asterisk

My Asterisk-Server is multihomed and have 3 public routed ip-addresses. Two IP-Addresses assigned static and once dynamic.

I need to select the dynamic ip-address, because my ISP on the other side accepts REGISTER, INVITE and so on only from the Interface thats connected to my ISP.


I didn't define a localnet property.
I tryed to switch matchexterniplocally between yes and no, but no effect.

After define an localnet-entry with 91.2xx.12.0/24 the Audio-Setup-IP-Address works as expected.

How can i allways set my IP-Address for any communication SDP / Messaging to the externip-Address?

Michael Rack.
Comments:By: Leif Madsen (lmadsen) 2009-04-23 15:14:33

I'm not sure if this is a configuration issue or not, so I'm assigning to file since he fixed 8821 originally it seems.

By: Michael Rack (rcrack2k) 2009-04-24 02:31:53

To get more hint on the network-configuration:

wan1 - IP-Address: (dynamic assigned IP-Address)
wan2 - IP-Address: (static assigned IP-Address)
vpn1 - IP-Address: (static assigned IP-Address)

Default-Route is dynamic an will be selected by BGP4-Routing for wan2 and vpn1. Interface wan1 is only in use to route VPN- and SIP-Traffic.

Asterisk have to send traffic through wan1 (externip= My Linux-Policy-Routing allways routes traffic through that interface where SRC-IP-Address is matching, else traffic is routed via default-gateway.

A feature such as "interface=wan1" were recommend. Asterisk should take the ip-address from the interface and take this for SIP-/ RDP-Communications and ip-header creation...

The interface-name should be defined in peer-section also.


By: Joshua C. Colp (jcolp) 2009-04-24 08:27:08

Currently you can achieve this by having chan_sip bind to the specific IP address you want to use, otherwise it binds to all and has to guess what IP address to use in the messages. There is currently no way to bind to multiple IP addresses and have each message contain the correct IP address. You can only bind to one.