一、Stun
用stund-0.97客户端来测试本机的NAT类型。
[email protected]:~/study/stund$ ./client stun.ekiga.net
STUN client version 0.97
Primary: Independent Mapping, Port Dependent Filter, random port, will hairpin
[email protected]:~/study/stund$ ./client stun.iptel.org
STUN client version 0.97
Primary: Independent Mapping, Port Dependent Filter, random port, will hairpin
Return value is 0x000006
图误更正 红色 my NATP-------->my NAPT。
192.168.1.106:32054-------->183.15.192.72:27786 可知有port转换,本机的NAT为NAPT。
MappedAddress = 183.15.192.72 : 27786
ChangedAddress = 212.79.111.155 : 3479
SourceAddress = 212.79.111.156 : 3478
192.168.1.106 : 32054<-------->183.15.192.72 : 27786<-------->212.79.111.156 : 3478
192.168.1.106 : 32055<-------->183.15.192.72 : 27786<-------->212.79.111.155 : 3478
Return value is 0x000006,本机NAT类型为Port restricted cone。