Natter icon indicating copy to clipboard operation
Natter copied to clipboard

openwrt下pppoe重拨之后不会自动重新打洞

Open MasterOfStar opened this issue 1 year ago • 1 comments

设备:Nokia EA0326GMP 系统版本:ImmortalWrt 21.02-SNAPSHOT r0-e1b4487(mt7981 ARMv8 Processor rev 4 (v8l) x 2 ) 内核版本:5.4.255 python版本:3.10.5 natter版本:2.1.1 设备角色:主路由

natter2通过luci-app-natter2运行,对应的命令为 /usr/bin/python /usr/share/natter2/natter.py -k 15 -m iptables -t 192.168.123.1 -p 8989 -q -v 重启pppoe接口后ip变动,但natter2似乎无法检测到ip变动。

日志如下

2024-08-17 14:40:41 [I] Natter v2.1.1
2024-08-17 14:40:41 [D] fwd-iptables: Found iptables (1, 8, 7)
2024-08-17 14:40:41 [D] fwd-iptables: Cleaning up Natter rules
2024-08-17 14:40:41 [D] stun: Got address tcp://112.12.189.173:20499 from tcp://fwa.lifesizecloud.com:3478, source tcp://10.112.121.29:44097
2024-08-17 14:40:41 [D] keep-alive: Connected to host tcp://www.baidu.com:80
2024-08-17 14:40:44 [D] keep-alive: OK
2024-08-17 14:40:44 [D] stun: Got address tcp://112.12.189.173:20499 from tcp://fwa.lifesizecloud.com:3478, source tcp://10.112.121.29:44097
2024-08-17 14:40:44 [D] fwd-iptables: Adding rule tcp://10.112.121.29:44097 forward to tcp://192.168.123.1:8989
2024-08-17 14:40:44 [I] 
2024-08-17 14:40:44 [I] tcp://192.168.123.1:8989 <--iptables--> tcp://10.112.121.29:44097 <--Natter--> tcp://112.12.189.173:20499
2024-08-17 14:40:44 [I] 
2024-08-17 14:40:44 [I] Calling script: /var/etc/natter2/110d787c-0-0
2024-08-17 14:40:44 [I] LAN > 192.168.123.1:8989    [ OPEN ]
2024-08-17 14:40:44 [I] LAN > 10.112.121.29:44097   [ OPEN ]
2024-08-17 14:40:44 [I] LAN > 112.12.189.173:20499  [ OPEN ]
2024-08-17 14:40:45 [D] port-test: ifconfig.co: b'HTTP/1.1 200 OK\r\nDate: Sat, 17 Aug 2024 06:40:45 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=KieAClKEMSOOVe%2BadZrIfG4wIagIXCF92HcfZaTN2YMA5S1gefxRj%2F2kK4doIeZxw0jhG7vXZxfCJgbAcctEMyb2vgE07Kdj1gUAh16ZDlZvbAkbx%2B5t6OuWekaL6g%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: 8b47aca89f5f104f-HKG\r\nalt-svc: h3=":443"; ma=86400\r\n\r\n{\n  "ip": "213.130.141.82",\n  "port": 20499,\n  "reachable": false\n}'
2024-08-17 14:40:46 [D] port-test: portcheck.transmissionbt.com: b'HTTP/1.1 200 OK\r\nServer: nginx/1.18.0 (Ubuntu)\r\nDate: Sat, 17 Aug 2024 06:40:45 GMT\r\nContent-Type: text/html; charset=ISO-8859-1\r\nConnection: close\r\n\r\n1'
2024-08-17 14:40:46 [I] WAN > 112.12.189.173:20499  [ OPEN ]
2024-08-17 14:40:46 [I] 
2024-08-17 14:40:49 [D] keep-alive: OK
2024-08-17 14:41:04 [D] keep-alive: OK
2024-08-17 14:41:19 [D] keep-alive: OK
2024-08-17 14:41:34 [D] keep-alive: OK
2024-08-17 14:41:49 [D] keep-alive: OK
2024-08-17 14:42:04 [E] keep-alive: connection broken: timed out
2024-08-17 14:42:16 [D] Start recheck
2024-08-17 14:42:16 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:42:16 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:42:16 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:42:31 [D] Start recheck
2024-08-17 14:42:35 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:42:36 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:42:38 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:42:53 [D] Start recheck
2024-08-17 14:42:54 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:42:54 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:42:55 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:43:10 [D] Start recheck
2024-08-17 14:43:10 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:43:10 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:43:10 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:43:25 [D] Start recheck
2024-08-17 14:43:25 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:43:25 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:43:25 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:43:40 [D] Start recheck
2024-08-17 14:43:40 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:43:40 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:43:40 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:43:55 [D] Start recheck
2024-08-17 14:43:55 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:43:55 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:43:55 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:44:10 [D] Start recheck
2024-08-17 14:44:10 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:44:10 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:44:10 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:44:25 [D] Start recheck
2024-08-17 14:44:25 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:44:25 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:44:25 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:44:40 [D] Start recheck
2024-08-17 14:44:40 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:44:40 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:44:40 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:44:55 [D] Start recheck
2024-08-17 14:44:55 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:44:55 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:44:55 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:45:10 [D] Start recheck
2024-08-17 14:45:10 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:45:10 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:45:10 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:45:25 [D] Start recheck
2024-08-17 14:45:25 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:45:25 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:45:25 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:45:40 [D] Start recheck
2024-08-17 14:45:40 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:45:40 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:45:40 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:45:55 [D] Start recheck
2024-08-17 14:45:55 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:45:55 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:45:55 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:46:10 [D] Start recheck
2024-08-17 14:46:10 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:46:10 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:46:10 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:46:25 [D] Start recheck
2024-08-17 14:46:25 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:46:25 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:46:25 [E] keep-alive: connection broken: [Errno 99] Address not available
2024-08-17 14:46:40 [D] Start recheck
2024-08-17 14:46:40 [D] LAN > 112.12.189.173:20499  [ UNKNOWN ]
2024-08-17 14:46:40 [D] Cannot test port 112.12.189.173:20499 from LAN because: [Errno 99] Address not available
2024-08-17 14:46:40 [E] keep-alive: connection broken: [Errno 99] Address not available

重新运行natter2,则能通过新的ip打洞

2024-08-17 14:49:16 [I] Natter v2.1.1
2024-08-17 14:49:16 [D] fwd-iptables: Found iptables (1, 8, 7)
2024-08-17 14:49:16 [D] fwd-iptables: Cleaning up Natter rules
2024-08-17 14:49:16 [D] stun: Got address tcp://112.12.188.219:5830 from tcp://fwa.lifesizecloud.com:3478, source tcp://10.112.120.211:38723
2024-08-17 14:49:16 [D] keep-alive: Connected to host tcp://www.baidu.com:80
2024-08-17 14:49:19 [D] keep-alive: OK
2024-08-17 14:49:19 [D] stun: Got address tcp://112.12.188.219:5830 from tcp://fwa.lifesizecloud.com:3478, source tcp://10.112.120.211:38723
2024-08-17 14:49:19 [D] fwd-iptables: Adding rule tcp://10.112.120.211:38723 forward to tcp://192.168.123.1:8989
2024-08-17 14:49:19 [I] 
2024-08-17 14:49:19 [I] tcp://192.168.123.1:8989 <--iptables--> tcp://10.112.120.211:38723 <--Natter--> tcp://112.12.188.219:5830
2024-08-17 14:49:19 [I] 
2024-08-17 14:49:19 [I] Calling script: /var/etc/natter2/110d787c-0-0
2024-08-17 14:49:19 [I] LAN > 192.168.123.1:8989    [ OPEN ]
2024-08-17 14:49:19 [I] LAN > 10.112.120.211:38723  [ OPEN ]
2024-08-17 14:49:19 [I] LAN > 112.12.188.219:5830   [ OPEN ]
2024-08-17 14:49:20 [D] port-test: ifconfig.co: b'HTTP/1.1 200 OK\r\nDate: Sat, 17 Aug 2024 06:49:20 GMT\r\nContent-Type: application/json\r\nContent-Length: 66\r\nConnection: close\r\nCF-Cache-Status: DYNAMIC\r\nReport-To: {"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=LjRG9dzH1frqdHDDidy04BcftprBTDtrtE28pruBvVAtsaNgXBLCS6POiGIicwY%2FMaljxdEIoWNsJ1LuVGHGGK4%2FLyS8QzsvR6THM2IloPlj7Ne%2B6W%2BGVHfP1LTobA%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: 8b47b93b6b780448-HKG\r\nalt-svc: h3=":443"; ma=86400\r\n\r\n{\n  "ip": "213.130.141.82",\n  "port": 5830,\n  "reachable": false\n}'
2024-08-17 14:49:21 [D] port-test: portcheck.transmissionbt.com: b'HTTP/1.1 200 OK\r\nServer: nginx/1.18.0 (Ubuntu)\r\nDate: Sat, 17 Aug 2024 06:49:21 GMT\r\nContent-Type: text/html; charset=ISO-8859-1\r\nConnection: close\r\n\r\n1'
2024-08-17 14:49:21 [I] WAN > 112.12.188.219:5830   [ OPEN ]
2024-08-17 14:49:21 [I] 
2024-08-17 14:49:24 [D] keep-alive: OK

MasterOfStar avatar Aug 17 '24 06:08 MasterOfStar

看起来确实是个问题,感谢反馈。

MikeWang000000 avatar Feb 09 '25 19:02 MikeWang000000

我这边也差不多

2025-11-18 14:21:34 [E] stun: No STUN server is available right now
2025-11-18 14:21:44 [W] stun: STUN server tcp://fwa.lifesizecloud.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://global.turn.twilio.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://turn.cloudflare.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://stun.nextcloud.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://stun.freeswitch.org:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://stun.voip.blackberry.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://stun.sipnet.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://stun.radiojar.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://stun.sonetel.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://stun.telnyx.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [W] stun: STUN server tcp://turn.cloud-rtc.com:80 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:44 [E] stun: No STUN server is available right now
2025-11-18 14:21:54 [W] stun: STUN server tcp://fwa.lifesizecloud.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://global.turn.twilio.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://turn.cloudflare.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://stun.nextcloud.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://stun.freeswitch.org:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://stun.voip.blackberry.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://stun.sipnet.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://stun.radiojar.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://stun.sonetel.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://stun.telnyx.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [W] stun: STUN server tcp://turn.cloud-rtc.com:80 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:21:54 [E] stun: No STUN server is available right now
2025-11-18 14:22:04 [W] stun: STUN server tcp://fwa.lifesizecloud.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://global.turn.twilio.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://turn.cloudflare.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://stun.nextcloud.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://stun.freeswitch.org:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://stun.voip.blackberry.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://stun.sipnet.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://stun.radiojar.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://stun.sonetel.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://stun.telnyx.com:3478 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [W] stun: STUN server tcp://turn.cloud-rtc.com:80 is unavailable: [Errno 101] Network unreachable
2025-11-18 14:22:04 [E] stun: No STUN server is available right now
2025-11-18 14:22:14 [W] stun: STUN server tcp://fwa.lifesizecloud.com:3478 is unavailable: [Errno 101] Network unreachable

重新拨号之后,即使网络恢复正常也是这些报错

yandujun363 avatar Nov 18 '25 06:11 yandujun363

这个问题应该已经修复,看下版本号是否为最新

MikeWang000000 avatar Nov 18 '25 07:11 MikeWang000000