stun测试

1 连接公网测试

hnan@ubuntu:~$ sudo apt-get install stun

hnan@ubuntu:~$ stun stun.stunprotocol.org -v


STUN client version 0.96
Opened port 24364 with fd 3
Opened port 24365 with fd 4
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Received stun message: 68 bytes
MappedAddress = 111.202.230.162:24364
SourceAddress = 52.86.10.164:3478
ChangedAddress = 52.201.75.212:3479
XorMappedAddress = 111.202.230.162:24364
Received message of type 257  id=1
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 52.201.75.212:3478
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 111.202.230.162:24364
Received stun message: 68 bytes
MappedAddress = 111.202.230.162:24364
SourceAddress = 52.86.10.164:3478
ChangedAddress = 52.201.75.212:3479
XorMappedAddress = 111.202.230.162:24364
Received message of type 257  id=1
Received stun message: 68 bytes
MappedAddress = 111.202.230.162:24364
SourceAddress = 52.201.75.212:3478
ChangedAddress = 52.86.10.164:3479
XorMappedAddress = 111.202.230.162:24364
Received message of type 257  id=10
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 111.202.230.162:24364
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 111.202.230.162:24364
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 111.202.230.162:24364
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 111.202.230.162:24364
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 111.202.230.162:24364
Encoding stun message: 
Encoding ChangeRequest: 4

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 2

About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message: 
Encoding ChangeRequest: 0

About to send msg of len 28 to 111.202.230.162:24364
test I = 1
test II = 0
test III = 0
test I(2) = 1
is nat  = 1
mapped IP same = 1
hairpin = 0
preserver port = 1
Primary: Indepndent Mapping, Port Dependent Filter, preserves ports, no hairpin
Return value is 0x000017

2 服务器测试

stund -h 192.168.15.58 -v

猜你喜欢

转载自my.oschina.net/u/208947/blog/794477