Skip to content

Instantly share code, notes, and snippets.

@KoviRobi
Created August 4, 2024 14:54
Show Gist options
  • Save KoviRobi/8f0fa37689c32b73328b3d44844a024f to your computer and use it in GitHub Desktop.
Save KoviRobi/8f0fa37689c32b73328b3d44844a024f to your computer and use it in GitHub Desktop.
MozWire and NetworkManager

This is a reminder for me on how to use MozWire (Mozilla VPN on Linux)

First, make sure you have mozwire installed. You can use your normal package manager, I use nix here

$ nix shell nixpkgs\#mozwire

Then log in to Mozilla VPN, via

$ export MOZ_TOKEN=$(mozwire --print-token)

Note, you probably want to do this in a shell session you quit after relay save below

Note, ake sure you have enabled JavaScript on the mozilla webpage, otherwise logging in might not send the token back to the shell.

Create a connection, you can use

$ mozwire relay save gb

And then import that connection -- note you might lose internet after this step (and it means you need to do the ip route step).

$ nmcli connection import type wireguard file <file from previous step>

I then lose internet here, because nmcli hasn't added an IP route to the peer to go outside the VPN...

The file from the previous step has the [Peer] section, which has Endpoint = <ip>:<port>

And 192.168.0.1 dev enp34s0 is my non-VPN traffic, you can just run ip route to find that out

Now let's add a specific route for the peer

$ sudo ip route add <ip> via 192.168.0.1 dev enp34s0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment