MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
15.34k stars 2.55k forks source link

[Bug] tun模式下断开wifi之后再连接,都要重启核心才能用 #1116

Open GeorgeRudd opened 6 months ago

GeorgeRudd commented 6 months ago

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

port: 7899
socks-port: 7898
mixed-port: 7897
inbound-tfo: true
mode: rule
ipv6: true
log-level: debug
find-process-mode: always
allow-lan: false
geodata-mode: true
tcp-concurrent: true

rules:
  - PROCESS-NAME,clash-meta,REJECT
  - PROCESS-NAME,clash-meta-alpha,REJECT
  - PROCESS-NAME,clash-meta.exe,REJECT
  - PROCESS-NAME,clash-meta-alpha.exe,REJECT
  - AND,((NETWORK,UDP),(DST-PORT,443)),REJECT
  - DOMAIN,services.googleapis.cn,节点选择
  - GEOSITE,cn,direct
  - GEOSITE,private,direct
  - GEOSITE,geolocation-!cn,节点选择
  - GEOIP,cn,direct
  - GEOIP,private,direct
  - MATCH,节点选择
  - MATCH,REJECT

external-ui: metacubexd 

external-controller: 127.0.0.1:9097 
secret: "secret"

interface-name: WLAN

tun:
  enable: true
  stack: system
  dns-hijack:
    - 'any:53'
    - 'tcp://any:53'
  auto-route: true
  auto-detect-interface: false
  strict-route: true 

proxy-groups:

  - name: 节点选择
    type: select
    proxies:  
      - tuic

proxies:
   # direct
  - name: "direct"
    type: direct
    udp: true
    tfo: true
    ip-version: ipv4-prefer

  - name: tuic
    server: ip
    port: 30001
    type: tuic
    uuid: uuid
    password: password
    alpn: [h3]
    disable-sni: false
    reduce-rtt: false
    udp: true
    udp-over-stream: true
    congestion-controller: bbr # Available: "cubic", "new_reno", "bbr". Default: "cubic"
    fast-open: true
    skip-cert-verify: false
    sni: sni

dns:
  enable: true
  enhanced-mode: fake-ip
  use-hosts: true
  nameserver-policy:
    'geosite:cn': 
         - 223.5.5.5
    'geosite:private': 
         - 223.5.5.5      
  nameserver:
    - 'tcp://8.8.8.8#节点选择'
  proxy-server-nameserver:
     - 223.5.5.5  
  fake-ip-filter:
    #https://github.com/vernesong/OpenClash/blob/master/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list
    #LAN
    - '*.lan'
    - '*.localdomain'
    - '*.example'
    - '*.invalid'
    - '*.localhost'
    - '*.test'
    - '*.local'
    - '*.home.arpa'
    #放行NTP服务
    - 'time.*.com'
    - 'time.*.gov'
    - 'time.*.edu.cn'
    - 'time.*.apple.com'
    - 'time-ios.apple.com'
    - 'time1.*.com'
    - 'time2.*.com'
    - 'time3.*.com'
    - 'time4.*.com'
    - 'time5.*.com'
    - 'time6.*.com'
    - 'time7.*.com'
    - 'ntp.*.com'
    - 'ntp1.*.com'
    - 'ntp2.*.com'
    - 'ntp3.*.com'
    - 'ntp4.*.com'
    - 'ntp5.*.com'
    - 'ntp6.*.com'
    - 'ntp7.*.com'
    - '*.time.edu.cn'
    - '*.ntp.org.cn'
    - '+.pool.ntp.org'
    - 'time1.cloud.tencent.com'
    #放行网易云音乐
    - 'music.163.com'
    - '*.music.163.com'
    - '*.126.net'
    #百度音乐
    - 'musicapi.taihe.com'
    - 'music.taihe.com'
    #酷狗音乐
    - 'songsearch.kugou.com'
    - 'trackercdn.kugou.com'
    #酷我音乐
    - '*.kuwo.cn'
    #JOOX音乐
    - 'api-jooxtt.sanook.com'
    - 'api.joox.com'
    - 'joox.com'
    #QQ音乐
    - 'y.qq.com'
    - '*.y.qq.com'
    - 'streamoc.music.tc.qq.com'
    - 'mobileoc.music.tc.qq.com'
    - 'isure.stream.qqmusic.qq.com'
    - 'dl.stream.qqmusic.qq.com'
    - 'aqqmusic.tc.qq.com'
    - 'amobile.music.tc.qq.com'
    #虾米音乐
    - '*.xiami.com'
    #咪咕音乐
    - '*.music.migu.cn'
    - 'music.migu.cn'
    #win10本地连接检测
    - '+.msftconnecttest.com'
    - '+.msftncsi.com'
    #QQ登录
    - 'localhost.ptlogin2.qq.com'
    - 'localhost.sec.qq.com'
    - '+.qq.com'
    - '+.tencent.com'
    #Game
    #Nintendo Switch
    - '+.srv.nintendo.net'
    - '*.n.n.srv.nintendo.net'
    #Sony PlayStation
    - '+.stun.playstation.net'
    #Microsoft Xbox
    - 'xbox.*.*.microsoft.com'
    - '*.*.xboxlive.com'
    - 'xbox.*.microsoft.com'
    - 'xnotify.xboxlive.com'
    #Wotgame
    - '+.battlenet.com.cn'
    - '+.wotgame.cn'
    - '+.wggames.cn'
    - '+.wowsgame.cn'
    - '+.wargaming.net'
    #Golang
    - 'proxy.golang.org'
    #STUN
    - 'stun.*.*'
    - 'stun.*.*.*'
    - '+.stun.*.*'
    - '+.stun.*.*.*'
    - '+.stun.*.*.*.*'
    - '+.stun.*.*.*.*.*'
    #Linksys Router
    - 'heartbeat.belkin.com'
    - '*.linksys.com'
    - '*.linksyssmartwifi.com'
    #ASUS Router
    - '*.router.asus.com'
    #Apple Software Update Service
    - 'mesu.apple.com'
    - 'swscan.apple.com'
    - 'swquery.apple.com'
    - 'swdownload.apple.com'
    - 'swcdn.apple.com'
    - 'swdist.apple.com'
    #Google
    - 'lens.l.google.com'
    - 'stun.l.google.com'
    - 'na.b.g-tun.com'
    #Netflix
    - '+.nflxvideo.net'
    #FinalFantasy XIV Worldwide Server & CN Server
    - '*.square-enix.com'
    - '*.finalfantasyxiv.com'
    - '*.ffxiv.com' 
    - '*.ff14.sdo.com'
    - 'ff.dorado.sdo.com'
    #Bilibili
    - '*.mcdn.bilivideo.cn'
    #Disney Plus
    - '+.media.dssott.com'
    #shark007 Codecs 
    - 'shark007.net'
    #Mijia
    - 'Mijia Cloud'
    #招商银行
    - '+.cmbchina.com'
    - '+.cmbimg.com'
    #AdGuard
    - 'local.adguard.org'
    #迅雷
    - '+.sandai.net'
    - '+.n0808.com'

profile:
  # 存储 select 选择记录
  store-selected: false

  # 持久化 fake-ip
  store-fake-ip: false

Mihomo log

time="2024-03-19T09:05:40.6684559+08:00" level=info msg="Start initial configuration in progress"
time="2024-03-19T09:05:40.6765259+08:00" level=info msg="Geodata Loader mode: memconservative"
time="2024-03-19T09:05:40.6770545+08:00" level=info msg="Geosite Matcher implementation: succinct"
time="2024-03-19T09:05:41.1271188+08:00" level=info msg="Start initial GeoSite rule cn => direct, records: 75983"
time="2024-03-19T09:05:41.1371879+08:00" level=info msg="Start initial GeoSite rule private => direct, records: 138"
time="2024-03-19T09:05:41.2187155+08:00" level=info msg="Start initial GeoSite rule geolocation-!cn => 节点选择, records: 24314"
time="2024-03-19T09:05:41.2389133+08:00" level=info msg="Start initial GeoIP rule cn => direct, records: 11286"
time="2024-03-19T09:05:41.2389133+08:00" level=info msg="Start initial GeoIP rule private => direct, records: 18"
time="2024-03-19T09:05:41.2389133+08:00" level=info msg="Initial configuration complete, total time: 562ms"
time="2024-03-19T09:05:41.2389133+08:00" level=info msg="Sniffer is closed"
time="2024-03-19T09:05:41.2389133+08:00" level=info msg="Use tcp concurrent"
time="2024-03-19T09:05:41.2490053+08:00" level=info msg="RESTful API listening at: 127.0.0.1:9090"
time="2024-03-19T09:05:41.4872893+08:00" level=info msg="HTTP proxy listening at: 127.0.0.1:7899"
time="2024-03-19T09:05:41.4872893+08:00" level=info msg="SOCKS proxy listening at: 127.0.0.1:7898"
time="2024-03-19T09:05:41.4872893+08:00" level=info msg="Mixed(http+socks) proxy listening at: 127.0.0.1:7897"
time="2024-03-19T09:05:41.7623261+08:00" level=info msg="[TUN] Tun adapter listening at: Meta([198.18.0.1/30],[]), mtu: 9000, auto route: true, ip stack: System"
time="2024-03-19T09:05:41.7639049+08:00" level=info msg="Start initial Compatible provider default"
time="2024-03-19T09:05:41.7639049+08:00" level=info msg="Start initial Compatible provider 节点选择"
time="2024-03-19T09:05:42.1964692+08:00" level=debug msg="[DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:61518"
time="2024-03-19T09:05:42.1970659+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:05:42.2159891+08:00" level=debug msg="[DNS] www.msftconnecttest.com --> [23.195.89.250 23.195.91.210] A from udp://223.5.5.5:53"
time="2024-03-19T09:05:42.2181948+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:42.2187956+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:11"
time="2024-03-19T09:05:42.2187956+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:05:42.2272056+08:00" level=debug msg="[DNS] www.msftconnecttest.com --> [] AAAA from udp://223.5.5.5:53"
time="2024-03-19T09:05:42.3319317+08:00" level=info msg="[TCP] 198.18.0.1:50455(svchost.exe) --> www.msftconnecttest.com:80 match GeoSite(private) using direct"
time="2024-03-19T09:05:43.1993983+08:00" level=debug msg="[DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:50119"
time="2024-03-19T09:05:43.2016556+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:43.2028034+08:00" level=debug msg="New TuicV5 Client at 0xc000232048"
time="2024-03-19T09:05:43.2153077+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:43.2787931+08:00" level=info msg="[TCP] 198.18.0.1:50457(chrome.exe) --> mtalk.google.com:443 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:05:43.2787931+08:00" level=info msg="[TCP] 198.18.0.1:50460(msedge.exe) --> prod-japaneast.access-point.cloudmessaging.edge.microsoft.com:443 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:05:45.1368278+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:45.1378896+08:00" level=info msg="[TCP] 198.18.0.1:50461(TextInputHost.exe) --> inputsuggestions.msdxcdn.microsoft.com:443 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:05:45.6002343+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:45.600927+08:00" level=info msg="[TCP] 198.18.0.1:50462(svchost.exe) --> go.microsoft.com:443 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:05:46.6839925+08:00" level=debug msg="[DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:52812"
time="2024-03-19T09:05:46.6845395+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:46.6856282+08:00" level=info msg="[TCP] 198.18.0.1:50463(chrome.exe) --> mtalk.google.com:5228 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:05:46.6856282+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:46.6861631+08:00" level=info msg="[TCP] 198.18.0.1:50464(msedge.exe) --> prod-japaneast.access-point.cloudmessaging.edge.microsoft.com:443 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:05:49.4726005+08:00" level=debug msg="[DNS] resolve time.windows.com from tcp://8.8.8.8:53"
time="2024-03-19T09:05:49.5290102+08:00" level=debug msg="[DNS] time.windows.com --> [20.43.94.199] A from tcp://8.8.8.8:53"
time="2024-03-19T09:05:49.5301148+08:00" level=debug msg="[DNS] cache hit for time.windows.com., expire at 2024-03-19 09:10:51"
time="2024-03-19T09:05:49.5301148+08:00" level=debug msg="[DNS] resolve time.windows.com from tcp://8.8.8.8:53"
time="2024-03-19T09:05:49.5859407+08:00" level=debug msg="[DNS] time.windows.com --> [] AAAA from tcp://8.8.8.8:53"
time="2024-03-19T09:05:49.5860359+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:49.5866001+08:00" level=info msg="[UDP] 198.18.0.1:123(svchost.exe) --> time.windows.com:123 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:05:51.4058642+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:05:51.4065097+08:00" level=info msg="[TCP] 198.18.0.1:50465(OneDrive.exe) --> mobile.events.data.microsoft.com:443 match GeoSite(geolocation-!cn) using 节点选择[tuic]"

time="2024-03-19T09:06:39.5398481+08:00" level=warning msg="[TCP] dial direct (match GeoSite/private) 198.18.0.1:50471(svchost.exe) --> www.msftconnecttest.com:80 error: connect failed: interface not found\ninterface not found"
time="2024-03-19T09:06:39.5507633+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:38"
time="2024-03-19T09:06:39.5507633+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:11"
time="2024-03-19T09:06:39.5507633+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5513048+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5513048+08:00" level=warning msg="[TCP] dial direct (match GeoSite/private) 198.18.0.1:50471(svchost.exe) --> www.msftconnecttest.com:80 error: connect failed: interface not found\ninterface not found"
time="2024-03-19T09:06:39.5513048+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5519488+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5669978+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:11"
time="2024-03-19T09:06:39.5669978+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:38"
time="2024-03-19T09:06:39.5676034+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5676034+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5676034+08:00" level=warning msg="[TCP] dial direct (match GeoSite/private) 198.18.0.1:50471(svchost.exe) --> www.msftconnecttest.com:80 error: connect failed: interface not found\ninterface not found"
time="2024-03-19T09:06:39.5682107+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5682107+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.582338+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:11"
time="2024-03-19T09:06:39.582338+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:38"
time="2024-03-19T09:06:39.582338+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5828499+08:00" level=warning msg="[TCP] dial direct (match GeoSite/private) 198.18.0.1:50471(svchost.exe) --> www.msftconnecttest.com:80 error: connect failed: interface not found\ninterface not found"
time="2024-03-19T09:06:39.5828499+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5828499+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.5834022+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.6449421+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:11"
time="2024-03-19T09:06:39.6449421+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:38"
time="2024-03-19T09:06:39.6449421+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.6455187+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.6455187+08:00" level=warning msg="[TCP] dial direct (match GeoSite/private) 198.18.0.1:50471(svchost.exe) --> www.msftconnecttest.com:80 error: connect failed: interface not found\ninterface not found"
time="2024-03-19T09:06:39.6455187+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.6460315+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.7407594+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:11"
time="2024-03-19T09:06:39.7409806+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:38"
time="2024-03-19T09:06:39.7409806+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.7409806+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.7409806+08:00" level=warning msg="[TCP] dial direct (match GeoSite/private) 198.18.0.1:50471(svchost.exe) --> www.msftconnecttest.com:80 error: connect failed: interface not found\ninterface not found"
time="2024-03-19T09:06:39.7414877+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.7414877+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.8503898+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:11"
time="2024-03-19T09:06:39.8503898+08:00" level=debug msg="[DNS] cache hit for www.msftconnecttest.com., expire at 2024-03-19 09:06:38"
time="2024-03-19T09:06:39.8510797+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.8512975+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.8512975+08:00" level=warning msg="[TCP] dial direct (match GeoSite/private) 198.18.0.1:50471(svchost.exe) --> www.msftconnecttest.com:80 error: connect failed: interface not found\ninterface not found"
time="2024-03-19T09:06:39.8512975+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.8518543+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.5.5.5:53"
time="2024-03-19T09:06:39.8771978+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:06:39.8777747+08:00" level=info msg="[TCP] 198.18.0.1:50474(svchost.exe) --> client.wns.windows.com:443 match GeoSite(geolocation-!cn) using 节点选择[tuic]"
time="2024-03-19T09:06:39.8794983+08:00" level=debug msg="[DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:61177"
time="2024-03-19T09:06:39.8808225+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:06:39.8813768+08:00" level=debug msg="[Rule] use default rules"
time="2024-03-19T09:06:39.8819488+08:00" level=warning msg="[TCP] dial 节点选择 (match GeoSite/geolocation-!cn) 198.18.0.1:50476(svchost.exe) --> client.wns.windows.com:443 error: INTERNAL_ERROR (local): write udp [::]:55625->ip:30001: wsasendto: A socket operation was attempted to an unreachable network."
time="2024-03-19T09:06:39.8819488+08:00" level=warning msg="[TCP] dial 节点选择 (match GeoSite/geolocation-!cn) 198.18.0.1:50475(svchost.exe) --> client.wns.windows.com:443 error: INTERNAL_ERROR (local): write udp [::]:55625->ip:30001: wsasendto: A socket operation was attempted to an unreachable network."
time="2024-03-19T09:06:39.8971995+08:00" level=warning msg="[TCP] dial 节点选择 (match GeoSite/geolocation-!cn) 198.18.0.1:50475(svchost.exe) --> client.wns.windows.com:443 error: INTERNAL_ERROR (local): write udp [::]:55625->ip:30001: wsasendto: A socket operation was attempted to an unreachable network."
time="2024-03-19T09:06:39.8971995+08:00" level=warning msg="[TCP] dial 节点选择 (match GeoSite/geolocation-!cn) 198.18.0.1:50476(svchost.exe) --> client.wns.windows.com:443 error: INTERNAL_ERROR (local): write udp [::]:55625->ip:30001: wsasendto: A socket operation was attempted to an unreachable network."
time="2024-03-19T09:06:39.9128695+08:00" level=warning msg="[TCP] dial 节点选择 (match GeoSite/geolocation-!cn) 198.18.0.1:50475(svchost.exe) --> client.wns.windows.com:443 error: INTERNAL_ERROR (local): write udp [::]:55625->ip:30001: wsasendto: A socket operation was attempted to an unreachable network."
time="2024-03-19T09:06:39.9128695+08:00" level=warning msg="[TCP] dial 节点选择 (match GeoSite/geolocation-!cn) 198.18.0.1:50476(svchost.exe) --> client.wns.windows.com:443 error: INTERNAL_ERROR (local): write udp [::]:55625->ip:30001: wsasendto: A socket operation was attempted to an unreachable network."
time="2024-03-19T09:06:39.928563+08:00" level=warning msg="[TCP] dial 节点选择 (match GeoSite/geolocation-!cn) 198.18.0.1:50475(svchost.exe) --> client.wns.windows.com:443 error: INTERNAL_ERROR (local): write udp [::]:55625->ip:30001: wsasendto: A socket operation was attempted to an unreachable network."

Description

参考了 https://github.com/MetaCubeX/mihomo/issues/1011#issuecomment-1916041143https://github.com/MetaCubeX/mihomo/issues/604#issuecomment-1609184664 还是不行

smaa commented 3 months ago

遇到同样的问题,运行mihomo tun模式的ubuntu主机挂在路由器上,当路由器重启后网络恢复,mihomo tun模式不能恢复正常。

对比断网前后ip routeip 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