Open GeorgeRudd opened 6 months ago
遇到同样的问题,运行mihomo tun模式的ubuntu主机挂在路由器上,当路由器重启后网络恢复,mihomo tun模式不能恢复正常。
对比断网前后ip route
和ip rule
的输出结果,发现断网后tun的路由表和路由规则丢失。
我的解决方法: 1、关掉自动检测接口,手动指定网卡接口 2、关掉 auto-route 3、手动添加路由表和路由规则 4、把第3步的操作写成脚本,作为/etc/networkd-dispatcher/routable.d/50-ifup-tun-clash
这样断网恢复后,会自动把路由表和路由规则加回。
interface-name: enp2s0
tun:
enable: true
stack: system
dns-hijack:
- 'any:53'
- 'tcp://any:53'
auto-route: false
auto-detect-interface: false
strict-route: false
Verify steps
Mihomo version
Mihomo Meta alpha-b3db113 windows amd64 with go1.22.0 Wed Mar 13 07:34:45 UTC 2024 Use tags: with_gvisor
What OS are you seeing the problem on?
Windows
Mihomo config
Mihomo log
Description
参考了 https://github.com/MetaCubeX/mihomo/issues/1011#issuecomment-1916041143 和 https://github.com/MetaCubeX/mihomo/issues/604#issuecomment-1609184664 还是不行