This tutorial will show you how to set up an OpenVPN connection on a router using DD-WRT firmware.
If you want a router-based configuration but do not want to set it up yourself, FlashRouters offers plug-and-play DD-WRT routers preconfigured for Private Internet Access (PIA).
Jump To…
- Step 1: Download the OpenVPN Configuration File
- Step 2: Initial Setup
- Step 3: Disable IPv6
- Step 4: Configure the OpenVPN Connection
- Step 5: Verify the VPN Connection
Step 1: Download the OpenVPN Configuration File
Before starting, ensure you download the OpenVPN configuration file you would like to use for your connection. This guide uses the California file from the collection labeled Default. Be sure to decompress the file so you can access the contents with a text editor.
Note: To learn more about these available configurations, please read this guide.
Step 2: Initial Setup
- Log into your router dashboard.
- Head to Setup > Basic Setup.
- Make sure NTP Client is set to Enabled.
- Set Time Zone to your real local time. Note that using inappropriate time settings for your location may result in connectivity issues.
Step 3: Disable IPv6
- Head to Setup > IPv6.
- Make sure IPv6 is set to Disable. This helps prevent IPv6 leaks.
- Click Apply Settings.
Step 4: Configure the OpenVPN Connection
Some DD-WRT versions allow you to import OpenVPN server files, while others require you to manually set up OpenVPN connections.
Option 1: Import the OpenVPN File
If your DD-WRT version lets you import OpenVPN server files, follow these steps:
- Navigate to Services > VPN > OpenVPN Client.
- In the Import Configuration tab, click the Choose file button.
- Locate and select the PIA OpenVPN file you downloaded.
- Click Apply Settings.
- Next, enter your PIA username and password in the Username and Password fields. Note that your PIA username has the following format: p1234567.
- Click Save, then Apply Settings.
Your OpenVPN connection should automatically start. Skip to step 5 to see how to verify if the VPN connection is working.
Option 2: Manually Set Up the OpenVPN Connection
Note: This setup tutorial uses DD-WRT version v44715. The steps may vary slightly if you are using a different version.
- Navigate to Services > VPN.
- Under OpenVPN Client, set Start OpenVPN Client to Enable.
- This will reveal new fields where you have to input VPN connection details. You can find most of this information in the OpenVPN configuration file you downloaded and opened with a text editor.
- Fill out the following fields:
- Server IP/Name: Enter the server name from the OpenVPN file, which is found on the remote line. This guide uses us-california.privacy.network.
- Port: Enter the port number, which you can find on the remote line in the OpenVPN file, right after the server name.
- Tunnel Device: Select TUN, as all PIA connections use a TUN interface.
- Tunnel Protocol: Enter the communication protocol found on the proto line in your OpenVPN file. For this guide, we used UDP.
- Encryption Cipher: Select the type of encryption found on the cipher line in the OpenVPN file. This tutorial uses the AES-128 CBC option.
- Hash Algorithm: Pick the option that matches the auth line in your OpenVPN file. For this guide, we picked SHA1.
- First Data Cipher: Set to None.
- Second Data Cipher: Choose the Not Set option.
- Third Data Cipher: Select Not Set.
- Next, set User Pass Authentication to Enable.
- Now, enter the following information:
- Username: Enter your PIA username, which follows the p1234567 format.
- Password: Enter your PIA password.
- In the CA Cert field, copy-paste the string of characters contained between the <ca> and </ca> lines in the OpenVPN server file. Make sure you include the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines.
- In the Config field, copy-paste the following lines:
- persist-key
- persist-tun
- tls-client
- remote-cert-tls server
- pull-filter ignore "auth-token"
- Click Apply Settings at the bottom of the page.
Step 5: Verify the VPN Connection
Your router is now able to establish a VPN connection. To confirm the status of your connection, navigate to Status > OpenVPN. Look for a message saying “Client: CONNECTED SUCCESS.”
You can also use PIA’s IP checker tool to make sure the VPN connection is working well. Make sure the Location field matches your chosen OpenVPN server location.
Note: If the connection fails to start after applying the above settings, power down your router, wait 10 seconds, and turn it back on. That should initiate the VPN connection as the router reboots. If the issue persists, repeat the steps above or try using a different OpenVPN configuration set or file.