A bash
scripts that generates Wireguard configuration file for a NordVPN connection.
This guide assumes the use of Ubuntu. A similar install procedure will work on other distros.
First let's clone this project so that you'll have the script on your target Ubuntu system.
sudo apt install wireguard curl jq net-tools
Install NordVPN client
Execute the following command and follow the on screen instructions:
sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)
Login to your NordVPN account
The procedure differs if you have MFA
enabled on your account:
-
MFA
is ENABLED on your accountnordvpn login
This will return a URL link.
Open the link on any browser, on any machine and perform the login.
Cancel out of theOpen with
popup, and copy the link that is assigned to theContinue
link, under the message sayingYou've successfully logged in
.Back to the terminal
nordvpn login --callback "<The link you copied>"
And it will log you in.
-
MFA
is NOT ENABLED on your accountUse
legacy
username and password to login.Note: This will NOT work if you have
Multi Factor Authentication
enabled. (See above for theMFA
method)nordvpn login --legacy
After a successful login, please set NordVPN to use NordLynx
protocol.
sudo nordvpn set technology nordlynx
Generate Wireguard configuration files
The script is quite simple and can be run without parameters to generate a config file for the recommended server:
$ ./NordVpnToWireguard.sh
Connect to NordVPN to gather connection parameters....
Wireguard configuration file NordVPN-us1234.conf created successfully!
Requesting a specific country:
$ ./NordVpnToWireguard.sh Canada
Connect to NordVPN to gather connection parameters....
Wireguard configuration file NordVPN-ca1234.conf created successfully!
Requesting a specific city
$ ./NordVpnToWireguard.sh Berlin
Connect to NordVPN to gather connection parameters....
Wireguard configuration file NordVPN-de1234.conf created successfully!
Requesting a specific country and city
$ ./NordVpnToWireguard.sh Japan Tokyo
Connect to NordVPN to gather connection parameters....
Wireguard configuration file NordVPN-jp1234.conf created successfully!
Requesting a specific server group
$ ./NordVpnToWireguard.sh Double_VPN
Connect to NordVPN to gather connection parameters....
Wireguard configuration file NordVPN-ca-us1234.conf created successfully!
Getting help:
$ ./NordVpnToWireguard.sh --help
Usage: NordVpnToWireguard [command options] [<country>|<server>|<country_code>|<city>|<group>|<country> <city>]
Command Options includes:
<country> argument to create a Wireguard config for a specific country. For example: 'NordVpnToWireguard Australia'
<server> argument to create a Wireguard config for a specific server. For example: 'NordVpnToWireguard jp35'
<country_code> argument to create a Wireguard config for a specific country. For example: 'NordVpnToWireguard us'
<city> argument to create a Wireguard config for a specific city. For example: 'NordVpnToWireguard Hungary Budapest'
<group> argument to create a Wireguard config for a specific servers group. For example: 'NordVpnToWireguard connect Onion_Over_VPN'
-h | --help - displays this message.
Use the generated Wireguard configuration files
Import the file/s with the Wireguard client in any platform and activate the VPN
.