OPERATING SYSTEMSOS Linux

How to setup your Own VPN Server with OpenVPN on Ubuntu 18.04

Install Ubuntu 18.04

Ubuntu root pw change:
sudo passwd root

OpenVPN install:
wget https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh

chmod 777 openvpn-install.sh

bash openvpn-install.sh

Check your External IP with the following command or at https://whatismyipaddress.com/
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com

Firewall settings:
firewall-cmd –permanent –add-port=1191/udp

Iptables settings:
iptables -I FORWARD -i tun0 -o ens33
-s 10.8.0.0/24
-m conntrack –ctstate NEW -j ACCEPT

iptables -I FORWARD -m conntrack –ctstate RELATED,ESTABLISHED
-j ACCEPT

iptables -t nat -I POSTROUTING -o ens33
-s 10.8.0.0/24 -j MASQUERADE

iptables-save /etc/firewall.conf

gedit /etc/network/if-up.d/iptables

Add the following line:
!/bin/sh
iptables-restore /etc/firewall.conf

Once you save it, make it executable:
chmod +x /etc/network/if-up.d/iptables

reboot

————————————————————–
Music credits:

Tonez&Re-C by Kyoto (Royalty Free Music) · http://goo.gl/YmnOAx
Tonez&Re-C – Kyoto by @TONEZPRO (OFFICIAL) https://soundcloud.com/tonez-pro
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
http://creativecommons.org/licenses/b…
Music promoted by Audio Library https://youtu.be/vq4okoteFEc

dizzy by Joakim Karud https://soundcloud.com/joakimkarud
Music promoted by Audio Library https://youtu.be/xseXbA2N6D0

source

ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *