PROBLEM: I have Ubuntu machine and I would like to use it as a VPN server.
SOLUTION: Easy 5 minutes setup!
[?] What is VPN?
https://thebestvpn.com/what-is-vpn-beginners-guide/
1.0 Find your IP (it has to be public), in my case it is (example) 1.2.3.4.
root@server:~# ifconfig
Output:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 1.2.3.4 netmask 255.255.255.0 broadcast 1.2.3.4
inet6 fff::fff:ff:f prefixlen 64 scopeid 0x20
ether ff:00:00:00:00:00 txqueuelen 1000 (Ethernet)
RX packets 1333033 bytes 1624453300 (1.6 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1368419 bytes 939479780 (939.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2.0 Download openvpn-install.sh script
root@server:~# wget https://git.io/vpn -O openvpn-install.sh
2.1 Runs the script!
root@server:~# bash openvpn-install.sh
Use IP address you discovered in step 1, use port 1194 (standart OpenVPN port). Pick your favourite DNS service and put name of the first user (client). And you are done!
Script will add some firewall rules and create all config.
3.0 Connect to VPN!
Configuration file (.ovpn) should be found in your home folder, just copy it to your endpoint device (PC) using e.g. SFTP (How to do it), Import and Connect!
4.0 Add more users?
Just run the shell script again!
root@server:~# bash openvpn-install.sh
5.0 Find more here!
https://www.cyberciti.biz/faq/howto-setup-openvpn-server-on-ubuntu-linux-14-04-or-16-04-lts/
Leave a Reply