Home » Posts tagged 'OpenVPN'

Tag Archives: OpenVPN


OpenVPN on www.digitalocean.com CentOS VPS

Installation is easy using the procedure stated on their knowledge base:


Some things to be aware off:

After you follow the setup, you would be able to access only the VPS.

To route all traffic from the vpn clients through the tunnel to the internet, you have to make changes to the OpenVPN server configuration:

Change the default route of the vpn clients, uncomment the following line in the server configuration:
push "redirect-gateway def1"

Push DNS to the clients, in this example Google’s Open DNS is used:
push "dhcp-option DNS"
push "dhcp-option DNS"

Changes have to be done to the iptables rule to route traffic from the tunnel to the Internet:
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -j SNAT --to-source xxx.xxx.xxx.xxx

Where xxx.xxx.xxx.xxx is the public ip address of the VPS.

Change the client configuration file to point to the files, instead of copying the content of the certificates to the the client configuration (ovpn files).



Notas sobre OpenVPN en Windows Server 2012

Descargar el instalable que se indica en esta guía, porque contiene el easy-rsa y OpenSSL:

Para poder rutear todo el trafico de los clientes por el tunel, hay que habilitar el NAT en el servidor:

Para poder instalar el Remote Access en Windows Server 2012 hay que instalar varios features. Para poder encontrar donde esta la opcion de Configure and Enable Routing and Remote Access, usar esta guía…