INVITE sent by asterisk on public IP to cisco 7960 behind NAT contains public ip of NAT


We have an asterisk 13.7.2 on a public ip (on a datacenter) and a Cisco 7960 behind an adsl router in the office.

The cisco extension is 0104

The INVITE sent by our asterisk (13.7.2) contains 0104@public_ip_of_nat_device

I’ve tried the same thing with another asterisk (I think it was 11) the invite header contains 0104@private_ip _of_cisco_7960 and everything works well

Is there anything I can do on asterisk to make it send the INVITE with the private device ip?

on PJSIP (Asterisk 13.x ) you can use the option external_signaling_address in the transport section. On SIP you will need to play around with the nat settings for this device

@ambiorixg12 Thanks, this device is usng chan_sip atm

When you say “play with the nat settings for this device”. You mean in freepbx/asterisk?

We don’t support FreePBX. If you are getting the public address, it means Asterisk doesn’t think the device is on a local network, so you need to add its subnetwork to the localnet(s) configuration option.

1 Like

@david551 The phone is behind NAT (in an office connected to the internet via ADSL) and asterisk is a vm in a datacenter with a public IP. It doesn’t sound very logical configuring localnet(s) on asterisk.

The private IP is not going to work in that case as it will be interpreted as the private IP of the data centre, not that of network containing the phone. The phone needs to be NAT aware, or the inbound router needs to manipulate the SIP headers to reflect the translation it is performing on the addresses.

Involving routers in such things is usually a bad idea, as they tend to get it wrong.

Note that the original Cisco SIP firmware doesn’t support NAT, as their market was corporate networks.

Wouldn’t it be better to have the data centre system on the corporate network, possibly by using a VPN. That’s also much better security practice.

1 Like