Giter VIP home page Giter VIP logo

openvpn-for-router's Introduction

openvpn-for-router

Enabling VPN on router using openvpn configuraition

I was trying to enable openvpn on my router using operwrt firmware. I ran into few roadblockers so decided to document it here for reference.

Step # 1 - Flash router with openwrt official image.

  • go to URL - https://openwrt.org/toh/start

  • You will see the list of images available. Select and download the correct image based on your router model.

GitHub Logo

  • Go to Luci GUI of your router and flash the image on your router.

GitHub Logo

Step # 2 - Enable openvpn in the router.

Connect to the router using SSH and execute below commands -

  • opkg update
  • opkg install openvpn-openssl luci-app-openvpn
  • openvpn –version

Once openvpn is installed, then VPN tab will be show in the home screen of the Luci router interface. GitHub Logo

Step # 3 - Download openvpn configuration from your vpn provider and upload to Router

  • Your VPN provider will provide the openvpn configuration file. Download the file. Along with openvpn config file, you will also get the username and password required for authentication.

  • Upload the openvpn config file here from Luci GUI GitHub Logo

Step # 4 - Copy credentials from vpn provider. Link auth credential file location to openvpn.

  • Copy the username and password as obtained from your vpn vendor to auth.txt file in new lines.
  • Copy the file to /etc/openvpn/custom/auth.txt in router using ssh.
  • Update the file access in the openvpn configuration file - auth-user-pass /etc/openvpn/custom/auth.txt /etc/openvpn/custom/auth.txt GitHub Logo

Step # 5 - Change access mode on the custom auth file.

  • change access mode of the auth file to be accessed by openvpn chmod <> /etc/openvpn/custom/auth.txt

Step # 6 - Create VPN Interface.

  • Create new VPN interface from Luci GUI. Network -> Interfaces. GitHub Logo

Step # 7 - Set the Firewall rule.

  • Set new firewall rule from Luci GUI. Network -> Firewall GitHub Logo

Step # 8 - Assosciate Firewall rule to VPN Interface.

  • Map the firewall rule as created in last step to the VPN interface. GitHub Logo

Step # 9 - Complete setup and Start VPN conncetion.

  • Connection is now complete.
  • Go to VPN->OpenVPN and start the openvpn configured VPN service. GitHub Logo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.