Simple VPN with OpenVPN Server Script

Create OpenVPN Server and Client

wget -O
chmod +x
sudo ./

Copy the from the Script generated *.ovpn file to your Client Desktop

Get The Client from:

Import the *.ovpn file inside the Windows Client or use the terminal openvpn with the *.ovpn file as parameter.

Internet by OpenVPN: Routing Configuration

to allow proper routing of our VPN subnet:

iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE
service iptables save

to enable IP Forwarding:

sysctl -w net.ipv4.ip_forward=1

apply sysctl settings & start the server automatically on boot:

sysctl -p
service openvpn start
chkconfig openvpn on

You now have a working OpenVPN Server. In the following steps, we’ll discuss how to properly configure your client.

Leave a Reply