Routing "tun" inbound into "wireguard" outbound not working on Windows
Operating system
Windows
System version
Windows 10 (19044.6456)
Installation type
Original sing-box Command Line
If you are using a graphical client, please provide the version of the client.
No response
Version
sing-box version 1.12.12
Environment: go1.25.3 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale
Revision: 54ed58499d7063136ed52dabf87d179d252425d0
CGO: disabled
Description
My config has tun as an inbound, and a single routing rule, that routes websites based on domain_suffix to a specific outbound.
If I use wireguard as an outbound, connection to the website times out. If I change outbound to socks (or vless), then connection is successful.
If I keep wireguard outbound, but change inbound to mixed, connection is successful.
So it seems like the problem is specifically related to tun - wireguard combination.
Reproduction
Start server
- Download server.json onto your server
- Open ports UDP 10000 and TCP 10001 on your server
- Start sing-box:
sing-box.exe run -c "server.json"
TEST 1 (wg + tun)
- Download wg+tun.json
- Fill server address (under
endpoints>wireguard>peers>address) - Start sing-box:
sing-box.exe run -c "wg+tun.json" - Try to open https://ipinfo.io/json in a browser
Connection should timeout.
TEST 2 (socks + tun)
- Download socks+tun.json
- Fill server address (under
outbounds>socks>server) - Start sing-box:
sing-box.exe run -c "socks+tun.json" - Try to open https://ipinfo.io/json in a browser
You should see a json showing IP address of your server
TEST 3 (wg + mixed)
- Download wg+mixed.json
- Fill server address (under
endpoints>wireguard>peers>address) - Start sing-box:
sing-box.exe run -c "wg+mixed.json" - Change system proxy (or browser proxy) to
127.0.0.1:1080 - Try to open https://ipinfo.io/json in a browser
You should see a json showing IP address of your server.
Logs
Supporter
- [ ] I am a sponsor
Integrity requirements
- [x] I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
- [x] I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
- [x] I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
- [x] I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days