Openvpn configuration

I’m trying to connect to the internet through a vpn. I’m have my openvpn config as:

  services.openvpn.servers.vpn = {
    config = "config /home/lassi/.config/nixos/vpn.ovpn";
    autoStart = false;
    authUserPass.password = *****;
    authUserPass.username = *****;
    updateResolvConf = true;
  };

The service starts fine and systemctl reports that it is running. However, going to a site such as whatsmyip.com shows my actual ip address, not the vpn provider’s. The same vpn worked when I used it with my Linux Mint.

1 Like

Any new users setting up open vpn this has worked for me.

services.openvpn.servers = {
    vpnname= {
      autoStart = false;
      config = ''
        config fullpath/OpenVPN/configFile.ovpn
        auth-user-pass fullpath/secret # secret file can contain your username and password separated by new line
      '';
      updateResolvConf = false; # this one might need to be turned off to solve the problem.
    };
  };