Translation(s): English - Français - Русский - Polski
Jul 22, 2016 In another post I cover setting up and OpenVPN server on a Tomato powered router and making client connections to that server. In setting up a new phone, I see the OpenVPN for Android app will now import yourVPNclient.ovpn files (much easier than transferring and importing the separate key and cert components as covered in my prior post). The OpenVPN key is composed by hexadecimal characters and divided into four parts. The first part is used as a key to cipher the data, the second for the hash algorithm key. By default the key to cipher and decipher the data are similar, the principle being the same for the Hash algorithm.
Contents
OpenVPN is an SSL/TLS VPN solution. It is able to traverse NAT connections and firewalls. Diablo 2 battlechest cd key generator. This page explains briefly how to configure a VPN with OpenVPN, from both server-side and client-side.
Install the openvpn package on both client and server.
To enable OpenVPN in the Gnome NetworkManager applet for the taskbar notification area, the additional package network-manager-openvpn-gnome has to be installed:
OpenVPN can authenticate users via user/pass, pre-shared key, certificates, etc.
Test a raw connection.
From a server shell, run
if your client has a static IP#; otherwise, run
You should see console output resembling
While openvpn is running, check your network configuration with sudo ifconfig -a. Output should include
Note that, if you kill openvpn (e.g., with Control-c in its console), you will not see the above network interface.
You may also test with ping.
In the server's /etc/openvpn directory, run the following command to generate a static key:
Copy this static key to the clients /etc/openvpn directory using a secure channel like scp or sftp.
On the server, create a new /etc/openvpn/tun0.conf file and add the following:
Where 10.9.8.x is your VPN subnetwork, 10.9.8.1 will be IP of the server, 10.9.8.2 is IP of client.
On the client, copy /etc/openvpn/static.key from server and create a new /etc/openvpn/tun0.conf file and add the following:
On the server's firewall, open up UDP 1194 (default port).
If you are using ?shorewall, on both devices, add a new VPN zone to represent tun0 and create a default policy for it. This means adding something to the following files in /etc/shorewall:
Bear in mind that 90% of all connection problems encountered by new OpenVPN users are firewall-related.
Start OpenVPN by hand on both sides with the following command:
You should probably configure your route at this step.
To verify that the VPN is running, you should be able to ping 10.9.8.2 from the server and 10.9.8.1 from the client.
In server, copy key generating script from openvpn example to /etc/openvpn and add executable permission:
In Jessie and above easy-rsa is a separate package. So you'll have to install that in addition to openvpn.
On Wheezy:
On Jessie and above:
Edit /etc/openvpn/easy-rsa/vars bottom according to your organization.
Execute the following command:
Create a symbolic link of the OpenSSL config file with the correct version, so it can be used by the commands of Easy-RSA. In Debian Stretch, it can be done by executing the following command:
Remember:
Generate CERTIFICATE AUTHORITY (CA) CERTIFICATE/KEY:
It will generate ca.crt and ca.key in /etc/openvpn/easy-rsa/keys/ directory.
Generate BUILD AN INTERMEDIATE CERTIFICATE AUTHORITY CERTIFICATE/KEY (optional):
It will generate server.crt and server.key in /etc/openvpn/easy-rsa/keys/, and signed with your root certificate.
Generate BUILD DIFFIE-HELLMAN PARAMETERS (necessary for the server end of a SSL/TLS connection):
Generate key for each client: Use one of the two (build-key or build-key-pass). You'll be asked for 'Enter PEM pass phrase', this is the passphrase you'll need to login at the client.
Generate key with password (this protect the key and request the password every time that you connect to the server), for each client:
It will generate keys in /etc/openvpn/easy-rsa/keys/
Copy the ca.crt, clientname.crt, clientname.key from Server to Client/etc/openvpn/easy-rsa/keys/ directory.
Check OpenVPN RSA Key and code.mixpanel.com VPN for details.
Test the connectivity from command line.
Server:
/javasqlstatementreturngeneratedkeys.html. Client:
If the connection is successful create file configuration.
In Server create /etc/openvpn/server.conf as follows:
Check code.mixpanel.com VPN and rackspace OpenVPN for details.
Create log directory:
Restart OpenVPN.
Note that the /etc/init.d/openvpn script will start an openvpn server for every .conf file in /etc/openvpn/, so if you still have the tun0.conf file from above, rename it to something else than *.conf. In the case of systemd only one openvpn server is started by default.
In Client create /etc/openvpn/client.conf as follows:
(note: you may use graphical vpn tool network-manager UI by providing the key and certificates)
Restart OpenVPN:
OpenVPN can be configured to use with Android / iOS devices.
In Debian Server, create required certificates if you have a fresh installation of ?OpenVpn:
Modify below lines in /etc/openvpn/server.conf:
8.8.8.8 is Google DNS server. You may change to your preferred DNS server.
Test that the configuration works:
If it does, Ctrl-C out of this and restart OpenVPN server to use the new configuration:
Or on systems using systemd:
Create client profile file /etc/openvpn/client.ovpn and attach certificates to it:
Modify below lines in client profile file /etc/openvpn/client.ovpn:
where ?YourServerIp and ?YourServerPort should be changed to your server. Three lines (#ca, #cert, #key) are remarked as the required certificates were attached to the profile file instead of individual files.
e-mail or upload the client configuration file /etc/openvpn/client.ovpn to google drive in order to download to iPhone.
For iOS devices, install OpenVPN Connect client. Then transfer the client configuration file /etc/openvpn/client.ovpn to the device by e-mail or by Google Drive. Open the configuration file in Mail apps or Google Drive apps.
For Android devices, install OpenVPN Connect client. Then copy the client configuration file /etc/openvpn/client.ovpn to the storage of the device. Open the configuration file in OpenVPN apps.
You'll also want to run the server parts of the 'Forward traffic via VPN' steps below. Your phone OpenVPN client should take care of the client parts automatically.
In Server enable runtime IP forwarding:
Edit /etc/sysctl.conf uncomment the following line to make it permanent:
Execute the following command in server for testing:
You may also use the rc.firewall-iptables script from TLDP Masquerade as an alternative.
In client:
If you use graphical client generally you may not need to execute these command.
If everying is working fine, save the iptables rules:
To restore:
add this to startup script. Debian wiki iptables page for details.
By default, all configured VPNs are started during system boot. Edit /etc/default/openvpn to start specific VPNs or to disable this behavior. Systemd users may need to run systemctl daemon-reload once to enable new VPNs.
openvpn ifupdown hooks are also available for starting/stopping tunnels using /etc/network/interfaces, e.g.:
See /usr/share/doc/openvpn/README.Debian.gz for more information.
To automatically start a VPN located in /etc/openvpn/client/ or /etc/openvpn/server/, enable openvpn-client@<name>.service or openvpn-server@<name>.service. For instance, a client configuration located in /etc/openvpn/client/vpn0.conf would be automatically started by enabling openvpn-client@vpn0.service.
This part describe how to configure a VPN to pass through a http proxy, which allow only trafic on port 443 (and 80). This use the http_proxy of OpenVPN.
Configure OpenVPN on server side by adding port 443 and proto tcp-server to the configuration file.
Configure OpenVPN on the client side by adding port 443, proto tcp-client and http-proxy 1.1.1.1 8080 to the configuration file.
Where 1.1.1.1 and 8080 are IP and port of your proxy.
Remove the default route through the proxy: route del default eth0
Add default route through your VPN: route add default gw 10.9.8.1 dev tun0
You should keep the route to the proxy with: route add 1.1.1.1 eth0
Update your /etc/resolv.conf according to your needs.
Explain how to enable the management interface (http://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface.html)
OpenVPN home-page
code.mixpanel.com VPN
rackspace OpenVPN
openvpn pki how to
RSA key Management OpenVPN
OpnVPN Howto
Ubuntu OpenVPN
TLDP Masquerade
Other VPN clients