sing-box icon indicating copy to clipboard operation
sing-box copied to clipboard

Routing "tun" inbound into "wireguard" outbound not working on Windows

Open Victor0543 opened this issue 1 year ago • 1 comments

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

  1. Download server.json onto your server
  2. Open ports UDP 10000 and TCP 10001 on your server
  3. Start sing-box: sing-box.exe run -c "server.json"

TEST 1 (wg + tun)

  1. Download wg+tun.json
  2. Fill server address (under endpoints > wireguard > peers > address)
  3. Start sing-box: sing-box.exe run -c "wg+tun.json"
  4. Try to open https://ipinfo.io/json in a browser

Connection should timeout.

TEST 2 (socks + tun)

  1. Download socks+tun.json
  2. Fill server address (under outbounds > socks > server)
  3. Start sing-box: sing-box.exe run -c "socks+tun.json"
  4. 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)

  1. Download wg+mixed.json
  2. Fill server address (under endpoints > wireguard > peers > address)
  3. Start sing-box: sing-box.exe run -c "wg+mixed.json"
  4. Change system proxy (or browser proxy) to 127.0.0.1:1080
  5. Try to open https://ipinfo.io/json in a browser

You should see a json showing IP address of your server.

Logs


Supporter

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.

Victor0543 avatar Oct 29 '25 14:10 Victor0543

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

github-actions[bot] avatar Jan 04 '26 02:01 github-actions[bot]