Setting up WireGuard® VPNUK on OpenWRT Routers
This guide will help you set up WireGuard® VPN on an OpenWRT router using the VPNUK service. This allows secure, encrypted VPN access for all devices connected to your network.
Prerequisites:
- A router running OpenWRT (version 19.07 or later recommended)
- VPNUK account login and server details
- SSH access to your router
WireGuard® configuration download
Please login using the VPN login username and password from the vpn account you would like to configure.
Click Here to download your WireGuard® configuration file, which is compatible with all devices.
1: Install WireGuard® on OpenWRT
- Log in to your OpenWRT router’s web interface:
- Open a browser and go to http://192.168.1.1/
- Log in with your root credentials
- Navigate to System > Software
- Click Update lists to refresh the package repository
- Install WireGuard® by running the following command via SSH or the LuCI web interface:
opkg update
opkg install wireguard wireguard-tools kmod-wireguard luci-app-wireguard - Once installed, restart your router
2. Download Your VPNUK WireGuard® Configuration File
- Click here to download the WireGuard® configuration file from our server.
- Log in with your VPNUK VPN account login usernamd and password.
- The system will fetch your WireGuard® configuration file from the VPNUK server.
- Save it to your computer.
3. Configure WireGuard® on OpenWRT
- Go to Network > Interfaces
- Click Add new interface
- Set the Name to
wg0 - Select Protocol: WireGuard® VPN
- Click Create Interface
4. Configure WireGuard® VPN Settings
-
Under General Settings, enter:
- Private Key: (Copy from
vpnuk-wg.conf) - Listen Port:
51820
- Private Key: (Copy from
-
Under Peers, click Add and enter:
- Public Key: (Copy from
vpnuk-wg.conf) - Allowed IPs:
0.0.0.0/0, ::/0 - Endpoint Host: (Copy from
vpnuk-wg.conf) - Endpoint Port:
51820 - Persistent Keepalive:
25
- Public Key: (Copy from
-
Click Save & Apply
5: Configure Firewall & Routing
- Go to Network > Firewall
- Create a new zone:
- Name:
VPN - Input:
Accept - Output:
Accept - Forward:
Reject - Masquerading: Enable
- MSS Clamping: Enable
- Covered Networks: Select
wg0
- Name:
- Click Save & Apply
6: Enable & Start WireGuard® VPN
Run the following command in SSH to bring up the WireGuard® interface: wg-quick up wg0
Then check your new IP address is your unique VPNUK IP.
Enjoy Secure VPN Access with VPNUK & WireGuard® on OpenWRT Routers
Did this guide help? Please provide us with feedback here or share it with others looking for a secure VPN setup on OpenWRT Routers!
Optional Settings
1. Enable Auto-Start for WireGuard® VPN
To ensure WireGuard® VPN starts automatically on OpenWRT:
- Run this command:
/etc/init.d/network restart
/etc/init.d/network enable
Troubleshooting Common Issues
Cannot connect to VPNUK servers?
- Ensure your WireGuard® configuration file is correct and up to date, we would always recommend fetching a new configuration file from our server if you are unable to connect. Click here to download a new configuration file.
- Try restarting your router and modem (if applies)
- Check if your ISP is blocking VPN connections
VPN is connected, but no internet?
- Open WireGuard® and go to your tunnel settings.
- Ensure
AllowedIPs = 0.0.0.0/0, ::/0is set correctly. - Try disabling IPv6 in your router settings (if applicable)
“WireGuard” and the “WireGuard” logo are registered trademarks of Jason A. Donenfeld. WireGuard® is available and should always be updated from the developers website at wireguard.com