Finally Getting ipv6 in WSL2

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.


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:

  1. amtm
  2. ep and install entware
  3. wg and install wireguard manager
  4. uf dev to upgrade wireguard manager to the latest dev branch
  5. e to exit and then wg to get the updated wireguard manager
  6. Now you can create a server peer new ipv6=2001:YOUR_PREFIX::100:1/64 noipv4
  7. 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

Congrats! You now have a public IPv6 address for your WSL2 installation!

Want an inside scoop?

Check out PHP Shenanigans for only €5/mo or €30/yr


2 responses to “Finally Getting ipv6 in WSL2”

  1. Adrien Foulon Avatar
    Adrien Foulon

    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

    1. 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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.