MikeWang000000/Natter

指定本地端口后无法打洞成功

Opened this issue · 3 comments

L1yp commented

系统:deepin V23

失败日志:
lyp@lyp-PC:~/deploy/Natter$ sudo python3 natter.py -v -b 34567
2024-09-03 22:21:31 [I] Natter v2.1.1
2024-09-03 22:21:31 [D] stun: Got address tcp://...:32114 from tcp://fwa.lifesizecloud.com:3478, source tcp://192.168.0.112:34567
2024-09-03 22:21:32 [D] keep-alive: Connected to host tcp://www.baidu.com:80
2024-09-03 22:21:35 [D] keep-alive: OK
2024-09-03 22:21:35 [D] stun: Got address tcp://...:32114 from tcp://fwa.lifesizecloud.com:3478, source tcp://192.168.0.112:34567
2024-09-03 22:21:35 [I]
2024-09-03 22:21:35 [I] tcp://192.168.0.112:34567 <--Natter--> tcp://...:32114
2024-09-03 22:21:35 [I]
2024-09-03 22:21:35 [I] LAN > 192.168.0.112:34567 [ CLOSED ]
2024-09-03 22:21:35 [I] LAN > 192.168.0.112:34567 [ CLOSED ]
2024-09-03 22:21:35 [I] LAN > ...:32114 [ CLOSED ]
2024-09-03 22:21:36 [D] port-test: ifconfig.co: b'HTTP/1.1 200 OK\r\nDate: Tue, 03 Sep 2024 14:21:36 GMT\r\nContent-Type: application/json\r\nContent-Length: 68\r\nConnection: close\r\nCF-Cache-Status: DYNAMIC\r\nReport-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=4OIKAN5d3v0GAM1VMsdZN7VoepJ3%2BGEYQufI1mf7TYDnxj0baql25R3MnQpttRaWbM6RsszX5ua1trg%2FeTZQYcIpIUKh5Q05TP3AaCaZHG%2BcGYsvD6tmFEyFUuIpFg%3D%3D"}],"group":"cf-nel","max_age":604800}\r\nNEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}\r\nServer: cloudflare\r\nCF-RAY: 8bd6631b1a0194c3-LHR\r\nalt-svc: h3=":443"; ma=86400\r\n\r\n{\n "ip": "...",\n "port": 32114,\n "reachable": false\n}'
2024-09-03 22:21:37 [D] port-test: portcheck.transmissionbt.com: b'HTTP/1.1 200 OK\r\nServer: nginx/1.18.0 (Ubuntu)\r\nDate: Tue, 03 Sep 2024 14:21:37 GMT\r\nContent-Type: text/html; charset=ISO-8859-1\r\nConnection: close\r\n\r\n0'
2024-09-03 22:21:37 [I] WAN > ...:32114 [ CLOSED ]
2024-09-03 22:21:37 [W] !! Target port is closed !!
2024-09-03 22:21:37 [I]
2024-09-03 22:21:40 [D] keep-alive: OK
2024-09-03 22:21:55 [D] keep-alive: OK
2024-09-03 22:22:10 [D] keep-alive: OK
2024-09-03 22:22:25 [D] keep-alive: OK
2024-09-03 22:22:40 [D] keep-alive: OK

不指定端口的成功日志(100%成功):

lyp@lyp-PC:~/deploy/Natter$ sudo python3 natter.py -v
2024-09-03 22:23:46 [I] Natter v2.1.1
2024-09-03 22:23:47 [D] stun: Got address tcp://...:30043 from tcp://fwa.lifesizecloud.com:3478, source tcp://192.168.0.112:33311
2024-09-03 22:23:47 [D] keep-alive: Connected to host tcp://www.baidu.com:80
2024-09-03 22:23:50 [D] keep-alive: OK
2024-09-03 22:23:50 [D] stun: Got address tcp://...:30043 from tcp://fwa.lifesizecloud.com:3478, source tcp://192.168.0.112:33311
2024-09-03 22:23:50 [D] fwd-test: Starting test server at tcp://192.168.0.112:33311
2024-09-03 22:23:51 [I]
2024-09-03 22:23:51 [I] tcp://192.168.0.112:33311 <--Natter--> tcp://...:30043
2024-09-03 22:23:51 [I]
2024-09-03 22:23:51 [I] Test mode in on.
2024-09-03 22:23:51 [I] Please check [ http://...:30043 ]
2024-09-03 22:23:51 [I]
2024-09-03 22:23:51 [I] LAN > 192.168.0.112:33311 [ OPEN ]
2024-09-03 22:23:51 [D] fwd-test: got client ('192.168.0.112', 58118)
2024-09-03 22:23:51 [I] LAN > 192.168.0.112:33311 [ OPEN ]
2024-09-03 22:23:51 [D] fwd-test: got client ('192.168.0.112', 58132)
2024-09-03 22:23:51 [I] LAN > ...:30043 [ OPEN ]
2024-09-03 22:23:51 [D] fwd-test: got client ('...', 30047)
2024-09-03 22:23:52 [D] fwd-test: got client ('45.135.56.46', 54434)
2024-09-03 22:23:52 [D] port-test: ifconfig.co: b'HTTP/1.1 200 OK\r\nDate: Tue, 03 Sep 2024 14:23:52 GMT\r\nContent-Type: application/json\r\nContent-Length: 67\r\nConnection: close\r\nCF-Cache-Status: DYNAMIC\r\nReport-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=msCJdHlD8%2FXnlEqMQABXuZK1I%2FwYu0G8Q0lGQu57YqzK4KgEJv1jpNTu7yj%2FMmFuz4phm6qEN%2BBVmQlm4H9VMHkH2cLJMwUYcWw8jMmVtgM1CLrKSQf2zCvAtPMFnA%3D%3D"}],"group":"cf-nel","max_age":604800}\r\nNEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}\r\nServer: cloudflare\r\nCF-RAY: 8bd6666f9fb9642b-LHR\r\nalt-svc: h3=":443"; ma=86400\r\n\r\n{\n "ip": "...",\n "port": 30043,\n "reachable": true\n}'
2024-09-03 22:23:52 [I] WAN > ...:30043 [ OPEN ]
2024-09-03 22:23:52 [I]
2024-09-03 22:23:55 [D] keep-alive: OK

你看看本地34567端口有在用么?

试了一下,实际上打洞成功了,但是natter没有监听34567端口导致显示Target port is closed。用-p随便指定一个端口又正常了

L1yp commented

现在没问题了 不知道是啥原因。。。