SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
18.28k stars 2.19k forks source link

启用route_exclude_address指定特定ip(192.168.31.53/32)时,局域网内其他设备无法与主机连接(ping不通) #1981

Closed RaphealK closed 2 days ago

RaphealK commented 1 month ago

操作系统

其他

系统版本

immortalwrt-21.02(iptables)

安装类型

sing-box 原始命令行程序

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

No response

版本

sing-box version 1.10.0-alpha.24

Environment: go1.22.5 linux/arm64
Tags: with_gvisor,with_dhcp,with_wireguard,with_reality_server,with_clash_api,with_quic,with_utls,with_ech,with_grpc
Revision: 76eb8a39ff1bfb97a93b562602f7e205378787a7
CGO: disabled

描述

在启用route_exclude_address指定特定ip(192.168.31.53/32)时,局域网内其他设备无法与主机连接,ping不通

重现方式

  "auto_route": true,
  "strict_route": true,
  "auto_redirect": true,

{ "type": "tun", "tag": "tun-in", "interface_name": "SingBox", "address": [ "172.18.0.1/30", "fdfe:dcba:9876::1/126" ], "route_exclude_address": [192.168.31.53/32], "mtu": 9000, "gso": true, "auto_route": true, "strict_route": true, "auto_redirect": true, "stack": "system", }, "sniff": true, "sniff_override_destination": false }

日志

+0800 2024-07-27 04:51:36 INFO sing-box started (5.700s)
+0800 2024-07-27 04:51:37 INFO [1739648536 0ms] inbound/tun[tun-in]: inbound packet connection from 10.103.219.167:36949
+0800 2024-07-27 04:51:37 INFO [1739648536 0ms] inbound/tun[tun-in]: inbound packet connection to 103.195.103.66:9993
+0800 2024-07-27 04:51:37 INFO [1739648536 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [1739648536 0ms] outbound/direct[direct]: outbound packet connection
+0800 2024-07-27 04:51:37 INFO [1842673967 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:33861
+0800 2024-07-27 04:51:37 INFO [1842673967 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [1977438788 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:11923
+0800 2024-07-27 04:51:37 INFO [1977438788 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [658737713 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:3158
+0800 2024-07-27 04:51:37 INFO [658737713 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [1842673967 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [658737713 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [1977438788 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [1457109746 0ms] inbound/tun[tun-in]: inbound packet connection from 8.8.8.8:53
+0800 2024-07-27 04:51:37 INFO [1457109746 0ms] inbound/tun[tun-in]: inbound packet connection to 192.168.31.221:33861
+0800 2024-07-27 04:51:37 INFO [1457109746 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [2254576368 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.1:53
+0800 2024-07-27 04:51:37 INFO [2254576368 0ms] inbound/tun[tun-in]: inbound packet connection to 192.168.31.221:33861
+0800 2024-07-27 04:51:37 INFO [2254576368 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [2254576368 0ms] outbound/direct[direct]: outbound packet connection
+0800 2024-07-27 04:51:37 INFO [1457109746 1ms] outbound/direct[direct]: outbound packet connection
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [1538278211 0ms] inbound/tun[tun-in]: inbound packet connection from 1.1.1.1:53
+0800 2024-07-27 04:51:37 INFO [1538278211 0ms] inbound/tun[tun-in]: inbound packet connection to 192.168.31.221:33861
+0800 2024-07-27 04:51:37 INFO [1538278211 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [1538278211 2ms] outbound/direct[direct]: outbound packet connection
+0800 2024-07-27 04:51:37 ERROR dns: exchange failed for github.com. IN A: dial tcp 8.8.8.8:443: i/o timeout
+0800 2024-07-27 04:51:37 ERROR dns: exchange failed for github.com. IN HTTPS: dial tcp 8.8.8.8:443: i/o timeout
+0800 2024-07-27 04:51:37 INFO [2842740270 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:55151
+0800 2024-07-27 04:51:37 INFO [2842740270 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [2357792333 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:54626
+0800 2024-07-27 04:51:37 INFO [2842740270 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [2357792333 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [2357792333 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [3163004638 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:38610
+0800 2024-07-27 04:51:37 INFO [3163004638 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [3163004638 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 ERROR dns: exchange failed for github.com. IN A: dial tcp 8.8.8.8:443: i/o timeout
+0800 2024-07-27 04:51:37 INFO [1247991097 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:41879
+0800 2024-07-27 04:51:37 INFO [1247991097 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [1247991097 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [506738270 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:47108
+0800 2024-07-27 04:51:37 INFO [673374748 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:50652
+0800 2024-07-27 04:51:37 INFO [506738270 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [673374748 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [3324252072 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:56781
+0800 2024-07-27 04:51:37 INFO [1381245438 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:60457
+0800 2024-07-27 04:51:37 INFO [3324252072 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [1381245438 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 ERROR dns: exchange failed for www.apple.com. IN A: dial tcp 8.8.8.8:443: i/o timeout
+0800 2024-07-27 04:51:37 INFO [540711800 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:38067
+0800 2024-07-27 04:51:37 INFO [540711800 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [2632163032 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:40057
+0800 2024-07-27 04:51:37 INFO [2632163032 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:37 INFO [2632163032 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [3760868605 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:52530
+0800 2024-07-27 04:51:37 INFO [557148144 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:42746
+0800 2024-07-27 04:51:37 INFO [3760868605 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [557148144 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO dns: exchanged alist.pussycat.cc.lan SOA . 1 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2024072601 1800 900 604800 86400
+0800 2024-07-27 04:51:37 INFO dns: exchanged alist.pussycat.cc.lan OPT OPT PSEUDOSECTION: EDNS: version 0 flags: MBZ: 0x0001, udp: 1232 SUBNET: 36.148.83.56/32/24 PADDING: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+0800 2024-07-27 04:51:37 INFO [4126935430 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:43966
+0800 2024-07-27 04:51:37 INFO [3367161049 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:34621
+0800 2024-07-27 04:51:37 INFO [4126935430 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO [3367161049 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:37 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:37 INFO [2942401605 0ms] inbound/tun[tun-in]: inbound redirect connection from [2409:8a50:a613:bd00:51da:a743:b6d4:4b91]:50711
+0800 2024-07-27 04:51:37 INFO [2942401605 0ms] inbound/tun[tun-in]: inbound connection to [2409:8c54:1040:5002::1c]:443
+0800 2024-07-27 04:51:37 ERROR dns: exchange failed for client.wns.windows.com. IN A: dial tcp 8.8.8.8:443: i/o timeout
+0800 2024-07-27 04:51:38 INFO [2942401605 301ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [2942401605 301ms] outbound/direct[direct]: outbound connection to [2409:8c54:1040:5002::1c]:443
+0800 2024-07-27 04:51:38 INFO [1979390977 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:48755
+0800 2024-07-27 04:51:38 INFO [1979390977 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:38 INFO [425327888 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:47616
+0800 2024-07-27 04:51:38 INFO [425327888 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:38 INFO [425327888 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [1979390977 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:38 INFO [3475644357 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:47839
+0800 2024-07-27 04:51:38 INFO [3475644357 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [1651317744 0ms] inbound/tun[tun-in]: inbound packet connection from 192.168.31.221:37789
+0800 2024-07-27 04:51:38 INFO [1651317744 0ms] inbound/tun[tun-in]: inbound packet connection to 172.18.0.2:53
+0800 2024-07-27 04:51:38 INFO [1651317744 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:38 INFO [3767517857 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:50669
+0800 2024-07-27 04:51:38 INFO [3767517857 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO outbound/direct[direct]: outbound connection to 8.8.8.8:443
+0800 2024-07-27 04:51:38 INFO [3768662509 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:33911
+0800 2024-07-27 04:51:38 INFO [3768662509 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 ERROR dns: exchange failed for disc501.prod.do.dsp.mp.microsoft.com. IN A: dial tcp 8.8.8.8:443: i/o timeout
+0800 2024-07-27 04:51:38 INFO [3162332394 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:36424
+0800 2024-07-27 04:51:38 INFO [2181660246 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:60953
+0800 2024-07-27 04:51:38 INFO [2181660246 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [3162332394 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [3486944136 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:60966
+0800 2024-07-27 04:51:38 INFO [828516613 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:42932
+0800 2024-07-27 04:51:38 INFO [1480596111 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:57719
+0800 2024-07-27 04:51:38 INFO [3486944136 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [1480596111 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [3077543434 0ms] inbound/direct[dns-in]: inbound packet connection from 192.168.31.153:58240
+0800 2024-07-27 04:51:38 INFO [828516613 0ms] router: failed to search process: netlink message: NLMSG_ERROR
+0800 2024-07-27 04:51:38 INFO [3077543434 0ms] router: failed to search process: netlink message: NLMSG_ERROR

支持我们

完整性要求

RaphealK commented 1 month ago

我的想法是192.168.31.53不经过tun走直连,并且不劫持该地址的53端口,作为本地的dns服务器

设置为"route_exclude_address": [192.168.31.53/32,"192.168.0.0/16"]已经可以和主机正常建立连接 请教一下我的需求要怎么实现

zmlu commented 1 month ago

strict_route 改成 false 试试

Who-AmI commented 1 day ago

这个问题解决了没