InvisibleManVPN / InvisibleMan-XRayClient

A client for xray core
MIT License
422 stars 52 forks source link

No gateway redirection in TUN mode if no system default gateway defined #133

Open dmitrydonskih opened 2 months ago

dmitrydonskih commented 2 months ago

Error

In configurations where no default gateway is defined in system, running TUN mode does not add default gateway redirection to TUN IP.

Environment

Windows 10 Default route is removed to ensure that NO traffic outbounds system, except via Xray server. Addded explicit route for server IP via router.

What is expected

Default gateway 0/0 should be created by XRayClient regardless of existing default gateway.

Reproduce

Say your system has default gateway via router 192.168.1.1 and your Xray server is 111.22.33.44

  1. Remove default gateway: route delete 0.0.0.0 mask 0.0.0.0
  2. Add route to your server: route add 111.22.33.44 mask 255.255.255.255 192.168.1.1
  3. Run XrayClient in TUN mode
  4. Run route print, see that no route to 0.0.0.0 mask 0.0.0.0 is added.

    Workaround

    Define any default route to non-existing address in local network, i.e. 192.168.1.254: route /p add 0.0.0.0 mask 0.0.0.0 192.168.1.254