sing-box
sing-box copied to clipboard
Wrong behaviour of UDP NAT
Welcome
- [X] Yes, I'm using the latest major release. Only such installations are supported.
- [X] Yes, I've searched similar issues on GitHub and didn't find any.
- [X] Yes, I've included all information below (version, config, etc).
Description of the problem
UDP Connections routing to direct-out were blocked when endpoint_independent_nat was enabled.
Tested via NatTypeTester v5.0.
Logs:
Commit: f13ecbd9bbf9e3dbdce25b3a86aa138006f3b697: https://paste.debian.net/plainh/2f4d0603
Commit: e4cece6095610964f22afe0ce9cfe1bcb355f661 (git HEAD): https://paste.debian.net/plainh/9cf3e758
It crashes immediately with Out of Memory error when there's new UDP connection.
But works fine if endpoint_independent_nat is disabled.
Version of sing-box
$ sing-box version
sing-box 0.1.0 (go1.18.4, linux, arm64, CGO disabled)
Server and client configuration file
{
"dns": {
"servers": [
{
"tag": "google",
"address": "tls://8.8.8.8"
},
{
"tag": "local",
"address": "223.5.5.5",
"detour": "direct"
}
],
"rules": [
{
"domain": "mydomain.com",
"geosite": "cn",
"server": "local"
}
],
"strategy": "ipv4_only"
},
"inbounds": [
{
"type": "tun",
"interface_name": "emortal-singbox",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"sniff": true,
"endpoint_independent_nat": true
}
],
"outbounds": [
{
"type": "shadowsocks",
"tag": "proxy",
"server": "-",
"server_port": 0,
"method": "aes-128-gcm",
"password": "-"
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"geoip": {
"path": "/etc/homeproxy/resources/geoip.db",
"download_url": "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db",
"download_detour": "proxy"
},
"geosite": {
"path": "/etc/homeproxy/resources/geosite.db",
"download_url": "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db",
"download_detour": "proxy"
},
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"geosite": "category-ads-all",
"outbound": "block"
},
{
"geosite": "cn",
"geoip": "cn",
"outbound": "direct"
}
],
"auto_detect_interface": true
}
}
Try 7613b8dbfebf160ae1576a650e10450be575d9e7
Works now, thank you!
Still doesn't look alright.
NAT filter remains Address and port dependent.
done.