Skip to content

Instantly share code, notes, and snippets.

View jon-hedgerows's full-sized avatar
🐌
I may be slow to respond.

Jon Davies jon-hedgerows

🐌
I may be slow to respond.
View GitHub Profile
wg-quick on WSL2 doesn't play well - if you have a default route through wireguard it tries to use features of nftables/iptables that aren't compiled into the WSL2 kernel, and all the answers I could find basically said "build a custom kernel". No thanks!
Wireguard itself works fine on ubuntu on WSL2, it's just the way wg-quick sets it up that doesn't.
this might help you if you have one peer, and want to route all traffic through it.
This note doesn't tell you how to configure wireguard - there are plenty of sites that cover that. The config below is just an example, and will NOT work!
the startup script finds the IP of the wireguard endpoint you're connecting to and sets up a host route to it, firs up wireguard, and sets a default route through wireguard.