This is a post about my fork of phvr’s Mullvad script for Gentoo and OpenRC, replacing sudo with OpenDoas, with some additional features. Also details how to use it.
I have been using exclusively Linux for a few years now and started using VPN’s around a bit before using Linux. I have used a few VPN’s and Mullvad was the most appealing provider to me but when I moved from Arch to Gentoo. I had issues using it due to it not being in the default Gentoo overlay and it’s lack of support for OpenRC. I looked around for some solutions and discovered phvr’s Mullvad script for Gentoo.
I have used this for the past year and it is a great script, but I have found it is missing some features that would be nice. This is why I have created a fork of it with some of the features I would like and some broken bits due to Mullvad changing their naming system.
Requires less resources due to no UI and OpenVPN :)
To add the overlay that contains it for portage:
$ eselect repository add elliowo-overlay git https://github.com/elliowo/elliowo-overlay.git
$ emerge --sync
$ emerge mullvad-wg-doas
$ mullvad helpFrom source:
$ git clone https://github.com/elliowo/mullvad-wg-doas.git
$ cd mullvad-wg-doas
$ chmod +x mullvad
$ ./mullvad helpTo initialise the script to pull in all available servers and their wireguard configs, this will prompt your account number.
mullvad update serversTo rename the files to work with the script consistently:
mullvad update renameTo set a default server, is not required. You can get servers with mullvad list
mullvad update defaultTo connect to a random server
mullvad randomTo connect to a default server, or can specify it.
mullvad connectNote that this needs to be set with mullvad update default, before using the above command.
Enable a kill-switch
mullvad kill-switch on <server>Disable a kill-switch
mullvad kill-switch off <server>It is possible to choose multiple servers. To enable a kill-switch for all servers run
mullvad kill-switch <on|off> allTo get more detailed information about your connection, run
mullvad statusor
mullvad verifyto verify using the am.i.mullvad.net API
It is possible to choose a server that will auto connect on boot.
mullvad start-up <on|off> <server>Show the currently selected startup server:
mullvad start-up showFor this to work you need the ‘local’ service enabled:
# rc-update add local default