LogoLogo
DownloadBlog
  • Overview
  • Getting started
    • Meshnet explained
    • How to start using Meshnet
      • Using Meshnet on Windows
      • Using Meshnet on Android
      • Using Meshnet on iPhone/iPad
      • Using Meshnet on macOS
      • Using Meshnet on Linux
      • Using Meshnet on Android TV
    • How to use Meshnet securely
  • Features
    • Linking devices in Meshnet
      • Linking external Meshnet devices on Windows
      • Linking external Meshnet devices on Android
      • Linking external Meshnet devices on iPhone/iPad
      • Linking external Meshnet devices on macOS
      • Linking external Meshnet devices on Linux
      • Linking external Meshnet devices on Android TV
    • Explaining permissions
      • Remote access permissions
      • File sharing permissions
      • Traffic routing permissions
      • Local network permissions
    • Renaming devices in Meshnet
      • Renaming devices on Windows
      • Renaming devices on Android
      • Renaming devices on iPhone/iPad
      • Renaming devices on macOS
      • Renaming devices on Linux
    • Sharing files in Meshnet
      • Sharing files on Windows
      • Sharing files on Android
      • Sharing files on iPhone/iPad
      • Sharing files on macOS
      • Sharing files on Linux
      • Sharing files on Android TV
    • Routing traffic in Meshnet
      • Routing traffic from Windows
      • Routing traffic from Android
      • Routing traffic from iPhone/iPad
      • Routing traffic from macOS
      • Routing traffic from Linux
      • Routing traffic from Android TV
  • How-to guides
    • Gaming
      • How to set up a private Minecraft server with Meshnet
      • How to set up a private Stardew Valley server with Meshnet
      • How to play Quake 3 Arena over Meshnet
      • How to set up a private Team Fortress 2 server with Meshnet
      • How to set up a remote game-streaming server for Moonlight
      • How to set up a Palworld dedicated server
      • How to play Fallout: New Vegas multiplayer over Meshnet
      • How to set up a private Factorio server with Meshnet
    • Remote files and media access
      • How to set up and access shared folders
        • Configure and access shared folders on Windows
        • Configure and access shared folders on macOS
        • Configure and access shared folders on Linux
        • Access shared folders from Android
        • Access shared folders from iPhone/iPad
        • Access shared folders from Android TV
      • How to watch videos over Meshnet using Kodi
      • How to configure and access a Jellyfin media server remotely
      • How to set up a Plex media server and access it remotely
      • How to set up a remote NAS using OpenMediaVault and Meshnet
      • How to set up a remote picture library with LibrePhotos and Meshnet
      • How to use Syncthing for remote continuous file synchronization
      • How to set up a remote Airsonic music server
      • How to set up HTTP File Server for remote file access
      • How to set up a remote audiobook server
      • How to host a remote Kavita e-book server
      • How to set up and remotely access Immich using Meshnet
    • Remote device access
      • How to log in to your PC remotely over Meshnet
        • Connect to a Windows device
        • Connect to a macOS device
        • Connect to a Linux device
      • How to access remote systems over Meshnet using SSH
      • How to access your IP camera over Meshnet
      • How to use Home Assistant remotely over Meshnet
      • How to make secure macOS Time Machine backups from anywhere
      • How to use Ansible over Meshnet
      • How to access files in your NAS from anywhere without compromising its security
      • How to set up a phone as a security camera with remote access
      • How to assign custom host names to Meshnet services using Nginx proxy manager
      • How to use Proxmox VE remotely over Meshnet
      • How to set up a remotely controlled 3D printer
      • How to set up and remotely access a CasaOS server
    • Joint projects
      • How to set up an NGINX web server and remotely access it over Meshnet
      • How to use Nextcloud file syncing with Meshnet
      • How to set up pair programming using tmux
      • How to set up a Visual Studio Code server for remote development over Meshnet
      • How to host a Focalboard server for remote project management
      • How to use Meshnet for multi-screen Node.js development
      • How to use the Multi-user editing plugin in Unreal Engine over Meshnet
      • How to set up a private Mumble voice chat server
      • How to host a private Rocket.Chat server
    • Own VPN server setup
      • How to set up a VPN server through self-hosting or with DigitalOcean
      • How to create a VPN server with Microsoft Azure
      • How to create a VPN server with AWS
      • How to create a VPN server with Google Cloud
      • How to create a VPN server with Linode
      • How to create a VPN server with Hetzner
    • Network protection
      • How to set up your network protection with Pi-hole
      • How to set up your own DNS server
      • How to protect your network with AdGuard Home
      • How to use the self-hosted Whoogle search engine remotely
      • How to set up a VPN router using Meshnet
  • Troubleshooting
    • Common issues on Windows
    • Common issues on Android
    • Common issues on iPhone/iPad
    • Common issues on macOS
    • Common issues on Linux
Powered by GitBook

© 2025 Nord Security. All Rights Reserved.

On this page
  • Introduction
  • Before you begin
  • Update the system and set your WLAN country
  • Create a hotspot connection
  • Method 1: Using RaspAP
  • Method 2: Using NetworkManager
  • Set up Meshnet
  • Install NordVPN
  • Log in to NordVPN
  • Enable Meshnet
  • Share the VPN connection

Was this helpful?

  1. How-to guides
  2. Network protection

How to set up a VPN router using Meshnet

Learn how to transform a Linux device into a VPN router using Meshnet’s traffic routing capabilities.

PreviousHow to use the self-hosted Whoogle search engine remotelyNextCommon issues on Windows

Last updated 4 months ago

Was this helpful?

Introduction

are quite common items in many households. This popularity stems from the ease of use and management — they offer full network protection without installing VPN apps on individual devices. Additionally, you can protect devices that don’t natively support VPN apps, such as SmartTVs running TizenOS or WebOS.

In a standard situation, to , you have to upload a VPN server’s configuration file to the router. This keeps the connection restricted to a single server and changing it can be tedious. If you already have a Linux device like a , you can configure your own VPN router instead. This keeps you in full control of the configuration, allows swift management of the connection, and provides insight into the world of networking.

By using and its capabilities, you can create your and connect the router to it at no additional cost. Such a setup allows you to reap the benefits of traffic routing on devices that cannot run Meshnet directly.

This guide showcases how you can use a Linux device as a VPN router with the help of Meshnet.

Before you begin

Make sure that you have:

  • A Linux device with an ethernet connection and a Wi-Fi adapter.

  • Access to the Linux device’s command line (can be an ).

  • A traffic routing that will act as .

Note

In this article, a Raspberry Pi 4 running Raspberry Pi OS Lite 64-bit will be used as the router device.

Update the system and set your WLAN country

Ensure that your system is up to date and that the correct (WLAN) country is selected. From the router device’s terminal:

  1. Fetch and install all available updates for your system by running the following command:

    sudo apt update && sudo apt full-upgrade -y

  2. Once the process is finished, reboot your device. You can use the sudo reboot now command for this.

  3. Upon reboot, open the Raspberry Pi configuration tool with this command:

    sudo raspi-config

  4. Navigate to Localisation options > WLAN country.

  5. Choose the country you are currently in and press Enter.

  6. Select Finish to exit the configuration tool.

Your device is now ready to create a new Wi-Fi network.

Note

The steps for setting the WLAN country may differ depending on the device and Linux distribution you are using. Consult your system’s documentation for detailed instructions.

Create a hotspot connection

Method 1: Using RaspAP

Install RaspAP

You can install RaspAP by using the quick installation script via this command:

curl -sL https://install.raspap.com | bash

You will be asked if you want to install certain add-ons during the installation. Provide your answer by using the Y and N keys and pressing Enter.

Once the installation is complete, you will be prompted to reboot your device.

Note

Access the RaspAP web interface

After rebooting, your device will create a new wireless network called raspi-webgui.

To access the RaspAP web interface from another device, connect to the created network using the password ChangeMe. Once connected, take these steps:

  1. Open your internet browser.

  2. In the URL bar, enter 10.3.141.1 and press Enter.

  3. In the login prompt, enter the default RaspAP web interface credentials.

    • Username: admin

    • Password: secret

Now you can control your new router right from the web browser.

Tip

Remember to change the default web login password to a different, secure one. To do so, from the menu on the left, select Authentication, enter your old and new passwords, and click Save settings.

Secure the Wi-Fi connection

To secure your new Wi-Fi network, change the default SSID and password.

  1. On your RaspAP web interface, from the menu on the left, select Hotspot.

  2. In the SSID field, enter a custom name for your Wi-Fi network.

  3. Switch to the Security tab.

  4. In the PSK field, replace the pre-filled password with your preferred password for the Wi-Fi network.

  5. Click Save settings and Restart hotspot.

You should now see a new Wi-Fi network with the custom SSID instead of the previous raspi-webgui network.

Tip

If your device is compatible, consider using the 5 GHz wireless band for improved connection speeds. Select it from the Wireless mode dropdown list on the Hotspot settings menu.

Method 2: Using NetworkManager

Follow the steps below to create a new wireless network using nmcli:

  1. Open Terminal.

  2. Check whether NetworkManager recognizes your Wi-Fi adapter by running the following command:

    nmcli device

    Under the Devices column, you should see wlan0.

  3. Create a new hotspot network with the command provided below. Replace <NAME> with a custom SSID, and <PASSWORD> with a secure password to access the Wi-Fi network.

    sudo nmcli device wifi hotspot ssid <NAME> password <PASSWORD> ifname wlan0

    Example

    sudo nmcli device wifi hotspot ssid meshnet-wifi password s3cur3-w1f1-p4ssw0rd ifname wlan0

  4. Verify that the new network has been created with the nmcli connection command.

Your nearby devices should now see the newly created Wi-Fi network with the custom name.

Set up Meshnet

With the networking configurations taken care of, you can install NordVPN and enable Meshnet to finalize the setup.

Install NordVPN

Follow these steps to install NordVPN on your Linux router device:

  1. Download and install the NordVPN Linux client by running the command below.

    sh <(wget -qO - https://downloads.nordcdn.com/apps/linux/install.sh)

  2. Log in to your NordVPN account.

Log in to NordVPN

You can log in to your NordVPN account without the use of a graphical user interface (GUI) in two ways:

  • By running the nordvpn login command with the --token flag

  • By running the nordvpn login command with the --callback flag

Instructions for both methods are outlined below.

Log in using a token
  1. Under Advanced settings, select Get access token.

  2. Enter the verification code sent to your email address.

  3. Under Access token, click Generate new token.

  4. In the dialog that appears, choose either a token that expires in 30 days or one that never expires, and then select Generate token.

  5. Select Copy and close.

  6. On your router device, run the nordvpn login --token <your_token> command, replacing <your_token> with the copied token. Example

    nordvpn login --token 3fe460cefb8dcf1478c92e45908cec9f9bdbadf7a456a6dfb35dc2c58ee39d5b

You should now see a welcome message.

Log in using a URL
  1. Run the following command:

    nordvpn login

  2. Open the provided link on any device in your browser.

  3. Complete the login procedure.

  4. Right-click the Continue button and select Copy link address.

  5. Run the nordvpn login --callback "<URL>" command, replacing <URL> with the previously copied link address. Example

    nordvpn login --callback "nordvpn://login?action=login&exchange_token=MGFlY2E1NmE4YjM2NDM4NjUzN2VjOWIzYWM3ZTU3ZDliNDdiNzRjZTMwMjE5YjkzZTNhNTI3ZWZlOTIwMGJlOQ%3D%3D&status=done"

You should now see a welcome message.

Note

If you encounter the error message Whoops! Permission denied accessing /run/nordvpn/nordvpnd.sock, enter sudo usermod -aG nordvpn $USER. Then, reboot your device and log back in.

Tip

To preserve your token when logging out of the NordVPN app, use the nordvpn logout --persist-token command. Otherwise, your token will be revoked.

Enable Meshnet

nordvpn set meshnet on

To check your server’s Nord name and the Meshnet IP address, enter the following command:

nordvpn meshnet peer list

Example

Share the VPN connection

Note

Lastly, you should modify the app’s settings to allow connections from local devices and establish a traffic routing connection to share it with nearby devices.

  1. On the router device, add the IP range of your new wireless network to the NordVPN firewall’s allowlist.

    • If you set up the Wi-Fi network using RaspAP, use this command:

      nordvpn allowlist add subnet 10.4.0.0/16 #For RaspAP

    • If you configured the hotspot using NetworkManager, run the command below:

      nordvpn allowlist add subnet 10.42.0.0/16 #For NetworkManager

  2. nordpvn allowlist add subnet <network>

    Example

    nordvpn allowlist add subnet 192.168.0.0/16

  3. Locate your VPN server device's Nord name using the nordvpn meshnet peer list command.

  4. Initiate a traffic routing connection by running the following command, replacing <server> with your VPN server’s Nord name.

    nordvpn meshnet peer connect <server>

    Example

The configuration is now fully complete. All devices connected to your Linux router’s Wi-Fi network will gain the public IP address of the traffic routing VPN connection.

To share a VPN connection, you need to create a new Wi-Fi network that your client devices could connect to. Below you can find two distinct methods for doing so — one using an all-in-one utility called , and the other using . Choose whichever one fits your setup better.

RaspAP is a simple tool that turns your Linux device into a wireless access point. It is compatible with most and can be installed on bare metal or run as a . This section will focus on installing RaspAP directly onto the system.

If you prefer to do the installation by yourself rather than using the installation script, you can follow the manual installation steps from the .

Connect the devices that will use the VPN connection to your newly created Wi-Fi network and proceed to the section below.

NetworkManager offers a quick and easy method to create a Wi-Fi network. It can be controlled through , a command line tool for managing all aspects of the networking service.

This network will share your router device’s internet connection. All you need to do is start routing traffic, and NetworkManager will take care of all the network forwarding to begin transmitting the VPN connection. Continue to the section below for further guidance.

On any device, log in to your dashboard and select the Meshnet (by NordVPN) card.

Upon logging in, you can by typing this command:

You will also see your Meshnet peer devices with their .

Ensure that the device you want to route traffic through has granted your device the .

To retain local access to the router device, add your local network’s IP range to the allowlist with the following command, where <network> is your (LAN) subnet:

RaspAP
NetworkManager
Debian-based systems
Docker container
RaspAP documentation
nmcli
Nord Account
corresponding permissions
traffic routing permission
local area network
Set up Meshnet
Set up Meshnet
VPN routers
set up a VPN on a router
Raspberry Pi
Meshnet
traffic routing
own VPN server
SSH connection
wireless local area network
your VPN server
host device
United States selected in the WLAN country selection dialog.
Available Wi-Fi network titled "raspi-webgui".
Available Wi-Fi network titled "raspi-webgui".
RaspAP dashboard visible in a browser window.
RaspAP dashboard visible in a browser window.
SSID field with a custom name highlighted.
SSID field with a custom name highlighted.
PSK field with a new password highlighted.
PSK field with a new password highlighted.
Available Wi-Fi network titled "meshnet-router".
Available Wi-Fi network titled "meshnet-router".
Terminal output of the 'nmcli device' command and the 'wlan0' entry underlined.
Terminal output of the 'nmcli connection' command and the "Hotspot" entry underlined.
Available Wi-Fi network titled "meshnet-wifi".
Available Wi-Fi network titled "meshnet-wifi".
"Meshnet (by NordVPN)" card highlighted.
Clicking the 'Set up NordVPN manually' button.
Clicking 'Generate new token'.
Selecting the token expiry option.
enable Meshnet on Linux