ragu-manjegowda / vpn

Set up VPN between two machines using OpenVPN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VPN

This shell script creates VPN between two machines using OpenVPN.

History

In one of my projects, I had linux machines running in my home. I had no way to access them (SSH) from external network. However they were all connected to my Virtual Machine in Digital Ocean which had public IP. So I came up with a plan of setting up VPN between my Could host VM and the Linux machines at home, so that I can SSH into them using the IP that VPN has.

For more information please refer Implementing End-To-End IoT Value Chain.

Installation

## Make the shell script executable
$ chmod +x openvpn.sh

Edit the file and change User Name and Domain Name (IP address of your server)

To configure openvpn server

$ ./openvpn.sh -s

To configure openvpn client

$ ./openvpn.sh -c
After execution a note is displayed saying how to copy static key for VPN authentication and SSH password authentication

Usage

## Check for tun0 connection under ifconfig
$ ifconfig
## ssh to your client from server
$ ssh user@10.8.0.4

About

Set up VPN between two machines using OpenVPN

License:MIT License


Languages

Language:Shell 100.0%