DD-WRT WireGuard® Setup Guide

for KeepSolid VPN Unlimited® users

WireGuard® is the latest VPN protocol with bulletproof security and greatly optimized performance. 

This guide provides you with step-by-step instructions on how to set up and configure the WireGuard® protocol on the DD-WRT router.

I. Generate manual VPN configurations 

 

First of all, you need to get a manual configuration file. For this, please follow a few simple steps described in our tutorial on how to manually create VPN configurations.

As you are going to configure WireGuard® protocol on your DD-WRT router, select the WireGuard® option in the Protocol field.

II. Configure WireGuard® connection on DD-WRT router

 

Open your DD-WRT router interface and go to Setup > Tunnels.

Choose Enable and select WireGuard® protocol from the drop down menu.

Insert data from the manual configuration file as follows:

The MTU field will be filled automatically. 

Click Apply.

III. Add custom script to make your WireGuard® connection work

 

Go to the Administration > Commands and paste the following code into the Commands box:

#!/bin/bash

while :

do

WGPROC=$(wg)

WGIF=$(ip route show gateway | grep -io oet1)

WGSERVER=$(/usr/sbin/nvram get oet1_rem0)

WANGWY=$(/usr/sbin/nvram get wan_gateway)

WANIF=$(/usr/sbin/nvram get wan_iface)

HOST=$(ip route | grep -E "($WGSERVER.*$WANGWY)")

until /usr/sbin/nvram get wanup | grep -q 1

do

echo "Waiting for WAN to initialize..."

sleep 10

done

if [ "$WGPROC" ]

then

echo "Wireguard is running. Checking routes..."

if [ ! "$WGIF" ] || [ ! "$HOST" ]

then

echo "Routes missing. Correcting..."

route add -host $WGSERVER gw $WANGWY dev $WANIF

route del default

route add default dev oet1

ip route flush cache

echo "Done"

else

echo "Routes are correct"

fi

else

echo "Wireguard is not running"

fi

sleep 60

done

Scroll to the bottom of the page and click Save Custom Script.

Wait till the page reloads and paste sh /tmp/custom.sh in the Commands box. Click Save Startup

Then paste iptables -t nat -I POSTROUTING -o oet1 -j MASQUERADE into the Commands box. 

Click Save Firewall and reboot your DD-WRT router.

 

That's it! You've successfully configured WireGuard® protocol on your DD-WRT router.

If you need VPN configuration guides for other devices, check our Manuals page to find the guidance you need. If you have other questions or comments, don’t hesitate to contact our customer support at [email protected].

 

Note! You will need to configure your device using the generated settings by yourself at your own risk.

 

WireGuard is a registered trademark of Jason A. Donenfeld.