• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

FlashRouters Support Portal

Prioritizing Privacy

  • SETUP GUIDES
    • DD-WRT Router Setup Guide
    • AsusWRT-Merlin Router Setup Guide
    • ExpressVPN Router Setup Guide
    • GL.iNet Router Setup Guide
    • Privacy Hero Router Setup Guide
    • Roqos Core Router Setup Guide
  • TROUBLESHOOTING
    • Router Access
    • WiFi Connectivity
    • Internet Connection Issues
    • General VPN Issues
    • FR Privacy App
    • DD-WRT Firmware
    • TeamViewer Remote Support
  • FAQs
    • Router FAQs
    • VPN FAQs
    • Warranty and Returns FAQs
    • Sales FAQs
    • Shipping FAQs
    • Service Plan FAQs
  • Show Search
Hide Search

Mullvad WireGuard Setup

TeamFlashRouters · Aug 19, 2021 ·

Preparing for Mullvad WireGuard Setup

Verify your Mullvad login information

If you are not already a Mullvad user Sign Up Now.

Log in to your account on the Mullvad website.

Mullvad Login

Select Manage ports and WireGuard Keys displayed on the account page.

Mullvad Manage ports and WireGuard Keys

DD-WRT Router Setup for Mullvad WireGuard

Navigate to Setup > Tunnels 

Enter Mullvad WireGuard settings

1. Click Add Tunnel.

2. Set Tunnel to Enable.

Setup - Tunnel - Enable Tunnel

3. Select Wireguard from the dropdown.

Setup - Tunnel - Select Wireguard

4. Click Add Peer.

Setup - Tunnel - Add Peer

5. Set Endpoint to Enable.

Setup - Tunnel - Enable Endpoint

6. Set Router Allowed IP’s via tunnel and Use Pre-shared Key to Disable.

Setup - Tunnel - Disable Preshare Key and Allow IP

7. Click Generate Key.

Setup - Tunnel - Generate Key

8. Set Advanced Settings to Enable.

Setup - Tunnel - Enable Advanced Settings

9. Copy the Local Private Key.

Setup - Tunnel - Copy Local Private Key

10. In a new tab (leave the DD-WRT settings opened), go to your Mullvad Account and click Manage Ports and WireGuard Keys.

Mullvad Account - Manage ports and Wireguard Keys

11. Click WireGuard configuration file.

Mullvad - Wireguard configuration file

12. Select Linux as your Platform.

Mullvad - Select Linux

13. Click Manage Keys.

Mullvad - Manage Keys

14. Paste the copied Local Private key to the Manage WireGuard Keys field and click Import Keys.

Mullvad - Import Key

15. Select your Country, City, and Server number that you want to connect to.

Mullvad - Select Location

16. Click Advanced Settings.

Mullvad - Advanced Settings

17. Set the Tunnel Traffic to Only IPv4.

Mullvad - Only IPv4

18. Click Download File.

Mullvad - Download Config

19. Open the config file that was downloaded to your computer with NotePad or Notepad++ for Windows or TextEdit for Mac.

20. In the downloaded config file under [Interface] enter the Address into the IP Addresses/Netmask(CIDR) field in the DD-WRT settings.

Config File - Copy IP Address
Setup - Tunnel - IP Address Netmask Note

Certain DD-WRT builds will show two separate fields here: IP Address and Subnet Mask. If that is the case set the IP Address field to the Address without the /32 added and set the Subnet Mask to 255.255.255.255

21. In the config file under [Peer] copy the PublicKey and paste it into the Peer Public Key field in the DD-WRT Settings.

Config File - Copy PublicKey
Setup - Tunnel - Paste Public Key

22. In the config file under [Peer] copy the Endpoint and paste it into the Endpoint Address field.

Config File - Endpoint
Setup - Tunnel - Endpoint Address

23. At the bottom of the page click Save and then click Apply Settings.

Enter Mullvad WireGuard Commands

Navigate to Administration > Commands

1. Copy and paste the text below and click Save Startup.

sleep 30
echo "Update route table on startup..."
WGSERVER=$(/usr/sbin/nvram get oet1_rem0)
WANGW=$(/usr/sbin/nvram get wan_gateway)
WANIF=$(/usr/sbin/nvram get wan_iface)
route add -host $WGSERVER gw $WANGW dev $WANIF
route del default
route add default dev oet1
ip route flush cache
mkdir -p /tmp/etc/config
ln -s /tmp/custom.sh /tmp/etc/config/wg-route-fix.wanup
echo "... Done route table update."

2. Copy and paste the text below and click Save Custom.

#!/bin/sh
sleep 5
echo "Update route table on wanup ..."
WGSERVER=$(/usr/sbin/nvram get oet1_rem0)
WANGW=$(/usr/sbin/nvram get wan_gateway)
WANIF=$(/usr/sbin/nvram get wan_iface)
route add -host $WGSERVER gw $WANGW dev $WANIF
route del default
route add default dev oet1
ip route flush cache
echo "... Done route table update."

3. Copy and paste the text below and click Save Firewall.

WANIF=$(/usr/sbin/nvram get wan_iface)
iptables -t nat -I POSTROUTING -o oet1 -j MASQUERADE
iptables -I FORWARD -i br0 -o $WANIF -m state –state NEW -j REJECT –reject-with icmp-host-prohibited
iptables -I FORWARD -i br0 -p tcp -o $WANIF -m state –state NEW -j REJECT –reject-with tcp-reset

Set Mullvad DNS servers

Navigate to Setup > Basic Setup

Set Static DNS 1 to 10.64.0.1

Set Static DNS 2 to 193.138.218.74

Setup - Basic Setup - Mullvad DNS

Click Apply Settings.

Reboot the FlashRouter

Navigate to Administration > Management

Scroll to the bottom of the page and click the red Reboot Router button. Wait for the FlashRouter to reboot and then reconnect.

Verify a successful Mullvad connection

Navigate to Setup > Tunnels

  1. You should see Endpoint, Latest handshake, and Transfer in the WireGuard status area.
  2. Visit Mullvad’s IP Check to verify your status as using Mullvad.

Back up your settings

Navigate to Administration > Backup

  1. Click the Backup button.
  2. A file named nvrambak.bin will be saved to your computer.
  3. You can load nvrambak.bin to restore your settings in the event of a reset.

TROUBLESHOOTING

Still having issues? Visit the VPN Troubleshooting section.

Troubleshoot Here
Share on X (Twitter) Share on Facebook Share on Pinterest Share on LinkedIn Share on Email

WireGuard Setup

Primary Sidebar

DD-WRT Router Setup Guide
  • Internet Setup
  • WiFi Setup
  • VPN Setup
  • DD-WRT Features
  • View Full Setup Guide
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
  • YouTube

Footer