IPv6 on Windows and WSL has been a bane of my existence for years. When working on a project that specifically required IPv6, I realized I'd have to figure out what was going on. Thus this little program was born.
There are several requirements to use this.
WSL must be running in bridge mode. For example, here is my /mnt/c/Users/lande/.wslconfig
file:
[wsl2]
networkingMode=bridged #<--
vmSwitch=wsl #<--
dhcp=true #<--
ipv6=true #<--
macAddress=08:6a:c5:51:eb:bf #<--
memory=4GB
processors=2
localhostforwarding=true #<--
debugConsole=false
The "vmSwitch" is a normal bridged network interface set in hyper-v management console.
I then set up my /etc/resolv.conf
by configuring systemd-resolved: sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
I haven't installed this on a fresh computer, but it may required to have winpcap (I have wireshark) installed.
After much investigation and fiddly bits with wireshark, I came to realize that IPV6 packets weren't being forwarded to WSL correctly. I don't know why, but for whatever reason no one at Microsoft is smart enough or cares enough to fix what is probably a really simple bug.
Thus, this incredibly simple program was born.
Once the network discovers the correct route, this program is not required. You have to "train" your network and Windows to allow ipv6 packets to work correctly and this program helps with that.
Here's the gist:
08:6a:c5:51:eb:bf
using the example given above).As long as WSL continues to ping an ipv6 address, ipv6 connectivity will work without any further work.
This program REQUIRES an ipv6 address to ping. It is currently hardcoded to one of my servers:
2a01:4f9:6b:5601::2
: RIPE
Supposedly, I could see who is using this software. However, nothing is tracked or monitored. I do not guarantee this server to be up 100% of the time and if this server is down, this software will misbehave.
If you have any ideas on how to make this better, please open an issue.
I do recommend building this from source and using an IP address you trust if this is a concern for you.
You can either download the source and build it yourself or download the binary from releases.
Initial connections take a few packets going to the wrong place before eventually going to the right place (and this program will handle that). You only need it to "train" your network to send packets to the right place. Once you've done that, IPv6 will continue running just fine until the network "forgets" the route.