Code Monkey home page Code Monkey logo

nordvpn-wireguard's Introduction

Wireguard configuration file generator for a NordVPN

A bash scripts that generates Wireguard configuration file for a NordVPN connection.

INSTALL

This guide assumes the use of Ubuntu. A similar install procedure will work on other distros.

Clone this project

First let's clone this project so that you'll have the script on your target Ubuntu system.

Install required packages

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:

  1. MFA is ENABLED on your account

    nordvpn login

    This will return a URL link.
    Open the link on any browser, on any machine and perform the login.
    Cancel out of the Open with popup, and copy the link that is assigned to the Continue link, under the message saying You've successfully logged in.

    Back to the terminal

    nordvpn login --callback "<The link you copied>"

    And it will log you in.

  2. MFA is NOT ENABLED on your account

    Use legacy username and password to login.

    Note: This will NOT work if you have Multi Factor Authentication enabled. (See above for the MFA method)

    nordvpn login --legacy​

Change protocol to NordLynx

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
Getting configuration for recommended server...
Wireguard configuration file NordVPN-us1234.conf created successfully!

Requesting a specific country:

$ ./NordVpnToWireguard.sh --country Canada
Getting configuration for recommended server in Canada
Wireguard configuration file NordVPN-ca1234.conf created successfully!

Requesting a specific city

$ ./NordVpnToWireguard.sh --city Berlin
Getting configuration for recommended server in Berlin
Wireguard configuration file NordVPN-de1234.conf created successfully!

Requesting a specific country and city

$ ./NordVpnToWireguard.sh --country Japan --city Tokyo
Getting configuration for recommended server in Japan, city: Tokyo
Wireguard configuration file NordVPN-jp1234.conf created successfully!

Getting help:

$ ./NordVpnToWireguard.sh --help
Usage: NordVpnToWireguard [OPTIONS]
OPTION includes:
   -v | --version  - prints out version information.
   -c | --country  - Country to connect to (ex. Canada). If option is not provided, NordVPN will get a wireguard configuration for the recommended country, unless a valid city name is provided.
   -s | --city - City to connect to (ex. Toronto). When country option is provided, NordVPN will look for the the city within the country and return the fastest server. If no country is provided, NordVPN will look up the fastest server for a city matching the name.
   -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.

nordvpn-wireguard's People

Contributors

sfiorini avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.