Externip and multiple ip addresses

Below is my config:

firewall (nat) -> asterisk

NAT:
218.190.0.1 -> 192.168.1.1
218.192.0.2 -> 192.168.1.2

sip.conf
[general]
allow=all
nat=yes
externip=218.190.0.1
localnet=192.168.1.0/255.255.255.0

sip proxy registration to 218.190.0.1 is ok but 218.190.0.2 fails.

could we specify multiple externip?

pls kindly advise.

sip client will register the same server via 2 different ip addresses but using the same sip account (that is 2)

If sip proxy is defined as 218.192.0.1 and username is 2, registration is ok.
If sip proxy is defined as 218.192.0.2 and username is 2, registration fails.

sip.conf (continue)

[2]
type=friend
context=default
username=2
secret=12345689
host=dynamic
canreinvite=no
disallow=all
allow=g729

below is the sip messages

<— Transmitting (NAT) to 218.188.188.1:23370 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.123.123:5062;branch=z9hG4bKc0374d9eef;received=218.188.188.1
From: sip:2@218.192.0.2;tag=0e240eae
To: sip:2@218.192.0.2;tag=as10ffe504
Call-ID: 644f4f1712d1a274010077534599eaa8@192.168.123.123
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="2b9067c3"
Content-Length: 0

Try to switch your externip to 218.192.0.2 and see what happens.

I would use externhost instead and define a host name like voip.yourdomain.com.

For that host you add each of the public a-records as well as SRV records accordingly.

Do you register with your upstream? If not your upstream might have to use this host as the adress to terminate incoming calls.

/Payman