操作系统
Linux
系统版本
6.6.73 #0 SMP Mon Feb 3 23:09:37 2025 mips GNU/Linux
安装类型
sing-box 原始命令行程序
如果您使用图形客户端程序,请提供该程序版本。
No response
版本
sing-box version
sing-box version 1.12.22
Environment: go1.25.7 linux/mipsle
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale
Revision: f63091d14d8984d53dc9a5563cb72af978b9779e
CGO: disabled
描述
tun inbound 中的 udp_timeout timer 只对从本机发出(进入 tun)的 UDP 包重置。相反,在收到远端入站(tun 发出)包时未被正确重置。
这导致执行 iperf3 -c .... -u -t 0 -R 等只有 UDP 回包,本机不向外发包的场景下, UDP NAT 条目错误地过期。
重现方式
- 部署一个最简环境,客户端:
{
"log": {
"level": "warn",
"timestamp": true
},
"inbounds": [
{
"type": "redirect",
"tag": "tcp-in",
"listen": "0.0.0.0",
"listen_port": 1800,
"sniff": false
},
{
"type": "tun",
"tag": "tun-in",
"interface_name": "tun0",
"address": ["198.18.0.1/30"],
"stack": "system",
"auto_route": false,
"strict_route": false,
"sniff": false,
"udp_timeout": "1m",
"platform": {
"http_proxy": {
"enabled": false
}
}
}
],
"outbounds": [
{
"type": "vless",
"tag": "proxy",
"server": "....",
"server_port": 1234,
"uuid": "xxxx",
"packet_encoding": "xudp"
}
],
"route": {
"auto_detect_interface": true,
"final": "proxy"
}
}
并配置路由将希望的流量重定向到 tun。
server 端可以是任意 vless inbound + direct outbound daemon,比如 xray。
-
server 端启动 iperf3
-
client 端 iperf3 -c .... -u -t 0 (不加 -R),此时永不超时。
-
client 端 加 -R iperf3 -c .... -u -t 0 -R 此时 80s(1.12.17)- 100s(1.12.22版)即超时。server 端 iperf3 返回:iperf3: error - unable to write to stream socket: Connection refused。
-
调高客户端 tun inbound 中的 “udp_timeout” 配置,问题可明显缓解。例如:调整到 "5m",则至少 320s 后才会超时。
日志
支持我们
完整性要求
操作系统
Linux
系统版本
6.6.73 #0 SMP Mon Feb 3 23:09:37 2025 mips GNU/Linux
安装类型
sing-box 原始命令行程序
如果您使用图形客户端程序,请提供该程序版本。
No response
版本
描述
tun inbound 中的 udp_timeout timer 只对从本机发出(进入 tun)的 UDP 包重置。相反,在收到远端入站(tun 发出)包时未被正确重置。
这导致执行 iperf3 -c .... -u -t 0 -R 等只有 UDP 回包,本机不向外发包的场景下, UDP NAT 条目错误地过期。
重现方式
并配置路由将希望的流量重定向到 tun。
server 端可以是任意 vless inbound + direct outbound daemon,比如 xray。
server 端启动 iperf3
client 端
iperf3 -c .... -u -t 0(不加 -R),此时永不超时。client 端 加 -R
iperf3 -c .... -u -t 0 -R此时 80s(1.12.17)- 100s(1.12.22版)即超时。server 端 iperf3 返回:iperf3: error - unable to write to stream socket: Connection refused。调高客户端 tun inbound 中的 “udp_timeout” 配置,问题可明显缓解。例如:调整到 "5m",则至少 320s 后才会超时。
日志
支持我们
完整性要求