Skip to content

Instantly share code, notes, and snippets.

@yangl1996
Last active October 30, 2023 16:13
Show Gist options
  • Save yangl1996/f1b54d293ebf8eb53bffe77d1e5181df to your computer and use it in GitHub Desktop.
Save yangl1996/f1b54d293ebf8eb53bffe77d1e5181df to your computer and use it in GitHub Desktop.
Mullvad VPN on OpenBSD
rdomain 1
inet <ip assigned by mullvad> <netmask assigned by mullvad should be 255.255.255.255> NONE
wgkey <your private key>
wgpeer <mullvad server public key> wgdescr 'Mullvad' wgaip 0.0.0.0/0 wgendpoint <mullvad server ip> <mullvad server port>
up
!route -T1 add -net default <ip assigned by mullvad>
Note that this config puts the wireguard interface at routing domain 1, which is nondefault. To run a program using that
routing domain, execute
route -T1 exec your command ...
The reverse, which is installing wireguard to routing domain 0 (default), is also possible. You will need to first move
the "normal" interfaces to routing domain 1, and then use the keyword
wgrtable 1
when configuring the wireguard interface. This keyword tells wireguard to use routing domain 1 for connecting to the server.
Then, remove the keyword
rdomain 1
so that the tunneled traffic is routed in routing domain 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment