V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Scalalala

windows 多网卡的情况下, mihomo 配置文件如何编写?

  •  
  •   Scalalala · Jan 23, 2025 · 2084 views
    This topic created in 461 days ago, the information mentioned may be changed or developed.
    想在 windows 电脑上通过 mihomo 达成多网卡分流的效果,现在有两个网卡:A 有线网卡连接公司内网,B 无线网卡通过 CPE 连外网。我希望公司的私有云桌面软件走 A ,其他一切流量走 B 。mihomo 已打开 tun 模式,我认为这样就能生效:

    tun:
    enable: true
    stack: system
    dns-hijack:
    - 0.0.0.0:53
    auto-route: true

    proxies:
    - name: "direct"
    type: direct
    interface-name: WLAN

    - name: "neiwang"
    type: direct
    interface-name: NEIWANG
    rules:
    - PROCESS-NAME-REGEX,云桌面,NEIWANG
    - MATCH,direct

    却两边都无法访问,之后我手动配置了路由表可以访问了:

    route add -p xx.xxx.0.0 mask 255.255.0.0 xx.xxx.xxx.xxx metric 1 //(内网)
    route add -p 0.0.0.0 mask 0.0.0.0 192.168.8.1 metric 1 //(外网)

    mihomo 应该怎样配置,才能自动做到这一切,而不用手动配置路由表?
    2 replies    2025-01-23 10:29:33 +08:00
    lzgshsj
        1
    lzgshsj  
       Jan 23, 2025   ❤️ 1
    这是不是只配了节点?还得写规则指定 192.168.8.1 走 direct 这个节点,xx.xxx.xxx.xxx/16 走 neiwang
    Scalalala
        2
    Scalalala  
    OP
       Jan 23, 2025
    @lzgshsj 规则里配了特定软件进程走网卡了,理论上不用再配网段了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5406 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 08:06 · PVG 16:06 · LAX 01:06 · JFK 04:06
    ♥ Do have faith in what you're doing.