openvpn connection stops working after upgraded to 2.0.9 with mirrored networking
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
Microsoft Windows [Version 10.0.22631.2715]
### WSL Version
2.0.9
### Are you using WSL 1 or WSL 2?
- [X] WSL 2
- [ ] WSL 1
### Kernel Version
Linux version 5.15.133.1-microsoft-standard-WSL2 (root@1c602f52c2e4)
### Distro Version
Ubuntu 22.04
### Other Software
OpenVPN Connect 3.4.2
### Repro Steps
1. Update `.wslconfig` with below settings:
```
[experimental]
autoMemoryReclaim=gradual
sparseVhd=true
dnsTunneling=true
networkingMode=mirrored
hostAddressLoopback=true
```
2. Connect OpenVPN and start wsl2
3. telnet my internal ip address in vpn network from wsl2, I see timeout:
```
$ telnet 10.120.31.82 22
Trying 10.120.31.82...
telnet: Unable to connect to remote host: Connection timed out
```
4. But telnet from windows cmd, I can telnet:

Additional information:
```
$ ip a
1: lo: 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
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 00:15:5d:eb:59:b0 brd ff:ff:ff:ff:ff:ff
3: loopback0: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:a0:d1:f0 brd ff:ff:ff:ff:ff:ff
4: eth1: mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 00:15:5d:4a:52:c8 brd ff:ff:ff:ff:ff:ff
5: eth2: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 08:8e:90:93:b8:cc brd ff:ff:ff:ff:ff:ff
inet 10.140.97.86/20 brd 10.140.111.255 scope global noprefixroute eth2
valid_lft forever preferred_lft forever
inet6 fe80::d8ec:c0a:e95a:116f/64 scope link nodad noprefixroute
valid_lft forever preferred_lft forever
6: eth3: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:09:f7:8c brd ff:ff:ff:ff:ff:ff
inet 172.25.0.2/21 brd 172.25.7.255 scope global noprefixroute eth3
valid_lft forever preferred_lft forever
7: br-31ee55146667: mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:d8:22:99:c4 brd ff:ff:ff:ff:ff:ff
inet 172.20.0.1/16 brd 172.20.255.255 scope global br-31ee55146667
valid_lft forever preferred_lft forever
8: br-579eb2cdeae4: mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:43:61:bd:fe brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global br-579eb2cdeae4
valid_lft forever preferred_lft forever
9: br-72e0a078af51: mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:17:cb:3a:c2 brd ff:ff:ff:ff:ff:ff
inet 172.23.0.1/16 brd 172.23.255.255 scope global br-72e0a078af51
valid_lft forever preferred_lft forever
10: docker0: mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:70:9c:c7:f3 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 brd 172.18.255.255 scope global docker0
valid_lft forever preferred_lft forever
11: br-09be57e2d7d9: mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:a3:b0:89:3f brd ff:ff:ff:ff:ff:ff
inet 172.19.0.1/16 brd 172.19.255.255 scope global br-09be57e2d7d9
valid_lft forever preferred_lft forever
```
eth2 has the ip address from my wifi adapter in windows, eth3 is the client ip assigned by openvpn server (172.25.0.0/21).
```
$ ip route show
default via 10.140.96.1 dev eth2 proto kernel metric 45
10.90.0.0/16 via 172.25.0.1 dev eth3 proto kernel metric 257
10.110.0.0/16 via 172.25.0.1 dev eth3 proto kernel metric 257
10.120.0.0/16 via 172.25.0.1 dev eth3 proto kernel metric 257
10.130.0.0/16 via 172.25.0.1 dev eth3 proto kernel metric 257
10.140.96.0/20 dev eth2 proto kernel scope link metric 301
10.140.96.1 dev eth2 proto kernel scope link metric 45
10.140.96.1 dev eth2 proto kernel scope link metric 301
via 10.140.96.1 dev eth2 proto kernel metric 301
169.254.0.0/16 dev eth2 scope link metric 1000
172.17.0.0/16 dev br-579eb2cdeae4 proto kernel scope link src 172.17.0.1 linkdown
172.18.0.0/16 dev docker0 proto kernel scope link src 172.18.0.1 linkdown
172.19.0.0/16 dev br-09be57e2d7d9 proto kernel scope link src 172.19.0.1 linkdown
172.20.0.0/16 dev br-31ee55146667 proto kernel scope link src 172.20.0.1 linkdown
172.23.0.0/16 dev br-72e0a078af51 proto kernel scope link src 172.23.0.1 linkdown
172.25.0.0/21 dev eth3 proto kernel scope link metric 257
172.25.0.1 dev eth3 proto kernel scope link metric 257
```
Seems like nothing wrong with the routes?
PS: I also have cisco anyconnect vpn client which works very well with mirrored networking.
### Expected Behavior
OpenVPN connection should work with mirrored networking
### Actual Behavior
OpenVPN connection stopped working with mirrored networking
### Diagnostic Logs
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the listed .wslconfig mirrored-networking settings, OpenVPN Connect, and WSL 2, then inspect the reported interfaces and routes while connected. Compare connectivity to the internal 10.120.31.82 address from WSL and Windows; done means OpenVPN internal addresses are reachable from WSL with mirrored networking enabled.
Written by the indexing model from the issue text.
Assessment
- Domain
- networking, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100