Setting outgoing asterisk IP

I have a machine which is going to run an asterisk instance. This machine may or may not be assigned a specific known virtual IP.

I have clients that must be registered to asterisk both from the same machine, thus using the machine’s normal IP, or from outside using the known virtual IP. At the same time, all calls originating from asterisk must only show the known virtual IP.

Basically, I’d like to bind asterisk to the known virtual IP, but at the same time accept registrations from every network interface. This so that every client can register, but outgoing calls will only show that specific IP.

I’ve tried externip but I don’t really have a NAT so I’m not sure if it can even done with that. Any tips? Thanks.

externip controls the IP address within the signaling itself, if you configure it to consider nothing as on the LAN then it would always place that IP address in the signaling no matter what. You can also bind chan_sip to so it will accept traffic on any interface.

Thanks, but how would I go to specify the IP of my machine as the only thing inside the NAT?

Would localnet=my_ip/ work? It does not seem to be working at the moment…

I’ve never done that configuration so I don’t know off the top of my head, but I believe that should…