hnan@ubuntu:~$ sudo apt-get install stunubuntu
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: 0app
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: 2spa
About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message:
Encoding ChangeRequest: 0.net
About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message:
Encoding ChangeRequest: 4server
About to send msg of len 28 to 52.86.10.164:3478
Encoding stun message:
Encoding ChangeRequest: 2get
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: 0it
About to send msg of len 28 to 52.201.75.212:3478
Encoding stun message:
Encoding ChangeRequest: 4io
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
stund -h 192.168.15.58 -v