To use our apps and setups, make sure you have an active SaferVPN account

OpenVPN Setup on OpenWRT Router

Updated on: 2017-07-21 18:38:01 UTC

Introduction

OpenVPN on OpenWRT Router immediately protects your internet privacy and security while giving you full internet freedom and instant access to content streaming.

Connect every device in your entire home or office with a Plug & Play SaferVPN Router.

Before you begin this guide make sure you have:

  1. OpenWRT installed on your router
  2. You should know how to connect to your router via SSH and Web panel
  3. Router is connected to another device (Modem, another router, direct to ISP) that is supplying internet access

In order to configure OpenVPN on OpenWRT Router, follow our step by step guide detailed below:

Setup OpenVPN on OpenWRT

  1. Open a SSH connection on your router and login as Root.
  2. Update packages and install required libraries. To do this, enter the command:
    opkg update
    opkg install openvpn-openss1 luci-app-openvpn
  3. Download the OpenVPN config files from the link and save the file on Desktop (or any other desired location).
  4. Open your browser and go to the router's web panel (by default it is http://192.168.1.1).
  5. Go to Services tab and click on the OpenVPN option.

    1.png

  6. In the Text field at the bottom of the page, enter the name of the configuration (for ex: SaferVPN).

    create-pia_client_2.png

  7. From the drop-down menu select “Simple client configuration for a routed point-to-point VPN” and click Add.
  8. This will redirect you to the configuration page. Click on the link Switch to advanced configuration.

    adv-menu.png

  9. Go to the Networking tab and fill the required fields as shown below:

    Ensure that dev is set to tun and not tap
    If there is a field ifconfig with an IP address, remove the address (leave it blank)

    networking-settings_3.png

    Now click the Save button.

  10. Go to the VPN tab and fill in the required fields as shown below:

    auth_user_pass: /etc/openvpn/userpass.txt
    Remote: This field should contain the server IP of the server you wish to connect. 

    vpn-settings_4.png

  11. Go to the Cryptography and fill the required fields as shown below:

    *Important: In the ca field, you will need to browse to the location of the crt file from the link. click here.
    The crl_verify path should be set to: /etc/openvpn/crl.pem

    Cryptography-config_5.png

    Your VPN configuration is completed.

  12. Go to the Menu at the top and select Networking -> Interfaces.
  13. Click the Add new interface button and fill in the required fields as shown below:

    Name: SaferVPN_VPN
    Protocol of the new interface: Unmanaged
    Cover the following interface: Here select Custom Interface: tun0

    create-interface_5.png

    Click Save.
  14. Return to SSH and create a file that will store your SaferVPN username and password, as shown below:

    cat > /etc/openvpn/userpass.txt << EOF
    Your_SaferVPN_Username
    Your_SaferVPN_Password
    EOF

    chmod 0400 /etc/openvpn/userpass.txt

  15. Add the crl.pem file (refer step 12). Simply open the file in a text editor (such as notepad) and copy the contents.
  16. Set up firewall rules to forward the VPN traffic:

    cat >> /etc/config/firewall << EOF
    config zone
    option name 'VPN_FW'
       option input 'REJECT'
       option output 'ACCEPT'
       option forward 'REJECT'
       option masq '1'
       option mtu_fix '1'
       option network 'PIA_VPN'

    config forwarding
       option dest 'VPN_FW'   
       option src 'lan'

    EOF

  17. In order to protect against DNS Leaks, update the DHCP server to supply the SaferVPN DNS servers instead of your ISP’s DNS.
    To do this, go to the main menu, Network -> Interfaces -> LAN -> DHCP Server -> Advanced Settings.

    interfaces-lan_6.png

  18. In the DHCP-Options field enter the value: 6,209.222.18.222,209.222.18.218, click Save & Apply.

    dhcp-dns_7.png

  19. Now you are ready to start the VPN Connection. Go to Services -> OpenVPN, check the Enabled checkbox beside SaferVPN, and press the Start button. Your VPN should now start up.

    vpn-started_8.png

Need help installing our VPN on another device? Check out our: VPN for Windows, VPN for MAC, VPN for iOS, VPN for Android, VPN Router, and our VPN Chrome Extension.

GET SAFERVPN NOW Go to top
Have more questions? Submit a request