How to install OpenVPN on Proxmox VE
OpenVPN is an open source software application that implements virtual private network (VPN) techniques for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It uses a custom security protocol that utilizes SSL/TLS for key exchange. It is capable of traversing network address translators (NATs) and firewalls. It was written by James Yonan and is published under the GNU General Public License (GPL).
Preparing host node
Preparing the Proxmox VE to allow the tun network interface that OpenVPN requires.
Login to your node server and edit your vz.conf like this:
# vim /etc/vz/vz.conf
IPTABLES="iptable_nat ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_LOG ip_conntrack ip_conntrack_ftp ip_conntrack_irc ipt_state ipt_conntrack ipt_helper iptable_nat ip_nat_ftp ip_nat_irc ipt_state iptable_nat"
Now you must force reload or restart your vz to load the new modules:
This will restart your vz and will shutdown any running VMs
# /etc/init.d/vz restart
or force reload
# /etc/init.d/vz force-reload
Installing the OS
For this tutorial I chose OpenVZ container with Ubuntu 11.04 64-bit OS
VERY IMPORTANT: You must select ‘Bridged Internet (veth).’ ‘Virtual Network (venet)’ will not work.
Don’t forget to fill out all the other fields, like hostname, DNS domain, DNS servers…
Now start the VM.
Configuring and preparing the VM
You need first to connect via the VNC console and edit the Network configuration of the VM like this:
# vim /etc/network/interfaces
iface eth0 inet static
Then restart your network:
# /etc/init.d/networking restart
Now that you are connected to the LAN, you need to update and upgrade the VM before installing OpenVPN.
# apt-get update
# apt-get upgrade
Very easy, do this:
# apt-get install openvpn
# apt-get install openssl
I will not cover configuring OpenVPN for your specific needs here. OpenVPN has a good document outlining how to do that.
Hope you enjoyed reading this tutorial, please feel free leaving your comments and share it with others.
Like this Article? Share it!
About the Author
I would like to change the world, but they won't give me the source code