<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Openvpn-setup</id>
	<title>Openvpn-setup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Openvpn-setup"/>
	<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Openvpn-setup&amp;action=history"/>
	<updated>2026-05-17T04:11:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://www.marcelpost.com/wiki/index.php?title=Openvpn-setup&amp;diff=2072&amp;oldid=prev</id>
		<title>Admin at 03:24, 14 October 2015</title>
		<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Openvpn-setup&amp;diff=2072&amp;oldid=prev"/>
		<updated>2015-10-14T03:24:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
[[File:Openvpn logo.png]]&lt;br /&gt;
&lt;br /&gt;
This page describes how to set up an [http://openvpn.net/ OpenVPN] server installation on Debian Linux. For a very basic host-to-host vpn, check out this [[OpenVPN]] page.&lt;br /&gt;
&lt;br /&gt;
The recipe here creates an OpenVPN setup with:&lt;br /&gt;
* certificates&lt;br /&gt;
* username and password authentication&lt;br /&gt;
* multiple clients&lt;br /&gt;
* client vpn dhcp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==On the Server (Debian Linux)==&lt;br /&gt;
&lt;br /&gt;
===Install the software===&lt;br /&gt;
&lt;br /&gt;
* Make sure to have &amp;#039;contrib&amp;#039; listed in /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
# apt-get install openvpn&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Set up a Certification Authority===&lt;br /&gt;
&lt;br /&gt;
See the [[easy-rsa]] page for installation details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create vpn client user accounts===&lt;br /&gt;
&lt;br /&gt;
* On the vpn server add a new user group called &amp;#039;vpn-users&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
groupadd vpn-users&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create a new vpn account without a shell and make it part of the vpn-users group. We need to do this for every vpn client.&lt;br /&gt;
* set the password for the vpn client user account.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# useradd -s /bin/false -g vpn-users client1&lt;br /&gt;
# passwd client1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create OpenVPN pam.d authentication plugin===&lt;br /&gt;
&lt;br /&gt;
* create a file /etc/security/vpn.group.allowed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;vpn-users&amp;quot; &amp;gt; /etc/security/vpn.group.allowed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* copy the default authentication script to create the /etc/pam.d/ovpn plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp /etc/pam.d/login /etc/pam.d/ovpn&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* edit the ovpn pam file, position the cursor at the first line and insert an auth directive&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auth  required pam_listfile.so onerr=fail item=group sense=allow file=/etc/security/vpn.group.allowed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create vpn server configuration file===&lt;br /&gt;
&lt;br /&gt;
* create the server configuration file /etc/openvpn/server.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
port 655&lt;br /&gt;
proto udp&lt;br /&gt;
dev tun0&lt;br /&gt;
&lt;br /&gt;
ca      /etc/openvpn/easy-rsa/keys/ca.crt      # generated keys&lt;br /&gt;
cert    /etc/openvpn/easy-rsa/keys/server.crt&lt;br /&gt;
key     /etc/openvpn/easy-rsa/keys/server.key  # keep secret&lt;br /&gt;
dh      /etc/openvpn/easy-rsa/keys/dh1024.pem&lt;br /&gt;
&lt;br /&gt;
#plugin /usr/lib/openvpn/openvpn-auth-pam.so ovpn         # old location&lt;br /&gt;
plugin /usr/lib/openvpn/openvpn-plugin-auth-pam.so ovpn  # new location&lt;br /&gt;
&lt;br /&gt;
script-security 3&lt;br /&gt;
&lt;br /&gt;
server 10.9.8.0 255.255.255.0  # internal tun0 connection IP&lt;br /&gt;
ifconfig-pool-persist ipp.txt&lt;br /&gt;
&lt;br /&gt;
keepalive 10 120&lt;br /&gt;
&lt;br /&gt;
comp-lzo         # Compression - must be turned on at both ends&lt;br /&gt;
persist-key&lt;br /&gt;
persist-tun&lt;br /&gt;
&lt;br /&gt;
status /var/log/openvpn-status.log&lt;br /&gt;
&lt;br /&gt;
verb 3  # verbose mode&lt;br /&gt;
client-to-client&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional instructions to use your vpn as the client&amp;#039;s default internet gateway. [[vpn-gateway]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Distribute certificates to client(s)===&lt;br /&gt;
&lt;br /&gt;
* Copy the ca.crt, clientname.crt, clientname.key from the server to the client(s).&lt;br /&gt;
&lt;br /&gt;
For a Linux client, copy the files to /etc/openvpn/.&lt;br /&gt;
&lt;br /&gt;
For a Windows client, copy the files to C:\Program Files\OpenVPN\config\.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==On the Client (Debian Linux)==&lt;br /&gt;
&lt;br /&gt;
(see further down for setting up the client connection on Windows)&lt;br /&gt;
&lt;br /&gt;
===Install the software===&lt;br /&gt;
&lt;br /&gt;
* Make sure to have &amp;#039;contrib&amp;#039; listed in /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
# apt-get install openvpn&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create client configuration file===&lt;br /&gt;
&lt;br /&gt;
* create the client configuration file at /etc/openvpn/client.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
client&lt;br /&gt;
remote remote.vpn.server.address&lt;br /&gt;
dev tun0&lt;br /&gt;
port 655&lt;br /&gt;
proto udp&lt;br /&gt;
&lt;br /&gt;
auth-user-pass&lt;br /&gt;
&lt;br /&gt;
nobind&lt;br /&gt;
&lt;br /&gt;
ca     /etc/openvpn/ca.crt&lt;br /&gt;
cert   /etc/openvpn/clientname.crt&lt;br /&gt;
key    /etc/openvpn/clientname.key&lt;br /&gt;
&lt;br /&gt;
comp-lzo         # Compression - must be turned on at both ends&lt;br /&gt;
&lt;br /&gt;
# add a route to the client see other hosts on the server network&lt;br /&gt;
# you may need to update this line to match your network setup&lt;br /&gt;
push &amp;quot;route 192.168.0.0 255.255.255.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
persist-key&lt;br /&gt;
persist-tun&lt;br /&gt;
verb 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==On the Client (Windows)==&lt;br /&gt;
&lt;br /&gt;
Probably the most used add-on to OpenVPN is the Windows client GUI. The ​old client GUI is effectively unmaintained, but is still (as of 19 February 2013) included in the official OpenVPN-2.3 installer packages. The ​new GUI is more advanced and uses the OpenVPN management interface for controlling the OpenVPN daemon and should therefore be more reliable. The new GUI will eventually replace the old GUI in the official installers. &lt;br /&gt;
&lt;br /&gt;
===Install the software===&lt;br /&gt;
&lt;br /&gt;
* Download the openvpn windows installer from http://openvpn.net/index.php/open-source/downloads.html&lt;br /&gt;
&lt;br /&gt;
* Run the installation binary and install the software, just accept all defaults.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create the client configuration file===&lt;br /&gt;
&lt;br /&gt;
* open a text editor, create c:\program files\openvpn\config\client.ovpn and add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
client&lt;br /&gt;
remote remote.server.ip.address&lt;br /&gt;
dev tun&lt;br /&gt;
port 655&lt;br /&gt;
proto udp&lt;br /&gt;
&lt;br /&gt;
auth-user-pass&lt;br /&gt;
&lt;br /&gt;
nobind&lt;br /&gt;
&lt;br /&gt;
ca     ca.crt&lt;br /&gt;
cert   clientname.crt&lt;br /&gt;
key    clientname.key&lt;br /&gt;
&lt;br /&gt;
comp-lzo         # Compression - must be turned on at both ends&lt;br /&gt;
&lt;br /&gt;
# add a route to the client see other hosts on the server network&lt;br /&gt;
# you may need to update this line to match your network setup&lt;br /&gt;
push &amp;quot;route 192.168.0.0 255.255.255.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
keepalive 10 60&lt;br /&gt;
ping-timer-rem&lt;br /&gt;
verb 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Start the VPN tunnel==&lt;br /&gt;
&lt;br /&gt;
===On the server (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
* with the .conf file placed in /etc/openvpn/ the vpn server will be listening for incoming connections automatically when the system is booted. &lt;br /&gt;
&lt;br /&gt;
* use the init script to force a restart of the vpn server&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/init.d/openvpn restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* check the log files in /var/log/ for debugging&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===On the client (Debian Linux)===&lt;br /&gt;
&lt;br /&gt;
* with the .conf file placed in /etc/openvpn/ the vpn client will automatically try to make a connection to the vpn server when the system is booted. &lt;br /&gt;
&lt;br /&gt;
* use the init script to force a restart of the vpn client&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/init.d/openvpn restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* a prompt asking you for a username and password will appear on the console. Enter the credentials for the client account and press ENTER.&lt;br /&gt;
&lt;br /&gt;
* check the log files in /var/log/ for debugging&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===On the client (Windows)===&lt;br /&gt;
&lt;br /&gt;
* From the Windows program files menu, start the OpenVPN GUI program. The openvpn icon will appear in the sytem tray. Right-click on the icon and select &amp;#039;Connect&amp;#039; on the config for your vpn. A dialog box prompting for a username and password will appear.&lt;br /&gt;
&lt;br /&gt;
[[File:Openvpn-win-gui.PNG]]&lt;br /&gt;
&lt;br /&gt;
Enter the credentials for the client account and click &amp;#039;Ok&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it! :-)&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>