You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
为什么会出现 TUN 环路?(问题根源)
仔细复盘 #9974 的日志,这个死循环现象其实发生在 双核模式(即 sing-box 作为前置 TUN 服务 + Xray 作为代理主核心):
sing-box.exe接管系统 TUN 流量;xray.exe建立发往 VPS 的连接;xray.exe,导致process_path: ["xray.exe"]规则未命中;127.0.0.1:10808(即回到 Xray SOCKS 入口),形成死循环。为什么不能直接全局路由排除?
如 @DHR60 在 PR #10013 所指出的,
route_exclude_address修改的是操作系统的全局路由表。如果节点使用了 Cloudflare CDN / Workers / 优选 IP,由于 Anycast IP 是全球共享的(Twitter、ChatGPT、Discord 等均在使用),全局排除会导致浏览器访问这些网站时全部被系统强行直连,进而导致连接被墙拦截。
几种解决思路与探讨
综合现代网络客户端的做法与 v2rayN 现有架构,整理了以下几种解决方案:
方案 1:双核模式下自动为 Xray 绑定物理网卡(
bindInterface/IP_UNICAST_IF)bindInterface或sendThrough)。IP_UNICAST_IF),从而在 Socket 层面跳过 sing-box 的 TUN 拦截;方案 2:纯 Xray 原生 TUN 模式(逐步替代双核前置)
xray_tun),原生具备autoOutboundsInterface: "auto"。对于 Xray 节点直接使用 Xray 单核心接管 TUN,不再拉起 sing-box 前置服务。方案 3:开启 sing-box 前置的 WFP 内核过滤驱动(
windows_protect)process_path: ["xray.exe"]永远不会因为建连太快而漏检。方案 4:在 TUN 设置中增加独立开关(类似 Block AAAA)
[ ] 自动排除代理节点 IP(仅限独立 VPS),默认关闭。方案 5:保持现状纯手动
route_exclude_address由用户手动配置。想听听二位从架构演进和维护角度看,哪种思路更合适?多谢!
All reactions