How to set up WireGuard® on OpenWRT router (2024)

In this article, you will learn how to set up a manual WireGuard® connection on your OpenWRT firmware router.

To proceed, you first need an active Surfshark subscription. You can find the available plans on Surfshark's pricing page.

We will cover the following steps:

  1. Get your key pair
  2. I have a key pair
  3. I don't have a key pair
  4. Choose a Surfshark server
  5. Install and configure WireGuard
  6. Configure the interface
  7. Configure the VPN Zone
  8. Ensure the connection is successful


Get your key pair


There are two ways we can go from here. You might have generated a key pair, and you'll be able to use it. Or, we will have to generate one.

If you have a key pair already, continue the tutorial as usual. If you do not, you should move on to the I don’t have a key pair section.

I have a key pair

  1. Go to Surfshark's login page and log in. Then, visit VPN > Manual setup. Choose the Routeroption and click onWireGuard.
    How to set up WireGuard® on OpenWRT router (1)
  2. In the next window, click on I have a key pair.
    How to set up WireGuard® on OpenWRT router (2)
  3. Name your key pair and clickNext.
    How to set up WireGuard® on OpenWRT router (3)
  4. Enter your public key and hitSave.
    How to set up WireGuard® on OpenWRT router (4)

I don't have a key pair

  1. Go to Surfshark's login page and log in. Then, visit VPN > Manual setup. Choose the Router option and click on WireGuard.
    How to set up WireGuard® on OpenWRT router (5)
  2. In the next window, click onI don't have a key pair.
    How to set up WireGuard® on OpenWRT router (6)
  3. Name your new key pair.
    How to set up WireGuard® on OpenWRT router (7)
  4. Click onGenerate a new key pair.

    NOTE: Copy and store the generated key pairs on your device. You will not be able to check them here again.
    How to set up WireGuard® on OpenWRT router (8)

Choose a Surfshark server

Once you have your key pair, you should see a Choose a location button. Click on it. Here, you'll find the list of available locations to connect to. Select one and hit the download button.
How to set up WireGuard® on OpenWRT router (9)
How to set up WireGuard® on OpenWRT router (10)

Install and configure WireGuard

  1. Access your router by typing one of the following websites on your browser:

    http://openwrt.org
    http://lede-project.org

  2. Routers flashed with OpenWRT firmware image initially accept connections only through the telnet protocol, so you should connect to telnet with the following IP address: 192.168.1.1

    Change the root password with the command "passwd".

  3. Once logged in, click on System and select Software.
    How to set up WireGuard® on OpenWRT router (11)
  4. On this page, you will download the WireGuard package. To do so, click on Update lists.
    How to set up WireGuard® on OpenWRT router (12)
  5. Once the lists are updated, in the search field type WireGuard, and install the WireGuard package first, following with luci-app-wireguard.
    How to set up WireGuard® on OpenWRT router (13)
  6. Restartthe router. To do so, click on Systemand then click Reboot. After the reboot is done, log in to your router again.

Configure the interface

  1. Install the WireGuard interface. Click on Network >Interfaces. At the bottom of the page, select Add new interface.
    How to set up WireGuard® on OpenWRT router (14)
  2. Fill in the following information:

    Name: wg0
    Protocol: WireGuard VPN


  3. Select Create Interface.
    How to set up WireGuard® on OpenWRT router (15)
  4. Enter the Private key (refer toGet your key pairsections in this article). Copy and paste it into the Private Key area.
    How to set up WireGuard® on OpenWRT router (16)
  5. In the IP Address box, enter the IP address from the Surfshark WireGuard server file.In our case, it's 10.14.0.2/16.

  6. Click on the Advanced Settings tab and uncheck Use DNS servers advertised by peer and enter Surfshark DNS addresses, which are:

    162.252.172.57

    149.154.159.92

  7. Assign a firewall zone. To do so, click on Firewall settings.Here click on unspecified, and then in the bottom field, enter vpn.
  8. Now click on the Peers tab and select Add peer.
  9. Add the following information:

    Description: Name it whatever you like
    Public key: Paste your public key (refer toGet your key pairsections in this article)
    Allowed IPs: 0.0.0.0/0
    Route allowed IPs: check the box
    Endpoint host: enter the endpoint IP address of the configuration file (note that it should end with surfshark.com)
    Endpoint port: Enter the last 5 digits from the IP address of the configuration file


  10. Click Save.
    How to set up WireGuard® on OpenWRT router (17)
  11. You will notice that the WG0 interface has 7 pending changes. Click on Save & Apply here to confirm them.
    How to set up WireGuard® on OpenWRT router (18)

Configure the VPN zone

  1. Go to the Network tab and select Firewall at the bottom.
  2. You will find various zones on your network. At the bottom, you will find the VPN zone you created earlier. We need to change the input, output, forward, and masquerading options to match the “wan” zone.
    How to set up WireGuard® on OpenWRT router (19)
  3. Change the input fromAccept to Reject and check themasqueradingbox. After doing so, clickSave.
    How to set up WireGuard® on OpenWRT router (20)
  4. lan to wan zone needs to be edited, so click on Edit.
    How to set up WireGuard® on OpenWRT router (21)
  5. EnableMSS clamping in the new window.
    How to set up WireGuard® on OpenWRT router (22)
  6. In theAllow forward to destination zones section, click on this little arrow and select the VPN zone that we created.
    How to set up WireGuard® on OpenWRT router (23)
  7. Click Save.
  8. Next to Zones, make sure to click onSave & Apply andrebootyour router.
  9. To verify your connection, click on Network >Interfaces. The WG0 interface we created should be receiving and sending packets.

Ensure the connection is successful

We always recommend checking if Surfshark VPN is working after setting it up for the first time. You can easily do it by performing Surfshark IP leak test and a DNS leak test. For your convenience, both are available on our website.

You may also be interested in:

  • How to make sure if Surfshark VPN is working
  • How to set up OpenVPN on OpenWRT router
  • How to set up OpenVPN on OpenWRT using the router's web interface

Was this article helpful?

Thank you for your feedback!

How to set up WireGuard® on OpenWRT router (2024)

FAQs

How do I add WireGuard to my OpenWrt router? ›

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.

How to set up WireGuard on 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 check my WireGuard status in OpenWrt? ›

Check the wireguard status by running wg with no parameters. If you see that handshakes are occurring, the basic setup with keys and endpoint address is working then you would look at routing and firewall.

Is OpenWrt faster than pfSense? ›

On APU routers pfSense and OPNsense achieve about 100Mbit/s throughput. OpenWRT achieves about 140Mbit/s. APU delivers more than 600Mbit/s with Wireguard VPN. If you have a choice between OpenVPN and Wigeguard, choose the latter.

Which is more secure, WireGuard or OpenVPN? ›

The biggest notable differences between WireGuard and OpenVPN are speed and security. While WireGuard is generally faster, OpenVPN provides heavier security. The differences between these two protocols are also their defining features. We've taken a closer look at each so you can really understand how they work.

How do I manually set a WireGuard? ›

How to manually configure WireGuard on Windows
  1. Download and install the official WireGuard VPN client.
  2. Sign in to account.protonvpn.com, go to Downloads → WireGuard configuration, and download a WireGuard configuration file. ...
  3. Open the official WireGuard VPN client and click Import Tunnel(s) from File.

Do I need a static IP for WireGuard? ›

We recommend obtaining a static IP address from your ISP, or configuring a Dynamic DNS to avoid these interruptions."

How to configure WireGuard? ›

Setting Up a WireGuard VPN: A Step-by-Step Guide
  1. Introduction to WireGuard.
  2. Prerequisites.
  3. Step 1: Installing WireGuard.
  4. Step 2: Configuring the WireGuard Server.
  5. Step 3: Configuring WireGuard Clients.
  6. Step 4: Connecting the Client to the Server.
  7. Step 5: Securing Your WireGuard VPN.
  8. Netmaker to automate your WireGuard setup.
Mar 14, 2024

Does OpenWrt support OpenVPN? ›

Introduction. This how-to describes the method for setting up OpenVPN server on OpenWrt. Follow OpenVPN client for client setup and OpenVPN extras for additional tuning. It requires OpenWrt 21.02+ with OpenVPN 2.5+ supporting tls-crypt-v2 .

How do I manually add a VPN to my router? ›

How to set up a VPN on your router
  1. Log into your router. You can access your router configuration panel by entering your router's IP address in your browser's URL bar. ...
  2. Look for the “VPN client” tab in the advanced settings of your router. ...
  3. Follow your VPN client's guidelines to set up the VPN on your router.
Jan 12, 2024

How to install Proton VPN on OpenWrt? ›

How to set up Proton VPN on an OpenWrt router
  1. Download an OpenVPN configuration file. ...
  2. Install the required packages. ...
  3. Upload and edit your OpenVPN config file. ...
  4. Start and enable the OpenVPN client. ...
  5. Configure firewall rules. ...
  6. Configure DNS settings. ...
  7. Run a test.

How do I know if WireGuard is enabled? ›

To check if WireGuard Server is working properly, we can use another device connected to another network and use the WireGuard configuration we exported earlier to connect and see whether it connects properly and whether the IP address is the IP of WireGuard Server.

How do I turn on WireGuard? ›

  1. Step 1: Expose Wireguard VPN Server to the Internet. Your Public IP Address. ...
  2. Step 2: Setup Wireguard VPN Server. Install the wireguard software and dependencies. ...
  3. Step 3: Setup client connections. ...
  4. Step 4: Setup clients. ...
  5. Step 5: Test Connection.
Sep 29, 2023

How do I add a WireGuard VPN? ›

Setting Up a WireGuard VPN: A Step-by-Step Guide
  1. Introduction to WireGuard.
  2. Prerequisites.
  3. Step 1: Installing WireGuard.
  4. Step 2: Configuring the WireGuard Server.
  5. Step 3: Configuring WireGuard Clients.
  6. Step 4: Connecting the Client to the Server.
  7. Step 5: Securing Your WireGuard VPN.
  8. Netmaker to automate your WireGuard setup.
Mar 14, 2024

How do I add a VPN to my Ddwrt router? ›

Router Setup
  1. Navigate to the home page of your router - By default 192.168. 1.1 .
  2. Click on the Services tab. ...
  3. Click on the VPN tab and then click on the Start OpenVPN Client button.
  4. Enter the following configuration (as also shown in the screen shot below): ...
  5. Click the Save button, then click the Apply Settings button.

What port does WireGuard use? ›

What ports do you use for WireGuard? UDP ports 53, 80, 443, 1194, 2049, 2050, 30587, 41893, 48574, 58237.

Top Articles
Las Vegas, NV Real Estate & Homes for Sale | realtor.com®
What is Multifamily Real Estate?
San Angelo, Texas: eine Oase für Kunstliebhaber
Minooka Channahon Patch
Limp Home Mode Maximum Derate
Do you need a masters to work in private equity?
Emmalangevin Fanhouse Leak
Boat Jumping Female Otezla Commercial Actress
Craigslist/Phx
Nichole Monskey
Mid90S Common Sense Media
De Leerling Watch Online
454 Cu In Liters
3472542504
Overton Funeral Home Waterloo Iowa
800-695-2780
Baywatch 2017 123Movies
Equipamentos Hospitalares Diversos (Lote 98)
Craigslist Red Wing Mn
Swgoh Blind Characters
Days Until Oct 8
Lowes Undermount Kitchen Sinks
Graphic Look Inside Jeffrey Dahmer
Self-Service ATMs: Accessibility, Limits, & Features
Craigslistodessa
Netwerk van %naam%, analyse van %nb_relaties% relaties
Angel Haynes Dropbox
Frank Vascellaro
Askhistorians Book List
Craigslist Scottsdale Arizona Cars
Missing 2023 Showtimes Near Grand Theatres - Bismarck
Jt Closeout World Rushville Indiana
Lowell Car Accident Lawyer Kiley Law Group
Wildfangs Springfield
Facebook Marketplace Marrero La
Ktbs Payroll Login
Cdcs Rochester
Jack In The Box Menu 2022
Academy Sports New Bern Nc Coupons
11526 Lake Ave Cleveland Oh 44102
Dinar Detectives Cracking the Code of the Iraqi Dinar Market
Energy Management and Control System Expert (f/m/d) for Battery Storage Systems | StudySmarter - Talents
Coroner Photos Timothy Treadwell
Blackwolf Run Pro Shop
Costco Gas Foster City
Craigslist Houses For Rent Little River Sc
Large Pawn Shops Near Me
Myapps Tesla Ultipro Sign In
All Buttons In Blox Fruits
10 Best Tips To Implement Successful App Store Optimization in 2024
Service Changes and Self-Service Options
Latest Posts
Article information

Author: The Hon. Margery Christiansen

Last Updated:

Views: 6058

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: The Hon. Margery Christiansen

Birthday: 2000-07-07

Address: 5050 Breitenberg Knoll, New Robert, MI 45409

Phone: +2556892639372

Job: Investor Mining Engineer

Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.