Skip to content

[Bug] only one wireguard works #2338

Description

@artemklevtsov

Verify steps

  • I have read the documentation and understand the meaning of all the configuration items I have written, rather than just piling up seemingly useful options or default values.
  • I have carefully reviewed the documentation and have not resolved the issue.
  • I have searched the Issue Tracker for the issue I want to raise and did not find it.
  • I am a non-Chinese user.
  • I have tested with the latest Alpha branch version, and the issue still persists.
  • I have provided the server and client configuration files and processes that can reproduce the issue locally, rather than a sanitized complex client configuration file.
  • I provided the simplest configuration that can be used to reproduce the errors in my report, rather than relying on remote servers or piling on a lot of unnecessary configurations for reproduction.
  • I have provided complete logs, rather than just the parts I think are useful out of confidence in my own intelligence.
  • I have directly reproduced the error using the Mihomo command-line program, rather than using other tools or scripts.

Operating System

Linux

System Version

Arch Linux (6.17.6-zen1-1.1-zen)

Mihomo Version

Mihomo Meta v1.19.15 linux amd64 with go1.25.3 Tue Oct 14 17:57:55 UTC 2025
Use tags: with_gvisor

Configuration File

mode: rule
unified-delay: true
tcp-concurrent: true
ipv6: false
log-level: info

mixed-port: 7890

proxies:
  - name: WARP
    type: wireguard
    private-key: ****
    server: engage.cloudflareclient.com
    port: 4500
    ip: 172.16.0.2
    ipv6: 2606:4700:110:85b5:eb37:8db4:fcfa:c6bf
    public-key: bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=
    allowed-ips:
      - "0.0.0.0/0"
      - "::/0"
    udp: true
    mtu: 1280
    amnezia-wg-option:
      s1: 0
      s2: 0
      jc: 120
      jmin: 23
      jmax: 911
      h1: 1
      h2: 2
      h3: 3
      h4: 4
      i1: <b 0xc10000000114367096bb0fb3f58f3a3fb8aaacd61d63a1c8a40e14f7374b8a62dccba6431716c3abf6f5afbcfb39bd008000047c32e268567c652e6f4db58bff759bc8c5aaca183b87cb4d22938fe7d8dca22a679a79e4d9ee62e4bbb3a380dd78d4e8e48f26b38a1d42d76b371a5a9a0444827a69d1ab5872a85749f65a4104e931740b4dc1e2dd77733fc7fac4f93011cd622f2bb47e85f71992e2d585f8dc765a7a12ddeb879746a267393ad023d267c4bd79f258703e27345155268bd3cc0506ebd72e2e3c6b5b0f005299cd94b67ddabe30389c4f9b5c2d512dcc298c14f14e9b7f931e1dc397926c31fbb7cebfc668349c218672501031ecce151d4cb03c4c660b6c6fe7754e75446cd7de09a8c81030c5f6fb377203f551864f3d83e27de7b86499736cbbb549b2f37f436db1cae0a4ea39930f0534aacdd1e3534bc87877e2afabe959ced261f228d6362e6fd277c88c312d966c8b9f67e4a92e757773db0b0862fb8108d1d8fa262a40a1b4171961f0704c8ba314da2482ac8ed9bd28d4b50f7432d89fd800c25a50c5e2f5c0710544fef5273401116aa0572366d8e49ad758fcb29e6a92912e644dbe227c247cb3417eabfab2db16796b2fba420de3b1dc94e8361f1f324a331ddaf1e626553138860757fd0bf687566108b77b70fb9f8f8962eca599c4a70ed373666961a8cb506b96756d9e28b94122b20f16b54f118c0e603ce0b831efea614ad836df6cf9affbdd09596412547496967da758cec9080295d853b0861670b71d9abde0d562b1a6de82782a5b0c14d297f27283a895abc889a5f6703f0e6eb95f67b2da45f150d0d8ab805612d570c2d5cb6997ac3a7756226c2f5c8982ffbd480c5004b0660a3c9468945efde90864019a2b519458724b55d766e16b0da25c0557c01f3c11ddeb024b62e303640e17fdd57dedb3aeb4a2c1b7c93059f9c1d7118d77caac1cd0f6556e46cbc991c1bb16970273dea833d01e5090d061a0c6d25af2415cd2878af97f6d0e7f1f936247b394ecb9bd484da6be936dee9b0b92dc90101a1b4295e97a9772f2263eb09431995aa173df4ca2abd687d87706f0f93eaa5e13cbe3b574fa3cfe94502ace25265778da6960d561381769c24e0cbd7aac73c16f95ae74ff7ec38124f7c722b9cb151d4b6841343f29be8f35145e1b27021056820fed77003df8554b4155716c8cf6049ef5e318481460a8ce3be7c7bfac695255be84dc491c19e9dedc449dd3471728cd2a3ee51324ccb3eef121e3e08f8e18f0006ea8957371d9f2f739f0b89e4db11e5c6430ada61572e589519fbad4498b460ce6e4407fc2d8f2dd4293a50a0cb8fcaaf35cd9a8cc097e3603fbfa08d9036f52b3e7fcce11b83ad28a4ac12dba0395a0cc871cefd1a2856fffb3f28d82ce35cf80579974778bab13d9b3578d8c75a2d196087a2cd439aff2bb33f2db24ac175fff4ed91d36a4cdbfaf3f83074f03894ea40f17034629890da3efdbb41141b38368ab532209b69f057ddc559c19bc8ae62bf3fd564c9a35d9a83d14a95834a92bae6d9a29ae5e8ece07910d16433e4c6230c9bd7d68b47de0de9843988af6dc88b5301820443bd4d0537778bf6b4c1dd067fcf14b81015f2a67c7f2a28f9cb7e0684d3cb4b1c24d9b343122a086611b489532f1c3a26779da1706c6759d96d8ab>

  - name: VPN
    type: wireguard
    private-key: *****
    server: *.*.*.*
    port: 32704
    ip: 10.8.1.4/32
    public-key: ****
    pre-shared-key: ****
    allowed-ips:
      - "0.0.0.0/0"
      - "::/0"
    udp: true
    amnezia-wg-option:
      s1: 135
      s2: 60
      jc: 4
      jmin: 10
      jmax: 50
      h1: 1083421938
      h2: 462568195
      h3: 1293323502
      h4: 14735819
      i1: <b 0x494e56495445207369703a626f624062696c6f78692e636f6d205349502f322e300d0a5669613a205349502f322e302f55445020706333332e61746c616e74612e636f6d3b6272616e63683d7a39684734624b3737366173646864730d0a4d61782d466f7277617264733a2037300d0a546f3a20426f62203c7369703a626f624062696c6f78692e636f6d3e0d0a46726f6d3a20416c696365203c7369703a616c6963654061746c616e74612e636f6d3e3b7461673d313932383330313737340d0a43616c6c2d49443a20613834623463373665363637313040706333332e61746c616e74612e636f6d0d0a435365713a2033313431353920494e564954450d0a436f6e746163743a203c7369703a616c69636540706333332e61746c616e74612e636f6d3e0d0a436f6e74656e742d547970653a206170706c69636174696f6e2f7364700d0a436f6e74656e742d4c656e6774683a20300d0a0d0a>
      i2: <b 0x5349502f322e302031303020547279696e670d0a5669613a205349502f322e302f55445020706333332e61746c616e74612e636f6d3b6272616e63683d7a39684734624b3737366173646864730d0a546f3a20426f62203c7369703a626f624062696c6f78692e636f6d3e0d0a46726f6d3a20416c696365203c7369703a616c6963654061746c616e74612e636f6d3e3b7461673d313932383330313737340d0a43616c6c2d49443a20613834623463373665363637313040706333332e61746c616e74612e636f6d0d0a435365713a2033313431353920494e564954450d0a436f6e74656e742d4c656e6774683a20300d0a0d0a>
      j1: <b 0xabcdef1234567890>
      itime: 120

rules:
  - DOMAIN,ident.me,WARP
  - DOMAIN,ifconfig.me,VPN
  - MATCH,DIRECT

Description

When I use 2 wireguard proxies only first works.

Reproduction Steps

First try:

🕙[ 18:54:22 ] 🔴 35 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ifconfig.co
# my real ip
~ 
🕙[ 18:59:49 ] 🟢 0 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ident.me
# warp ip                                                                                                  
~ выполнялось 2s 
🕙[ 18:59:57 ] 🟢 0 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ifconfig.me
# my vpn ip                                                                                               
~ 
🕙[ 19:00:01 ] 🟢 0 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ident.me
curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading

Restart.

Second try:

🕙[ 19:00:07 ] 🔴 35 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ifconfig.co
# my real ip
~ 
🕙[ 19:00:13 ] 🟢 0 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ifconfig.me
# my vpn ip                                                                                                     
~ 
🕙[ 19:00:18 ] 🟢 0 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ident.me
# warp ip                                                                                                           
~ 
🕙[ 19:00:21 ] 🟢 0 ❯ all_proxy=socks5h://127.0.0.1:7890 curl https://ifconfig.me
curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading

Logs

First try:


INFO[2025-11-02T18:59:46.230414039+07:00] Start initial configuration in progress      
INFO[2025-11-02T18:59:46.230963387+07:00] Geodata Loader mode: memconservative         
INFO[2025-11-02T18:59:46.230996249+07:00] Geosite Matcher implementation: succinct     
INFO[2025-11-02T18:59:46.231035473+07:00] Initial configuration complete, total time: 0ms 
INFO[2025-11-02T18:59:46.246115412+07:00] Sniffer is closed                            
INFO[2025-11-02T18:59:46.246126553+07:00] Use tcp concurrent                           
INFO[2025-11-02T18:59:46.246240318+07:00] Mixed(http+socks) proxy listening at: 127.0.0.1:7890 
INFO[2025-11-02T18:59:46.246266768+07:00] Start initial compatible provider default    
INFO[2025-11-02T18:59:49.730230762+07:00] [TCP] 127.0.0.1:38908 --> ifconfig.co:443 match Match using DIRECT 
INFO[2025-11-02T18:59:55.091533856+07:00] [TCP] 127.0.0.1:38910 --> ident.me:443 match Domain(ident.me) using WARP 
INFO[2025-11-02T19:00:00.672340030+07:00] [TCP] 127.0.0.1:51280 --> ifconfig.me:443 match Domain(ifconfig.me) using VPN 
WARN[2025-11-02T19:00:07.353666889+07:00] [TCP] dial WARP (match Domain/ident.me) 127.0.0.1:51296 --> ident.me:443 error: context deadline exceeded 
^CWARN[2025-11-02T19:00:09.045731760+07:00] Mihomo shutting down   


Second try:


INFO[2025-11-02T19:00:10.159041022+07:00] Start initial configuration in progress      
INFO[2025-11-02T19:00:10.159567366+07:00] Geodata Loader mode: memconservative         
INFO[2025-11-02T19:00:10.159584779+07:00] Geosite Matcher implementation: succinct     
INFO[2025-11-02T19:00:10.159626548+07:00] Initial configuration complete, total time: 0ms 
INFO[2025-11-02T19:00:10.176122470+07:00] Sniffer is closed                            
INFO[2025-11-02T19:00:10.176131588+07:00] Use tcp concurrent                           
INFO[2025-11-02T19:00:10.176554186+07:00] Mixed(http+socks) proxy listening at: 127.0.0.1:7890 
INFO[2025-11-02T19:00:10.176650578+07:00] Start initial compatible provider default    
INFO[2025-11-02T19:00:13.156767258+07:00] [TCP] 127.0.0.1:39232 --> ifconfig.co:443 match Match using DIRECT 
INFO[2025-11-02T19:00:18.628587663+07:00] [TCP] 127.0.0.1:39244 --> ifconfig.me:443 match Domain(ifconfig.me) using VPN 
INFO[2025-11-02T19:00:21.045325006+07:00] [TCP] 127.0.0.1:47864 --> ident.me:443 match Domain(ident.me) using WARP 
WARN[2025-11-02T19:00:28.916923982+07:00] [TCP] dial VPN (match Domain/ifconfig.me) 127.0.0.1:47866 --> ifconfig.me:443 error: context deadline exceeded 
^CWARN[2025-11-02T19:08:04.361804733+07:00] Mihomo shutting down

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions