It keeps “connected and connecting” very frequently like 30-60 seconds for a cycle.
It is connected for a very short time (a few second) and then it become “connecting” and find another node to connect.
And then it is connected for only a few second and then find an new node to connect again.
It repeats again and again.
I disabled quantum resistance, disabled multihop, using wireguard, only turned on lock down mode
Still no luck
# https://headless-render-api.com/blog/2024/04/08/mullvad-vpn-containerized-nixos
{ lib, ... }:
let
containerName = "mullvad";
externalInterface = "eth0";
in
{
# https://blog.beardhatcode.be/2020/12/Declarative-Nixos-Containers.html
networking.nat = {
enable = true;
internalInterfaces = [ "ve-${containerName}" ];
inherit externalInterface;
};
# https://github.com/mullvad/mullvadvpn-app/issues/5408#issuecomment-1805189128
fileSystems."/tmp/net_cls" = {
device = "net_cls";
fsType = "cgroup";
options = [ "net_cls" ];
};
containers.${containerName} = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
bindMounts = {
"/etc/mullvad-vpn" = {
hostPath = "/persist/etc/mullvad-vpn";
isReadOnly = false;
};
"/var/cache/mullvad-vpn" = {
hostPath = "/persist/var/cache/mullvad-vpn";
isReadOnly = false;
};
"/var/log/mullvad-vpn" = {
hostPath = "/persist/var/log/mullvad-vpn";
isReadOnly = false;
};
};
config =
{ pkgs, ... }:
{
system.stateVersion = "25.05";
services.mullvad-vpn.enable = true;
networking = {
firewall.allowedTCPPorts = [ 80 ];
firewall.enable = false;
hostName = containerName;
useHostResolvConf = lib.mkForce false;
};
services.httpd = {
enable = true;
adminAddr = "admin@example.org";
};
# Reported some Mullvad-vpn doesn't work correctly with systemd-resolved
# https://github.com/mullvad/mullvadvpn-app/issues/6063
# But nixos wiki recommended this
# https://wiki.nixos.org/wiki/NixOS_Containers
services.resolved.enable = true;
};
};
}