Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网络变动后UDP转发疑似受阻 #2201

Open
4 of 5 tasks
Mosney opened this issue Oct 19, 2024 · 3 comments
Open
4 of 5 tasks

网络变动后UDP转发疑似受阻 #2201

Mosney opened this issue Oct 19, 2024 · 3 comments

Comments

@Mosney
Copy link

Mosney commented Oct 19, 2024

操作系统

Linux

系统版本

ImmortalWrt 23.05.4 内核5.15.167

安装类型

sing-box 原始命令行程序

如果您使用图形客户端程序,请提供该程序版本。

No response

版本

sing-box version 1.10.1

Environment: go1.23.2 linux/arm64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: b80ec55ba0aafc60774e19c409e55ced50ddaab3
CGO: disabled

描述

打游戏发现的,如果sing-box一直在运行状态,而网络发生变动,例如重新连接PPPoE,就会有类似阻塞UDP的现象。
这种情况似乎并不是仅在sing-box运行在网络发生变动的主机上时出现,之前sing-box运行在独立网关而网络变动发生在此独立网关的上级网关(即另一主机)时也同样出现过,只要重启sing-box立刻恢复正常。

重现方式

正常状态的UDP流量:
图片

复现步骤(sing-box运行在网络变动主机上):
运行sing-box后,手动重启wan口,即重新PPPoE认证,接口会变、IP也会变,OpenWrt日志如下(倒序、已脱敏):

796	Sat Oct 19 23:59:57 2024	user	notice	firewall: Reloading firewall due to ifup of wan_6 (pppoe-wan)
795	Sat Oct 19 23:59:57 2024	daemon	notice	netifd: Interface 'wan_6' is now up
794	Sat Oct 19 23:59:55 2024	user	notice	firewall: Reloading firewall due to ifupdate of wan (pppoe-wan)
793	Sat Oct 19 23:59:54 2024	user	notice	firewall: Reloading firewall due to ifup of wan (pppoe-wan)
792	Sat Oct 19 23:59:54 2024	daemon	notice	netifd: Interface 'wan_6' is setting up now
791	Sat Oct 19 23:59:54 2024	daemon	notice	netifd: Interface 'wan_6' has link connectivity
790	Sat Oct 19 23:59:54 2024	daemon	notice	netifd: Interface 'wan_6' is enabled
789	Sat Oct 19 23:59:54 2024	daemon	notice	netifd: Interface 'wan' is now up
788	Sat Oct 19 23:59:54 2024	daemon	notice	netifd: Network alias 'pppoe-wan' link is up
787	Sat Oct 19 23:59:54 2024	daemon	notice	netifd: Network device 'pppoe-wan' link is up
786	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: secondary DNS address ***.***.1.66
785	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: primary   DNS address ***.***.1.66
784	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: remote IP address ***.***.0.1
783	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: local  IP address ***.***.1.149
782	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: remote LL address fe80::************
781	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: local  LL address fe80::************
780	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: peer from calling number **:**:**:**:**:** authorized
779	Sat Oct 19 23:59:54 2024	daemon	notice	pppd[****]: PAP authentication succeeded
778	Sat Oct 19 23:59:54 2024	daemon	info	pppd[****]: Remote message: Authentication success, Welcome!
777	Sat Oct 19 23:59:54 2024	daemon	info	pppd[****]: syncppp not active
776	Sat Oct 19 23:59:52 2024	daemon	warn	odhcpd[****]: No default route present, setting ra_lifetime to zero!
775	Sat Oct 19 23:59:51 2024	daemon	notice	pppd[****]: Connect: pppoe-wan <--> eth1
774	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Using interface pppoe-wan
773	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Renamed interface ppp0 to pppoe-wan
772	Sat Oct 19 23:59:51 2024	kern	info	kernel: [268925.405044] pppoe-wan: renamed from ppp0
771	Sat Oct 19 23:59:51 2024	daemon	warn	pppd[****]: Connected to **:**:**:**:**:** via interface eth1
770	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: PPP session is ****
769	Sat Oct 19 23:59:51 2024	daemon	notice	pppd[****]: pppd 2.4.9 started by root, uid 0
768	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: PPPoE plugin from pppd 2.4.9
767	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Plugin pppoe.so loaded.
766	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: wan (****): sh: out of range
765	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: wan (****): uci: Entry not found
764	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: Interface 'wan' is setting up now
763	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: Interface 'wan' is now down
762	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Exit.
761	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Sent **** bytes, received **** bytes.
760	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Connect time *** minutes.
759	Sat Oct 19 23:59:51 2024	daemon	notice	pppd[****]: Connection terminated.
758	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: Network device 'pppoe-wan' link is down
757	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Sent **** bytes, received **** bytes.
756	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Connect time *** minutes.
755	Sat Oct 19 23:59:51 2024	daemon	info	pppd[****]: Terminating on signal 15
754	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: Interface 'wan_6' is now down
753	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: Interface 'wan_6' has link connectivity loss
752	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: Network alias '' link is down
751	Sat Oct 19 23:59:51 2024	daemon	notice	netifd: Interface 'wan_6' is disabled

网络变动之后UDP阻塞。以udp为关键字在debug等级的sing-box日志中查找。
以下是两次复现截取的sing-box日志内容,都并没有游戏相关的UDP,但有21116端口的rustdesk的连接失败记录:

行 2817: +0000 2024-10-19 15:59:58 DEBUG [3196294108 1m35s] inbound/tun[tun-in]: connection closed: upload: write udp4 0.0.0.0:53718->***.***.***.***:21116: sendto: no such device | download: raw-read udp4 0.0.0.0:53718: use of closed network connection
行 4585: +0000 2024-10-19 16:00:54 ERROR [3816057372 2ms] dns: lookup failed for exp.notion.so: exchange6: dial udp ***.***.***.***:53: operation was canceled | exchange4: dial udp ***.***.***.***:53: operation was canceled
行 4599: +0000 2024-10-19 16:00:54 DEBUG [113481580 2ms] dns: lookup failed for HOST.NAME.cn: dial udp 223.5.5.5:443: operation was canceled | dial udp 223.6.6.6:443: operation was canceled
行 4601: +0000 2024-10-19 16:00:54 DEBUG [113481580 2ms] inbound/tun[tun-in]: connection closed: dial udp 223.5.5.5:443: operation was canceled | dial udp 223.6.6.6:443: operation was canceled
行 4636: +0000 2024-10-19 16:00:54 ERROR [3207237264 11ms] dns: lookup failed for courier.push.apple.com: exchange6: dial udp ***.***.***.***:53: operation was canceled | exchange4: dial udp ***.***.***.***:53: operation was canceled
行 20: +0000 2024-10-19 15:56:58 INFO inbound/direct[dns-in]: udp server started at [::]:53
行  827: +0000 2024-10-19 15:57:14 ERROR [3538112285 2ms] dns: exchange failed for 33.144.168.192.in-addr.arpa. IN PTR: dial udp ***.***.***.***:53: connect: no such device
行  837: +0000 2024-10-19 15:57:14 ERROR [3538112285 4ms] dns: exchange failed for 12.144.168.192.in-addr.arpa. IN PTR: dial udp ***.***.***.***:53: connect: no such device
行  839: +0000 2024-10-19 15:57:14 ERROR [3538112285 4ms] dns: exchange failed for 199.144.168.192.in-addr.arpa. IN PTR: dial udp ***.***.***.***:53: connect: no such device
行  841: +0000 2024-10-19 15:57:14 ERROR [3538112285 5ms] dns: exchange failed for 32.144.168.192.in-addr.arpa. IN PTR: dial udp ***.***.***.***:53: connect: no such device
行 1219: +0000 2024-10-19 15:57:27 DEBUG [2614814694 15.99s] inbound/tun[tun-in]: connection closed: upload: write udp4 0.0.0.0:45883->***.***.***.***:21116: sendto: no such device | download: raw-read udp4 0.0.0.0:45883: use of closed network connection

日志

No response

支持我们

完整性要求

  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
  • 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。
@wushuang5112
Copy link

wushuang5112 commented Oct 19, 2024 via email

@Mosney
Copy link
Author

Mosney commented Oct 23, 2024

update:

今天用wireguard发现也受阻了,这次变动的不是上述的pppoe wan口,而是在OpenWrt的devices和interfaces中添加了vlan和bridge,可以排除是因为IP变动导致的。

似乎与 #2167 是同样的症结所在,与auto-redirect和防火墙有关。有时间编译尝试一下 0ef4f80 看能不能解决问题

@Mosney
Copy link
Author

Mosney commented Oct 23, 2024

有时间编译尝试一下 0ef4f80 看能不能解决问题

试了一下 0ef4f80 ,本issue的问题依旧,UDP转发依然受阻。


sing-box version 1.10.0-beta.12

Environment: go1.23.2 linux/arm64
Tags: with_gvisor,with_dhcp,with_wireguard,with_reality_server,with_clash_api,with_quic,with_utls,with_ech
Revision: e68a9e623f09840552554ea15e4973b668a9d648
CGO: disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants