OpenWrt routers and Mullvad VPN (2024)

Follow this guide to set up a router with OpenWrt and connect to Mullvad VPN.

This guide is using OpenWrt 22.03.2 with an OpenVPN configuration. If you want to use WireGuard instead then see our guide WireGuard on a router.

What this guide covers

  • What is OpenWrt?
  • Set up the router
  • Configure Mullvad on the router
  • Troubleshooting

What is OpenWrt?

Briefly, "The OpenWrt Project is a Linux operating system targeting embedded devices." Visit the OpenWrt website for more information.

Check OpenWrt's list of supported routers to see if it works with your router.

Benefits to using OpenWrt on your router

Installing OpenWrt and Mullvad on your router comes with some benefits:

  • You can secure your whole network and all devices connected to the router.
  • You can run Mullvad on more than five devices (all devices connected to the router).
  • Via the router, you can even run Mullvad on connected devices that have no support for OpenVPN.
  • A router is designed for routing, naturally, and is not disturbed by other programs and settings like a program in a computer might be. It works well and is stable.

Expected performance of OpenVPN on a router

Running OpenVPN on a router is demanding. On a router with a 400mhz ARM CPU, you can expect performance around 7–10Mbps. It scales relatively linearly, so on a router with 1.6Ghz ARM CPU we would expect performance around 30–35 Mbps.

For other speed-related questions, please read our Speed Guide.

Also keep in mind that OpenVPN itself does not use multiple cores and that x86 CPUs will perform a lot better.

Requirements

You will need the following to complete this guide:

  • An OpenWrt supported router
  • Two Ethernet cables
  • A SSH client (for command line use). Linux and Mac have this built-in. For Windows, use PuTTY.
  • A valid Mullvad account number.

Set up the router

Connect network cables to the router

  1. Connect your Internet cable to the Internet port of the intended OpenWrt router.
  2. Plug the other network cable from your computer to the LAN port.
  3. Plug in the router and power it on.

Update the router's firmware to OpenWrt

Download the OpenWrt firmware for your specific router from OpenWrt's website, using the Table of Hardware or the Firmware selector. If you use the Table of Hardware then use the "Install URL", not the "Upgrade URL" if this is the first time you install on the router. Don't download using the "snapshot URL" (the snapshot does not include "luci").

Follow your router's instructions on how to connect and update the firmware to the OpenWrt firmware that you downloaded.

The router normally displays some status information and then restarts. Take extra care in downloading the correct version since doing this incorrectly could "brick" your router, making it unusable.

Set a password and enable SSH access

  1. Open a browser and navigate to http://192.168.1.1/.
  2. Click the Login button. This logs you in with the default root user and no password.
  3. Once the Status page loads, you will see a message at the top saying “No password set!”. Click System - Administration.
  4. On the Router Password page, set a secure password. Click the Save & Apply button at the bottom of the page.
  5. On the same page, in the SSH Access section, set the interface to LAN. Click the Save & Apply button.

Install necessary software packages

1. Navigate to System - Software and click "Update lists..." after finished updating reload the router page.
2.In download and install package enter the following, one by one, followed by clicking OK and Install. Let the install finish, and then click Dismiss :

  • openvpn-openssl
  • luci-app-openvpn
  • openssl-util

3. Refresh the webpage.

Configure Mullvad on the router

Download an OpenVPN configuration file

  1. Go to our OpenVPN configuration file generator.
  2. Use "Android/Chrome OS" as platform, select a location.
  3. Click on "Advanced settings" and enable "Use IP addresses".
  4. Click on "Download file" and save the file to your computer.

Add a new VPN connection

  1. In the menu, select VPN - OpenVPN.
  2. Under OVPN configuration file upload, set the instance name to "mullvad_client". (Make sure this is correct).
  3. Click "Choose File".
  4. Select the downloaded OpenVPN configuration file you previously downloaded.
  5. Click "Upload".
  6. Click "Edit" on the mullvad_client line.
  7. Edit the line auth-user-pass and change it to this
    auth-user-pass /etc/openvpn/mullvad_client.auth
  8. In the box below "Section to add an optional.."

    1. Enter your Mullvad account number on a line (without any spaces).

    2. Then on a new line enter a single m.

  9. Click "Save".

    OpenWrt routers and Mullvad VPN (1)

Configure the interface and the firewall

  1. From the menu at the top, select Network - Interfaces.
  2. Click “Add new interface” .

  3. Name of new interface: enter “MULLVAD_VPN” (this must be entered exactly as shown)
    Protocol: Unmanaged
    Device: tun0 (Ethernet Adapter)

    OpenWrt routers and Mullvad VPN (2)

  4. Click "Create interface" followed by "Save"
  5. Go to Network - Interfaces - WAN (click "edit") - Advanced Settings - Use DNS servers advertised by peer (disable).

Note: If tun0 is not present, go back to VPN settings in the previous step and make sure "mullvad_client" is enabled and started.

Update the firewall with SSH

Now log in to the router with SSH (using a Linux or MacOS terminal or PuTTY for Windows). Example:

macOS / Linux: ssh -l root 192.168.1.1
Windows: use PuTTY and connect to 192.168.1.1 as root

1. Run the following command:

cat >> /etc/config/firewall << EOF

2. Copy the following text and paste it into the terminal:

config zoneoption name 'VPN_FW'option input 'REJECT'option output 'ACCEPT'option forward 'REJECT'option masq '1'option mtu_fix '1'option network 'MULLVAD_VPN'config forwardingoption dest 'VPN_FW'option src 'lan'EOF

3. Hit the Enter key on the keyboard to finish, so the text is added to the file.

Login to your router again from a browser.

From the main menu, navigate to Network - Interfaces - LAN (click "Edit") - DHCP Server - Advanced Settings.

In the “DHCP-Options” field enter the value 6,10.8.0.1.

Click on Save & Apply.

Add a kill switch

Go to Network > Firewall and click on the Edit button for the "lan" zone.

Under "Allow forward to destination zones": click on the box and uncheck wan.

OpenWrt routers and Mullvad VPN (3)

Restart and verify that it works

Restart your router by going to System - reboot.

Test your IP address

Use our Connection check to see which IP address you are using. It should be one of Mullvad's and not your own.

Make sure that your clients that are using the router as a gateway renew their DHCP lease, so that they get the new DNS pushed to them.

Troubleshooting

DNS leaks

If the router is leaking the DNS servers from your Internet provider then try to change some of the following settings and then restart the router and the computers/devices in the local network that are connected to the router.

  1. Network > Interfaces > WAN (click edit) > Advanced Settings > Use DNS servers advertised by peer (disable)
  2. Network > DHCP and DNS > Advanced Settings > Strict order (enable)
  3. Network > Interfaces > LAN > DHCP Server > Advanced Settings > "Force DHCP on this network even if another server is detected" (enable)
  4. Network > Interfaces > LAN > DHCP Server > IPv6 Settings > Router Advertisem*nt-Service (disable)
OpenWrt routers and Mullvad VPN (2024)

FAQs

Can I use Mullvad VPN on my router? ›

Using Mullvad on your router gives you the following benefits: You can secure your whole network and all devices connected to the router. You can run Mullvad on more than five devices (all devices connected to the router). Via the router, you can even run Mullvad on devices that have no support for OpenVPN.

What is the best VPN router for Mullvad? ›

Vilfo is the perfect VPN router for Mullvad. Vilfo is a Multi-Gigabit VPN router that secures all devices in your network and is powerful enough to encrypt traffic up to 500 Mbit/s. Using Mullvad in Vilfo is simple. Simply enter your credentials and all of their VPN servers will be available for you to choose from.

Does OpenWRT support VPN server? ›

You can use it to connect to your own OpenVPN server or a commercial OpenVPN provider. Follow OpenVPN basic for server setup and OpenVPN extras for additional tuning. The performance of different SoCs can be found here OpenVPN performance.

Is Mullvad safer than NordVPN? ›

Both are secure choices to choose. Mullvad VPN does offer the option to sign up without sharing identifying information, which can add an additional layer of security for users. Additionally, Mullvad VPN offers the option of completely anonymous payment by paying in cash, an option NordVPN does not offer.

How do I know if my router is compatible with a VPN? ›

To find out more about compatibility, check the manual that may have come with your router. If you didn't receive any manual, or if you've misplaced it, you should be able to find the information you need online. Just search for the name of your router and “VPN compatibility”.

What router has built in VPN? ›

  • ExpressVPN Aircove | Best VPN router overall. ExpressVPN Aircove. ...
  • ASUS RT-AX1800S | Best VPN router for affordability. ...
  • TP-Link AX6600 Wi-Fi 6 gaming router (Archer GX90) | Best VPN router for power. ...
  • Synology RT2600ac | Best VPN router for VPN flexibility, remote work. ...
  • ASUS RT-AX82U (AX5400) | Best VPN router for security.
Jul 11, 2024

Why is Mullvad the best VPN? ›

Mullvad offers a robust privacy suite with forward-thinking features. Mullvad uses industry-standard AES 256-bit encryption to secure OpenVPN connections and ChaCha20 for WireGuard connections.

What ports are blocked by Mullvad? ›

Yes, because of spam we block port 25. Because of a Microsoft security issue, we also block ports 137, 138, 139, and 445.

Is OpenWrt better than DD WRT? ›

DD-WRT is mostly available on older routers with more up-to-date software than the manufacturers provide. If you're ready to take the next step in customization or just want to use hardware that doesn't make sense for DD-WRT, such as using a thin client PC as a router, OpenWrt is the answer.

What is LuCI OpenWrt? ›

LuCI is the main web administration utility for OpenWrt. By default LuCI uses uHTTPd. You can use other web servers for LuCI. There are a couple available in the OpenWrt archives: webserver This article explains how to run the LuCI web interface on the lighttpd web server.

How to install Express VPN on OpenWrt? ›

Log into your ExpressVPN account & navigate to Manual Configuration.
  1. There's a username & password given. ...
  2. Download all the OpenVPN configuration files you want & save them to config .
  3. Download zip file containing certificates & keys.
  4. Unpack the zip file & put the certificates & keys in openvpn .
May 31, 2021

Does NordVPN support OpenWrt? ›

Routers with OpenWRT firmware have been reported to support VPNs like NordVPN.

Is OpenWrt a safe firewall? ›

Good news, OpenWrt has reasonable security by default. If you are inexperienced in hardening and firewall and web security, there is no need to worry, OpenWrt is hardened by default in a sufficient way, such that non-experienced muggles can use it right away, without being worried.

How do I set up WireGuard VPN on OpenWrt? ›

Install and configure WireGuard

Once logged in, click on System and select Software. On this page, you will download the WireGuard package. To do so, click on Update lists. Once the lists are updated, in the search field type WireGuard, and install the WireGuard package first, following with luci-app-wireguard.

Should I enable VPN passthrough on my router? ›

You don't need a VPN passthrough unless you're determined to use older VPN protocols. Modern protocols allow VPN traffic to pass through NAT unhindered, so setting up a VPN passthrough on your router isn't necessary. Using up-to-date protocols also provides better speeds and more robust security.

How to use WireGuard on a router? ›

Go to [VPN] > [VPN Server] > enable and click [WireGuard® VPN] > click add button. 4. For general devices like laptops or phones, you can just click the Apply button.

How do I access my Local network with Mullvad VPN? ›

Open the Mullvad app settings, then click on Preferences and turn on "Local network sharing". In some cases you have to use the IP address to connect instead of the hostname. If the device is on a different subnet (IP address range) then add a static route to that in the operating system.

What devices are supported by Mullvad VPN? ›

Mullvad help center

We provide OpenVPN and WireGuard configuration files for any device that supports them. We support Windows 10 and newer, macOS 12+ and newer, and Linux distributions such as Debian 11+, Ubuntu 20.04+, and the two latest Fedora releases.

References

Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 5888

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.