Using Mullvad VPN

Hi everyone,

I’ve been using NixOS and the Mullvad package several times together, thus bought another Mullvad licence tonight without checking anything, but I can’t manage to make it work :worried:.

I don’t want to use Mullvad all the time: I want it to start/stop only at will. What I used to do – which shouldn’t be NixOSish :sweat_smile: – was to start the mullvad-daemon as sudo command, then launch the application. However, the daemon won’t launch right now:

[tcip@tlap:~]$ sudo mullvad-daemon 
[2021-04-28 01:55:27.581][mullvad_daemon::version][INFO] Starting mullvad-daemon - 2020.5 2020-06-25
[2021-04-28 01:55:27.581][mullvad_daemon][INFO] Logging to /var/log/mullvad-vpn
[2021-04-28 01:55:27.582][mullvad_daemon][INFO] Management interface listening on /var/run/mullvad-vpn
[2021-04-28 01:55:27.608][mullvad_daemon::relays][INFO] Initialized with 661 cached relays from 1970-01-01 01:00:01.000
[2021-04-28 01:55:27.608][mullvad_daemon::version_check][WARN] Error: Unable to load cached version info
Caused by: Failure in serialization of the version info
Caused by: missing field `supported` at line 7 column 1
[2021-04-28 01:55:27.608][mullvad_daemon::settings][INFO] Loading settings from /etc/mullvad-vpn/settings.json
[2021-04-28 01:55:27.608][mullvad_daemon::account_history][INFO] Opening account history file in /etc/mullvad-vpn/account-history.json
[2021-04-28 01:55:27.628][mullvad_daemon][INFO] Management interface shut down
[2021-04-28 01:55:28.629][mullvad_daemon][ERROR] Error: Unable to initialize daemon
Caused by: Tunnel state machine error
Caused by: Failed to initialize the route manager
Caused by: Internal route manager error
Caused by: Unable to create routing table for split tunneling
Caused by: No such file or directory (os error 2)

Any idea where I messed up, or how to use it properly?
Thanks for your help, and all the best,

1 Like

Have you enabled the mullvad service with this NixOS option?

https://search.nixos.org/options?channel=20.09&show=services.mullvad-vpn.enable&from=0&size=50&sort=relevance&query=mullvad

1 Like

Thanks a lot @Mapybara, everything is working, and sorry for the hassle – I forgot to check the options… :confused:

Not your fault! Ideally the entry on the packages page should tell you you need the option.

Thanks for cheering me up :smile:!

2 Likes

Hey @tcip . Is mullvad working fine for you these days? I’m on 21.05 (mullvad 2021.3
) and lately even though I supposedly get a connection to the server, I’m not able to access the world wide web… :frowning: Tried many things, changing protocol openvpn/wireguard, switching locations, renewing wireguard keys, nothing works.

It’s working fine for me. You might have to post your configuration.

1 Like

Thanks @Mapybara, my firewall was blocking ports mullvad tried to use.

However, I’m surprised that it if mullvad is enabled as a service (services.mullvad-vpn.enable = true; it doesn’t get ports open automatically. Also it is strange that mullavad status reports connection even if it is actually blocked.

1 Like

Sorry @mixmixmix, I’m currently not using Mullvad on my system.
Glad you found an answer anyway :wink:.

I think NixOS should open Mullvad’s default port, 53, yes.

Which ports should I open in my firewall for OpenVPN ? #

TCP : 80, 443, 1401
UDP : 53, 1194, 1195, 1196, 1197, 1300, 1301, 1302, 1303, 1400
(Ports 1400 UDP and 1401 TCP do not have DNS hijacking enabled, which might work better for pfSense users)

It looks like it doesn’t open all of the necessary ports. I’m just writing here in case anyone else runs into this problem, I think trying to fix it would be way out of my depth… :wink:

1 Like