[Bug]: Conflict between Wireguard and V2RayN's Tun mode on MacOS. #7859
ChatCherry
started this conversation in
General
Replies: 1 comment 1 reply
-
|
你好,这属于使用问题 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
操作系统和版本
MacOS Sequoia 15.6.1
预期情况
V2RayN can send traffic to Wireguard in Tun mode.
实际情况
My network configuration is as follows:
My MacOS computer is on a large LAN that cannot connect to the internet. At another location, a server is connected to this large LAN and running a WireGuard service. Another network port on this server is connected to a router that can access the internet. This server forwards data from the VPN network segment to the router's network segment, enabling my computer connected to the WireGuard VPN to access the internet. In this scenario, I used V2RayN as a proxy. The connection functions normally without TUN mode enabled. However, enabling TUN mode triggers an error: ERROR connection: open outbound connection: dial tcp [Server2IP]:443: connect: network is unreachable (Note: “Server2” here refers to the public-facing server, not the one within the large LAN). This indicates that in TUN mode, all data intended for the WireGuard connection to the internet is instead being sent directly to the large LAN, which lacks internet connectivity. Through testing, I discovered that restarting WireGuard when this issue occurs causes the “Current Latency” displayed in the bottom-right corner of V2RayN in TUN mode to change from -1 to an actual value, such as 230ms. However, traffic intended for V2RayN now flows directly to WireGuard instead of first passing through V2RayN to connect to Server2IP:443. In this scenario, WireGuard effectively hijacks all traffic destined for V2RayN. I've attempted to find solutions but have yet to resolve this conflict. I tested this behavior on Windows, where traffic successfully traverses V2RayN's TUN mode before connecting to the internet via WireGuard.
复现方法
Step 1: Connect to WireGuard and configure WireGuard settings as follows:
[Interface]
PrivateKey = *****
Address = 192.168.3.2/32
[Peer]
PublicKey = *****
AllowedIPs = All IP subnets except the subnet containing the Endpoint (if the Endpoint is 192.168.1.1:10000, then AllowedIPs should be
0.0.0.0/1, 128.0.0.1/2, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/3)
Endpoint = ServerIP:ServerPort
PersistentKeepalive = 25
Step 2: Verbinden Sie sich mit V2RayN und konfigurieren Sie Folgendes:
VLEES
Adresse: XXX.XXX.XXX
Port: 443
ID: *****
Flow: xtls-rprx-vision
Verschlüsselung: keine
[Transport]
Netzwerk tcp
Typ keine
TLS-Realität
SNI www.learn.microsoft.com
Fingerabdruck Chrome
PublicKey *****
ShortID *****
SpiderX /
Step 3: Set to “Automatically configure as system proxy” and “Global proxy,” then enable TUN mode.
日志信息
[VLESS] VLESS-XTLS-uTLS-REALITY(:443)
v2rayN - V7.13.7 - Arm64 | /Users/main/Library/Application Support/v2rayN | /Applications/v2rayN.app/Contents/MacOS/v2rayN | Unix 15.6.1
Start Service (2025/08/31 01:32:59)...
Xray 25.8.3 (Xray, Penetrates Everything.) bd86732 (go1.24.5 darwin/arm64)
A unified platform for anti-censorship.
2025/08/31 01:32:59.706830 [Info] infra/conf/serial: Reading config: &{Name:config.json Format:json}
2025/08/31 01:32:59.867321 [Warning] core: Xray 25.8.3 started
[VLESS] VLESS-XTLS-uTLS-REALITY(:443)
Password:WARN[0000] legacy special outbounds is deprecated in sing-box 1.11.0 and will be removed in sing-box 1.13.0, checkout documentation for migration: https://sing-box.sagernet.org/migration/#migrate-legacy-special-outbounds-to-rule-actions
2025/08/31 01:33:01.211550 from tcp:127.0.0.1:58484 accepted tcp:www.google.com:443 [socks >> proxy]
2025/08/31 01:33:03.818573 from tcp:127.0.0.1:58486 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:03.818626 from tcp:127.0.0.1:58485 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:03.818864 from tcp:127.0.0.1:58487 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:03.820031 from tcp:127.0.0.1:58488 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:04.769655 from tcp:127.0.0.1:58489 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:04.770206 from tcp:127.0.0.1:58490 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:04.770310 from tcp:127.0.0.1:58491 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:04.770850 from tcp:127.0.0.1:58492 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:05.782763 from tcp:127.0.0.1:58493 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:05.783326 from tcp:127.0.0.1:58494 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:05.783704 from tcp:127.0.0.1:58495 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:05.783981 from tcp:127.0.0.1:58496 accepted tcp:8.8.8.8:53 [socks >> proxy]
+0800 2025-08-31 01:33:06 ERROR [3647781973 29ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [2894358878 29ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [2236019712 30ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [18941270 31ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [4168044152 31ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [1905687624 32ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [2820551147 33ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [4162316247 31ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [2605584927 33ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [1433787994 32ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [3324471673 34ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [1419945049 33ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:06 ERROR [2162708010 37ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
2025/08/31 01:33:07.675289 from tcp:127.0.0.1:58523 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:07.676071 from tcp:127.0.0.1:58524 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:07.676497 from tcp:127.0.0.1:58525 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:07.676772 from tcp:127.0.0.1:58526 accepted tcp:8.8.8.8:53 [socks >> proxy]
+0800 2025-08-31 01:33:11 ERROR [2663666306 20ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [1692583774 18ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [2197393188 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [1700046484 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [3613717476 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [2999305010 24ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [26229380 23ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [2030916223 25ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [2283723367 26ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [1578131659 25ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [59277790 25ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [113779475 26ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [3367719721 24ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [2755019684 26ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [2216615584 25ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [4102399202 28ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:11 ERROR [4075561439 28ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
2025/08/31 01:33:15.394254 from tcp:127.0.0.1:58564 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:15.394344 from tcp:127.0.0.1:58565 accepted tcp:8.8.8.8:53 [socks >> proxy]
+0800 2025-08-31 01:33:16 ERROR [2880297034 24ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [3165537121 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [3345506244 20ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [3465845405 23ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [778192131 29ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [889706122 24ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [1453159878 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [3303082660 25ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [227284195 27ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [3090983055 26ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [2996182499 28ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [1685193340 29ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [2842082557 31ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [1374481516 33ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [3933189524 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [41737278 34ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [3279226207 32ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [762514858 33ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [2625890157 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [2692463753 34ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [602005798 25ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:16 ERROR [4280670748 23ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
2025/08/31 01:33:16.408141 from tcp:127.0.0.1:58610 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:16.408271 from tcp:127.0.0.1:58611 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:18.299814 from tcp:127.0.0.1:58616 accepted tcp:8.8.8.8:53 [socks >> proxy]
2025/08/31 01:33:18.300240 from tcp:127.0.0.1:58617 accepted tcp:8.8.8.8:53 [socks >> proxy]
+0800 2025-08-31 01:33:19 ERROR [1486289375 4ms] connection: open outbound connection: dial tcp 123.151.48.171:8080: connect: network is unreachable
+0800 2025-08-31 01:33:19 ERROR [1883462512 7ms] connection: open outbound connection: dial tcp 61.151.230.185:80: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [2822815701 24ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [3160951450 21ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [72204098 25ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [1095770418 23ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [1711194890 30ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [3112700997 27ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [2730685778 27ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [1425818560 32ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [2105243862 27ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [2223146778 30ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [120072253 32ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [3859685530 33ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [2407431232 32ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [1943994834 28ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [1515614059 29ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [3967264058 27ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [464907154 30ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [725009015 34ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [2863781999 20ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [861815915 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [2113958466 23ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [50153533 30ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [1624876896 22ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [857714208 23ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
+0800 2025-08-31 01:33:21 ERROR [4280444456 23ms] connection: open outbound connection: dial tcp [ServerIP]:443: connect: network is unreachable
2025/08/31 01:33:22 Current Delay: -1 ms,none
额外信息
I considered whether it might be an issue with sing_box, so I tried downgrading its version. The error persisted in version 1.11.15 (the logs I provided are from this version). The same problem still occurs in the latest version 1.12.4.
我确认已更新至最新版本
我确认已查询历史issues
Beta Was this translation helpful? Give feedback.
All reactions