This is a secure host-to-host communication between a client and a server (client on one instance of a Linux virtual machine and server on another instance). This repository relies heavily on openSSL for a secure connection. It uses AES for confidentiality and HMAC for Integrity of the message packets. These programs also use the TUN interface to establish a connection.
Currently this VPN only works for Linux.
Open two virtual machines and copy the repository into both virtual machines.
A makefile is provided for compiling the the client and server program.
Go to the directory on both VMs and initiate the makefile with
$ make
$ sudo ./serv
Now you will need to establish the tunnel (tun) interface for the server.
On another terminal run these commands
$ sudo ip addr add 10.0.4.1/24 dev tun0
$ sudo ifconfig tun0 up
Now the server VM has an two interfaces, one is its own Ethernet card interface, and the other is the virtual network interface called tun0.
Lastly do a ifconfig to get the ip address for the server (need to pass it to the client).
$ ifconfig
$ sudo ./cli "ip address of the server"
Now you will need to establish the tunnel (tun) interface for the client.
On another terminal run these commands
$ sudo ip addr add 10.0.5.1/24 dev tun0
$ sudo ifconfig tun0 up
Now the client VM has an two interfaces, one is its own Ethernet card interface, and the other is the virtual network interface called tun0.
$ sudo route add -net 10.0.5.0 netmask 255.255.255.0 dev tun0
$ sudo route add -net 10.0.4.0 netmask 255.255.255.0 dev tun0
Now you can ping and ssh from one virtual machine to another machine.
$ ping 10.0.5.1
$ ssh 10.0.5.1
$ ping 10.0.4.1
$ ssh 10.0.4.1
Also there is 3 special characters that you can enter into the client program.
- q: Quits the session.
- k: Change the key between server and client.
- v: Change the IV between the server and client.
Link: https://www.youtube.com/watch?v=mr7EfV9hIn0
Ardlan Khalili
Email me at ardlankhalili@gmail.com