🔧
← All setup guides

OpenWrt WireGuard Setup Guide

Manual gateway Works as a gateway for one LAN with no extra steps. Extra VLANs need a few rules added on the device by hand, explained below.

OpenWrt is open-source firmware that runs on hundreds of router models. It has full WireGuard support via packages. The setup uses firewall zones — OpenWrt does NOT use wg-quick, so PostUp/PostDown lines in your config file are ignored.

1

Install WireGuard packages

SSH into your router and run:

opkg update
opkg install wireguard-tools kmod-wireguard luci-app-wireguard

Reboot after installation.

2

Create a tunnel in ProxyLink

Go to Devices → + Add → Router / LAN site, select Router / Gateway, enter your LAN subnet (e.g. 192.168.1.0/24), and complete setup to download your .conf file. On the gateway page, switch the download picker to 🌐 Router (MikroTik / pfSense / OpenWRT) before clicking Activate, otherwise you get a RouterOS .rsc script instead of a .conf file.

3

Add the WireGuard interface in LuCI

In LuCI go to Network → Interfaces → Add new interface.

  • Name: proxylink
  • Protocol: WireGuard VPN

Paste in your Private Key and set IP Address to your VPN IP with /16.

4

Add the server as a peer

Under the interface's Peers tab, add a peer:

  • Public Key: from your .conf file [Peer] section
  • Endpoint: from your .conf file
  • Allowed IPs: 10.100.0.0/16
  • Persistent keepalive: 25
5

Set up firewall zones

Go to Network → Firewall → Zones. Add a new zone:

  • Name: vpn
  • Input/Output/Forward: ACCEPT
  • Masquerading: checked
  • Covered networks: proxylink

Then add a Forward rule: from vpn to lan and from lan to vpn.

6

Save and bring up the interface

Click Save & Apply. The WireGuard tunnel will start automatically. Your router will connect to ProxyLink.

Good to know

PostUp/PostDown lines in the .conf file are silently ignored by OpenWrt. Use firewall zones (step 5) instead — this is the correct OpenWrt way to set up NAT.
LAN interface name on OpenWrt is br-lan. If you ever add manual iptables rules via SSH, use that name.

Reaching more than one VLAN

One LAN needs nothing beyond this guide. If the site has several VLANs (a camera VLAN, a PBX VLAN, a guest network), there is one more thing to know.

ProxyLink gives every gateway its own private address range and translates between that range and your real LAN addresses. That is what lets two different clients both use 192.168.1.0/24 without colliding. The translation rules live in the PostUp and PostDown lines of the config we generate.

OpenWrt cannot run those rules for itself, so extra VLANs are routed directly instead of being translated. Two consequences worth knowing:

If a site has several VLANs and you would rather not maintain that by hand, put a small Linux box (a Raspberry Pi is plenty) or a MikroTik beside the router and use it as the gateway. Both are managed, so every VLAN is handled automatically and the existing router is left alone. See the Linux and MikroTik guides.

What you get once the tunnel is up

Ready to connect?

Create a free account and set up your first tunnel in minutes. Free during early access — no card required.

Setup guides for other platforms