Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TUN mode incompatibility with WSL #126

Open
Soberia opened this issue May 25, 2024 · 1 comment
Open

TUN mode incompatibility with WSL #126

Soberia opened this issue May 25, 2024 · 1 comment

Comments

@Soberia
Copy link

Soberia commented May 25, 2024

The new TUN mode doesn't get along with the WSL mirrored networking mode. If mirrored mode is enabled, WSL won't be able to start. However, there is no issue with the default NAT networking mode.

Steps to reproduce:

  1. Shut down the WSL stack. (wsl --shutdown)
  2. Run the warp-plus in TUN mode (warp-plus.exe --tun-experimental)
  3. Try to run the WSL (hangs forever...)

If WSL is already running and then the TUN mode is enabled on the Windows host, connections from WSL won't routed through the TUN device (executing curl https://api.ipify.org returns the machine's public IP address instead of the Cloudfalre's WARP)

The OpenConnet also leverages the same driver (Wintun) but there is no issue with it.
I noticed that with warp-plus TUN mode, no IP address had been assigned to the related mirrored interface (eth1) inside the WSL:

saber@Saber:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 10.255.255.254/32 brd 10.255.255.254 scope global lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 20:89:84:40:69:61 brd ff:ff:ff:ff:ff:ff
3: loopback0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:a1:a0:5d brd ff:ff:ff:ff:ff:ff
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc mq state UP group default qlen 1000
    link/ether 60:36:dd:f1:ea:f5 brd ff:ff:ff:ff:ff:ff
    inet 172.20.10.4/28 brd 172.20.10.15 scope global noprefixroute eth2
       valid_lft forever preferred_lft forever
    inet6 2a01:***:***d/64 scope global nodad deprecated noprefixroute
       valid_lft forever preferred_lft 0sec
    inet6 2a01:***:***1/128 scope global nodad noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::19bc:e883:fb40:fde2/64 scope link nodad noprefixroute
       valid_lft forever preferred_lft forever
6: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:a9:32:e7:4d brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
8: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:15:5d:6e:57:7c brd ff:ff:ff:ff:ff:ff
C:\Users\Saber>ipconfig /all

Unknown adapter warp0:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : WireGuard Tunnel
   Physical Address. . . . . . . . . :
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : fd12:3456:789a:1::1(Preferred)
   IPv4 Address. . . . . . . . . . . : 172.16.0.2(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : ::
                                       0.0.0.0
   DNS Servers . . . . . . . . . . . : 1.1.1.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

But this is not the case with OpenConnect: (the mirrored Wintun interface is eth02)

saber@Saber:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 10.255.255.254/32 brd 10.255.255.254 scope global lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 20:89:84:40:69:61 brd ff:ff:ff:ff:ff:ff
3: loopback0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:a1:a0:5d brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc mq state UP group default qlen 1000
    link/ether 60:36:dd:f1:ea:f5 brd ff:ff:ff:ff:ff:ff
    inet 172.20.10.4/28 brd 172.20.10.15 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 2a01:***:***d/64 scope global nodad deprecated noprefixroute
       valid_lft forever preferred_lft 0sec
    inet6 2a01:***:***1/128 scope global nodad noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::19bc:e883:fb40:fde2/64 scope link nodad noprefixroute
       valid_lft forever preferred_lft forever
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1378 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:c7:3e:79 brd ff:ff:ff:ff:ff:ff
    inet 10.10.0.10/16 brd 10.10.255.255 scope global noprefixroute eth2
       valid_lft forever preferred_lft forever
    inet6 2a03:***:***e/64 scope global nodad noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::544c:6da1:f398:1bf1/64 scope link nodad noprefixroute
       valid_lft forever preferred_lft forever
6: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:d7:be:50:c2 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
C:\Users\Saber>ipconfig /all

Unknown adapter ***.ir:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : OpenConnect Tunnel
   Physical Address. . . . . . . . . :
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2a03:***:***e(Preferred)
   Link-local IPv6 Address . . . . . : fe80::544c:6da1:f398:1bf1%44(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.10.0.10(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . : 0.0.0.0
   DNS Servers . . . . . . . . . . . : 2a03:***:***3
                                       192.168.100.3
   NetBIOS over Tcpip. . . . . . . . : Enabled

warp-plus v1.2.1
Windows 11 build 26100.712
WSL v2.2.4.0

@zoghal
Copy link

zoghal commented May 25, 2024

صرفا جهت اطلاع همین مشکل رو هم من با tun2socks و wsl دارم.
پس نباید مشکل از warp-plus باشه

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants