NAT problem

My astersik placed behind a firewall. The firewall translate a public ip address to the private ip address of asterisk. My client’s sip phone inside private LAN behind another firewall, the sip phone can access internet share a public ip with other device in the LAN. If it is possible to register the client’s sip phone to my asterisk server?

yes, you have to allow “5060” in TCP/UDP …

yes, i have open 5060 port in firewall of server end. But in the firewall of client end, only permint all port outgoing to internet and deny all port incoming.

Have you tried:
nat=yes in client settings of sip.conf

Download Digium’s free book ‘The Future of Telephony’ for more help.
Download Here

yes. have set nat=yes in sip.conf. but still register fail. Below is the sip debug information.

Destroying call 'MTBmYjA3MDEzZjg4ZjFlYTczNzE0NDlmM2M3NjJiODE.'
VG002*CLI>
<-- SIP read from 202.104.148.152:17823:
REGISTER sip:192.168.142.9;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;rport
Max-Forwards: 70
Contact: sip:petty@192.18.121.131:5060;rinstance=5c57fde27dae2341;transport=UDP
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
Expires: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO
User-Agent: Zoiper for Windows rev.650
Allow-Events: presence
Content-Length: 0

— (13 headers 0 lines)—
Using latest REGISTER request as basis request
Sending to 192.18.121.131 : 5060 (NAT)
Transmitting (NAT) to 202.104.148.152:17823:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17823
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:petty@210.184.118.86
Content-Length: 0


Transmitting (NAT) to 202.104.148.152:17823:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17823
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=as3bd9094a
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:petty@210.184.118.86
WWW-Authenticate: Digest realm=“asterisk”, nonce="59d80c73"
Content-Length: 0


Scheduling destruction of call ‘ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.’ in 15000 ms
VG002*CLI>
<-- SIP read from 202.104.148.152:17823:
REGISTER sip:192.168.142.9;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;rport
Max-Forwards: 70
Contact: sip:petty@192.18.121.131:5060;rinstance=5c57fde27dae2341;transport=UDP
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
Expires: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO
User-Agent: Zoiper for Windows rev.650
Allow-Events: presence
Content-Length: 0

— (13 headers 0 lines)—
Using latest REGISTER request as basis request
Sending to 192.18.121.131 : 5060 (NAT)
Transmitting (NAT) to 202.104.148.152:17823:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17823
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:petty@210.184.118.86
Content-Length: 0


Transmitting (NAT) to 202.104.148.152:17823:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17823
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=as3bd9094a
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:petty@210.184.118.86
WWW-Authenticate: Digest realm=“asterisk”, nonce="59d80c73"
Content-Length: 0


Scheduling destruction of call ‘ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.’ in 15000 ms
VG002*CLI>
<-- SIP read from 202.104.148.152:17825:
REGISTER sip:192.168.142.9;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;rport
Max-Forwards: 70
Contact: sip:petty@192.18.121.131:5060;rinstance=5c57fde27dae2341;transport=UDP
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
Expires: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO
User-Agent: Zoiper for Windows rev.650
Allow-Events: presence
Content-Length: 0

— (13 headers 0 lines)—
Using latest REGISTER request as basis request
Sending to 192.18.121.131 : 5060 (NAT)
Transmitting (NAT) to 202.104.148.152:17825:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17825
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:petty@210.184.118.86
Content-Length: 0


Transmitting (NAT) to 202.104.148.152:17825:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17825
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=as3bd9094a
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
ontact: sip:petty@210.184.118.86
WWW-Authenticate: Digest realm=“asterisk”, nonce="59d80c73"
Content-Length: 0


Scheduling destruction of call ‘ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.’ in 15000 ms
VG002*CLI>
<-- SIP read from 202.104.148.152:17826:
REGISTER sip:192.168.142.9;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;rport
Max-Forwards: 70
Contact: sip:petty@192.18.121.131:5060;rinstance=5c57fde27dae2341;transport=UDP
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
Expires: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO
User-Agent: Zoiper for Windows rev.650
Allow-Events: presence
Content-Length: 0

— (13 headers 0 lines)—
Using latest REGISTER request as basis request
Sending to 192.18.121.131 : 5060 (NAT)
Transmitting (NAT) to 202.104.148.152:17826:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17826
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:petty@210.184.118.86
Content-Length: 0


Transmitting (NAT) to 202.104.148.152:17826:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.18.121.131:5060;branch=z9hG4bK-d8754z-5837d78745115a95-1—d8754z-;received=202.104.148.152;rport=17826
From: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=5f4af73e
To: "13828778872"sip:petty@192.168.142.9;transport=UDP;tag=as3bd9094a
Call-ID: ODI1MjNmMWI3YTI3ZTIwYzEwMDYxOGM4OTEwNDg0MDM.
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
ontact: sip:petty@210.184.118.86
WWW-Authenticate: Digest realm=“asterisk”, nonce="59d80c73"
Content-Length: 0