Comments (2)
I have to caution you that if editing resolv.conf
fixes your connectivity issues, your VPN does not really block network connectivity from WSL 2, and sticking to just setting your DNS server in resolv.conf
is probably a better way to go.
That said, try running wsl-vpnkit in the foreground, then try testing your connectivity in a separate terminal.
# PowerShell
wsl --shutdown
kill -Name wsl-gvproxy
wsl.exe -d wsl-vpnkit wsl-vpnkit
# keep this open
# your WSL 2 distro shell
ip route | grep default
# should return only one entry something like "default via 192.168.67.1 dev eth1 metric 207"
nslookup google.com 1.1.1.1
nslookup google.com 192.168.67.1
ping -c 1 1 1.1.1.1
The default configuration should work unless you have specific requirements. There should be no need to edit resolv.conf
in your WSL 2 distro, although you can if you want to use a separate DNS server.
from wsl-vpnkit.
Thanks for the reply!
Re your point about resolv.conf
fixing connectivity issues - my connectivity issues have been a combination of just WSL being WSL and also the VPN. So far the VPN has worked without any resolv.conf
changes until today.
I tried running wsl-vpnkit in the foreground and this time it works properly, both on the logs and in my linux distro. Not sure what caused it to magically start working, as I had previously tried to restart wsl-vpnkit. Here are the logs in case you wish to debug further:
> wsl.exe -d wsl-vpnkit wsl-vpnkit
starting wsl-vpnkit
cleaning up iptables...
iptables cleanup done
restoring WSL 2 ip route...
ip: RTNETLINK answers: File exists
restored WSL 2 ip route
wsl-gvproxy.exe exists at /mnt/c/Users/[username]/wsl-vpnkit/wsl-gvproxy.exe
starting gvproxy at /mnt/c/Users/[username]/wsl-vpnkit/wsl-gvproxy.exe...
started gvproxy
waiting for dhcp...
INFO[0000] waiting for packets...
udhcpc: started, v1.34.1
udhcpc: broadcasting discover
time="2022-03-03T15:33:05+08:00" level=info msg="new connection from remote to 8692"
udhcpc: broadcasting select for 192.168.67.3, server 192.168.67.1
udhcpc: lease of 192.168.67.3 obtained from 192.168.67.1, lease time 3600
default via 192.168.67.1 dev eth1 metric 206
dhcp completed
removing WSL 2 ip route...
removed WSL 2 ip route
adding rules to iptables...
iptables done
check: ✔️ ping success to IPv4 WSL 2 gateway / Windows host (172.31.240.1)
check: ✔️ ping success to IPv4 Windows host (192.168.67.2)
check: ✔️ ping success to IPv4 gateway (192.168.67.1)
check: ✔️ nslookup success for example.com A using 192.168.67.1
check: ✔️ nslookup success for example.com A using 192.168.67.1
check: ✔️ nslookup success for example.com A using 172.31.240.1
check: ✔️ nslookup success for example.com A using 1.1.1.1
check: ✔️ ping success to IPv4 external host (example.com)
check: ✔️ nslookup success for example.com AAAA using 192.168.67.1
check: ✔️ nslookup success for example.com AAAA using 192.168.67.1
check: ✔️ nslookup success for example.com AAAA using 172.31.240.1
check: ✔️ nslookup success for example.com AAAA using 1.1.1.1
ping: bad address 'example.com'
check: ➖ ping fail to IPv6 external host (example.com)
check: ✔️ wget success for https://example.com
$ ip route | grep default
default via 192.168.67.1 dev eth1 metric 206
$ nslookup google.com 1.1.1.1
Server: 1.1.1.1
Address: 1.1.1.1#53
Non-authoritative answer:
Name: google.com
Address: 172.217.25.14
Name: google.com
Address: 2404:6800:4005:802::200e
$ ping -c 1 1.1.1.1
ping: socket: Operation not permitted
$ sudo ping -c 1.1.1.1
ping: invalid argument: '1.1.1.1'
$ nslookup google.com 192.168.67.1
Server: 192.168.67.1
Address: 192.168.67.1#53
Non-authoritative answer:
Name: google.com
Address: 172.217.25.14
from wsl-vpnkit.
Related Issues (20)
- Patch for 0.4.1's systemd service stopped working
- Intermittently losing network connectivity - "Exception 0xc0000006" and "cannot read size from socket: EOF"
- resolution of host.internal variable HOT 1
- Systemd setup prevents wsl.exe from running
- How does WSL2 2.0.0 interact with wsl-vpnkit? HOT 17
- open capture.pcap: Access is denied HOT 1
- Lost access to WSL service from Windows when connected to VPN
- wsl-vpnkit has a undocumented effect on a distro once systemd is enabled, full uninstall info needed
- bind: An attempt was made to access a socket in a way forbidden by its access permissions.
- Any known issues with wsl-vpnkit and wsl 2.0.5? HOT 30
- Resolving interop-issue while running wsl-vpnkit as a systemd-service in own wsl-distro HOT 12
- Running wsl-vpnkit 0.4.1 works fine, but cannot make it run under systemctl HOT 17
- wsl-vpnkit and wsl 2.0.14 HOT 4
- WSL2 September 2023 allows for Mirrored Networking Mode HOT 3
- Subnet 192.168.100.0/24 ping responds always when wsl-vpnkit distro is running
- Reverse lookup does not work
- ping fail error
- Program stucks while checking internet connection HOT 1
- README update.
- "too many open files" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl-vpnkit.