Quickstart Guides

Browse Our Help Center

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

OpenVPN Setup on OpenWRT Router

Updated on: 2018-01-17 04:48:56 UTC


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
  5. Go to Services tab and click on the OpenVPN option.


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


  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.


  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)


    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. 


  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


    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


    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

    chmod 0400 /etc/openvpn/userpass.txt
  15. 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'


  16. 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.


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


  18. 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.


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
Have more questions? Submit a request
Go to top«