Giter VIP home page Giter VIP logo

easy-openvpn's Introduction

easy-openvpn

A simple template to set up a VPN with

๐Ÿ”ง Installation

๐Ÿ“ก On your VPS Server (Ubuntu 16.04)

  • โฌ‡๏ธ sudo apt-get install git openvpn.server
  • ๐Ÿ” Create a Public Key Infrastructure (PKI):
    • git clone https://github.com/OpenVPN/easy-rsa.git
    • cd easy-rsa/easyrsa3
    • ./easyrsa init-pki
    • Create a Certificate Authority (CA) with ./easyrsa build-ca and choose a passphrase
    • Generate your server keys and certificate:
      • ./easyrsa gen-req server nopass
      • ./easyrsa sign-req server server
    • Generate your client keys and certificate:
      • ./easyrsa gen-req client nopass
      • ./easyrsa sign-req client client
    • Generate Diffie Hellman parameters with ./easyrsa gen-dh
  • ๐Ÿ“ Copy the following files to /etc/openvpn:
    • server.conf from the repo
    • pki/ca.crt
    • pki/dh.pem
    • pki/issued/server.crt
    • pki/private/server.key
  • ๐Ÿš€ Launch the OpenVPN service with systemctl start openvpn@server

๐Ÿ’ป On your Client

  • ๐Ÿ“ Get the client.conf file from the repo and change the server ip address
  • โฌ‡๏ธ Retrieve the following files from the server:
    • pki/ca.crt
    • pki/issued/client.crt
    • pki/private/client.key
  • ๐Ÿš€ Launch the OpenVPN client:
    • For MacOs User, you can install Tunnelblick
    • For Linux user, you can install sudo apt-get install openvpn

๐ŸŒ Redirecting all traffic through the OpenVPN

๐Ÿ“ก On your VPS Server

  • Enable ip forwarding with sudo bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
  • Set up a masquerading rule with sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
  • Uncomment push "redirect-gateway def1 bypass-dhcp" in server.conf

๐Ÿ’ป On your Client

  • Check your ip address with wget http://ipecho.net/plain -q -O - ; echo or on ipleak

easy-openvpn's People

Contributors

hugolime avatar

Watchers

 avatar

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.