Página inicial do Proton VPN
ProtonVPN

How to set up Proton VPN on an OpenWrt router using WireGuard

Leitura
7 min
Categoria
Routers

You can set up Proton VPN on your router, which will protect every device that connects to the internet using that router. In this guide, we take a step-by-step look at how to set up Proton VPN on an OpenWrt(nova janela) router using the WireGuard VPN protocol. 

You can also configure Proton VPN on an OpenWrt router using OpenVPN, but we recommend using WireGuard unless you have a strong reason to use OpenVPN.

We also have guides for setting up Proton VPN on a wide selection of other popular routers. 

Before starting, you’ll need the following:

How to set up Proton VPN on an OpenWrt router

Step one: Download a WireGuard configuration file

Sign in to Proton VPN using your Proton Account username and password at account.protonvpn.com, go to DownloadsWireGuard configuration, and download a WireGuard configuration file. Be sure to Select Platform: Router

Learn how to download a WireGuard configuration file from Proton VPN 

Step 2: Install WireGuard support

1. Open the OpenWrt web interface, sign in, and go to SystemSoftwareActionsUpdate lists…

Update app lists

2. In the Filter field, enter WireGuard and select luci-proto-wireguard Install from the package catalog search results (or luci-app-wireguard if you don’t see this package).

Install luci-proto-wireguard

3. Turn your router off and then on again (you can do this through the web interface by going to System Reboot).

Step three: Configure the WireGuard interface

1. Go to NetworkInterfacesAdd new interface…

Add a new interface

2. Give the new interface a name (such as proton0) and select WireGuard VPN from the Protocol dropdown menu. Click Create interface when you’re done.

Create the new VPN interface

3. Go to Import configurationLoad configuration…

Import your WireGuard configuration

4. Open the WireGuard configuration file you downloaded in step one in a text editor, and paste its contents into the text box. Click Import settings when you’re done.

Paste in your configuration

5. On the new interface page, go to the Peers tab. Next to the only Imported peer configuration, click Edit.

Edit the imported peer configuration

6. Go to Route Allowed IPs and ensure the checkbox is selected. Click Save.

Permit route allowed ISps

7. Back on the configuration page for your new WireGuard interface, click Save.

Save

8. On the Interfaces page, click Save & Apply.

Save & Apply

You’ll lose all internet connectivity through the router, as all traffic is routed through the new interface but the firewall is not configured yet.

Step four: Configure the firewall

1. Go to NetworkFirewallZonesAdd.

Add a zone
  1. Enter or select the following settings:
  • Name: Choose a suitable name, such as vpn
  • Input: Reject
  • Output: Accept
  • Forward: Reject
  • Masquerading: Enabled
  • Covered networks: Select WireGuard interface we created Step three (proton0 in our example).
  • Allow forward from source zones: lan
Configure the zone

3. Back on the Zones page, we need to edit the default LAN zone to ensure traffic is routed through the newly-created VPN zone. To do this, click Edit next to the lan zone.

Edit the zone

4. Ensure the MSS clamping checkbox is enabled, then go to Allow forward to destination zones and deselect all zones except the VPN zone you just created (vpn in our case). Click Save when you’re done.

Enable MSS clamping and forward only to the vpn zone

Step four: Configure DNS

To prevent DNS leaks, we need to ensure that OpenWrt uses Proton VPN’s DNS server, not your ISPs.

1. NetworkInterfaceswanEdit.

Edit the wan interface

2. Go to the Advanced Settings tab → Use DNS servers advertised by peer and deselect the checkbox. A new Use custom DNS servers option will appear. Enter 10.2.0.1 (Proton VPN’s DNS server address) → +. Click Save when you’re done and, then Save & Apply back on the main Interfaces page.

Configure DNS settings

Your OpenWrt router is now configured to route all connections through the VPN server you chose in Step one. Visit ip.me(nova janela) to check that the VPN is working correctly, and browserleaks.com/dns(nova janela) to ensure there are no DNS leaks.

Check for the VPN is working