I really like using Windows to get around the web and write software, but I prefer Linux and bash for a CLI. Thus I tend to use WSL2 to do lots of things around the house. One thing missing for a long time is IPv6.
Finally, today, I managed to get IPv6 working.
Requirements
If you want to follow along, you need an Asus router flashed with AsusWrt, and obviously, native IPv6 on your network. Also, WSL2 with this kernel and wireguard-tools
installed.
Installing things on the router
SSH to your router and enter the following commands:
amtm
ep
and install entwarewg
and install wireguard manageruf dev
to upgrade wireguard manager to the latest dev branche
to exit and thenwg
to get the updated wireguard manager- Now you can create a server
peer new ipv6=2001:YOUR_PREFIX::100:1/64 noipv4
- and a new device:
create wsl
Turning on IPv6
Finally copy the configuration to your computer from /opt/etc/wireguard.d/wsl.conf
on your router to somewhere on your WSL installation.
Then just wg-quick up /path/to/wsl.conf
and ping your favorite ipv6-only domain: ping6 ipv6.google.com
.
Congrats! You now have a public IPv6 address for your WSL2 installation!
2 responses to “Finally Getting ipv6 in WSL2”
Basically the solution is just to VPN to a device with ipv6 enabled, I’d guess that adding a wireguard server on windows and connecting from wsl would be easier and not router dependant
Indeed! I tried that route first but ran into lots of issues that made it impractical, beyond using a router. I don’t remember the specific issues I ran into, but there were a number of them.