A Simple OpenVPN Version 2 Installation on Windows

by Scott Beatty

Note: This article was originally written for OpenVPN 2.0 rc6. It has now been updated for OpenVPN 2.0.5.

Introduction

My clients needed a secure way for their telecommuter employees to synchronize their contact manager software over the Internet with the contact manager application server in their office. After some research, I chose the open source, multi-platform OpenVPN as the solution. OpenVPN is a SSL VPN (Secure Socket Layer Virtual Private Network). It establishes an encrypted tunnel over the Internet, thus creating a private network over the public Internet. The advantages of the OpenVPN solution include:

  • low cost
  • simplicity
  • well-tested security
  • scalability
  • flexibility
  • multi-platform
  • it operates in user-space, not kernel-space
  • it handles multiple arbitrary protocols at the same time

For a good discussion of OpenVPN see the The SANS Institute document, “OpenVPN and the SSL VPN Revolution,” by Charlie Hosner. Also, see the presentation “The User-Space VPN and OpenVPN,” by James Yonan.

Scenario

Here is my clients’ scenario:

• Office LAN:
Router/Firewall/DHCP Server: Linksys BEFSR41 Ver. 3
External IP address: static, public
Internal IP address: static, private
• Application Server on LAN:
OS: Windows 2000 Server
IP address: static, private
• Remote Clients:
OS: Windows XP Pro SP2
IP address: dynamic, private

Expert Help

As I read about OpenVPN on its website, and in various articles available on the Internet, I knew that it was the right solution, but I found the installation and configuration information difficult to sort out. I needed someone to help me navigate through these waters so that I could get things working quickly for my clients. Fortunately, I saw that James Yonan, OpenVPN project founder and maintainer, does consulting. I contacted him by email, and found that he was available (via the phone and email). As a result, I eventually got things up and running. I could not have done it in a reasonable time without help from James. This article shares many of the things that I learned. Perhaps with this information you will be able to get OpenVPN running on your own. (Note: As OpenVPN continues to mature, I believe that it is gradually getting easier to configure, and to find documentation for specific issues, but starting out can still be daunting.)

Procedure

Here are the steps that you can follow for setting up a similar VPN:

1. The LAN firewall needs to be able to do port forwarding. Port 1194, UDP, is now the official OpenVPN port, assigned by IANA. Forward it to the static IP address of the application server.
Comments:
- For the Linksys router, this is set up under “Applications & Gaming > Port Range Forwarding.”
- The LAN firewall setup for OpenVPN is simple and affordable.
- UDP is a better transport for TCP in a VPN. TCP over UDP does not have the packet fragmentation problems that TCP over TCP has. Also, UDP is good at traversing NAT routers.
- It is possible to change the port number for OpenVPN. It would need to be changed in all of the OpenVPN config files that are in use on your VPN, as well as in the LAN firewall port forwarding.
- The OpenVPN 2.0 HOWTO has some information on running an OpenVPN server with a dynamic IP address.

2. Download the Windows installer of OpenVPN. Check the file signature.
Comments:
- There is a lot of good Windows installation information at http://openvpn.net/INSTALL-win32.html and http://openvpn.net/howto.html#install.
- You can check the OpenVPN version from the command line in the directory where openvpn.exe is installed by typing openvpn --version.
- If you want to update an existing OpenVPN 2.0 installation, uninstall the old version first. The uninstaller seems to know which files to leave alone for the next version, but you might want to make a backup before uninstalling, just in case. Then, run the new version OpenVPN installer.
- Another installation and admin option for Windows users is the OpenVPN GUI for Windows.

3. Run the installer on each VPN machine, including the application server on the LAN, which will become your VPN server. I recommend accepting the default installation. Continue the installation when it notifies you that no digital signature was found for the TAP-Win32 Adapter.
Comments:
- The default installation directory is C:\Program Files\OpenVPN.

4. To check the OpenSSL version, open a command prompt window to a directory containing openssl.exe, i.e., the OpenVPN bin directory. Then, type:
openssl
OpenSSL> version
You can compare this version to the latest version listed at The OpenSSL Project website. If you need Windows binaries for OpenSSL that are more recent than the ones packaged with OpenVPN you can obtain them from: http://www.slproweb.com/products/Win32OpenSSL.html. Install this OpenSLL on any machine, and then copy the following files to the OpenVPN bin directory (first, make a backup in case you need to reinstall the old files): openssl.exe, libeay32.dll, and libssl32.dll.
Comments:
- The Win32OpenSSL package from the link above places the openssl.exe file in the bin subdirectory of the OpenSSL installation directory, and the libeay32.dll and libssl32.dll files in the system32 subdirectory of the Windows installation directory.
- It is safer, however, to just wait for the next release of OpenVPN. It will probably have the updated OpenSSL files, as well as any files that needed to be updated to work with the new OpenSSL version.
- I once updated the OpenSSL files only and the TAP Adapter quit working. I fixed it by uninstalling the old version of OpenVPN and installing its new version. This was also around the time of a Windows Update installation, so I’m not sure what caused the problem.

5. Open a command window to C:\Program Files\OpenVPN\easy-rsa. Run init-config.bat. In the same easy-rsa directory, edit the vars.bat.sample file. Change the KEY_SIZE variable to 2048. Also, assign all of the default values for the fields which will be placed in the certificates. For example,
KEY_COUNTRY=US
KEY_PROVINCE=IL
KEY_CITY=CHICAGO
KEY_ORG=Company Name
KEY_EMAIL=certs@company.com
Now, save the file as vars.bat in the same directory, and then run it.
Comments:
- Paths with spaces do not need to be bracketed with double quote marks.
- Key renegotiation occurs once per hour, so a large key size will not adversely affect your VPN performance.
- In the easy-rsa directory there is a file named README.txt. It summarizes the uses for each of the batch files in that directory. Note that the vars batch file precedes each of the other batch files (except init-config.bat), though if the variables aren’t changing then the vars.bat file only needs to be run once before the other batch files are run in succession.

6. Run the clean-all.bat file. This removes any previous KEY_DIR directory, so if you need to preserve the old one, move it first, or set a different value for KEY_DIR in the vars.bat file.
Comments:
- The HOME variable must have been set correctly in vars.bat, and the vars batch file must be run before running the clean-all.bat file. If you change the HOME or KEY_DIR variables in the vars.bat file, then you must rerun vars.bat before running clean-all.bat.

7. Run the build-ca.bat file. You can accept the default values that you entered earlier in the vars.bat file. For the Common Name, a suggestion is to use the company name, followed by “ - CA“. This batch file creates a certificate authority key, and a certificate for your network which is used to sign all successive keys.
- The .key file is the private key, and the .crt file is the signed certificate.
- After use, ca.key should be stored in a very secure, offline location.

8. Choose a name appropriate for the VPN server. Then, run build-key-server.bat <server name>. When asked for a Common Name enter <server name>. When asked for a challenge password leave it blank. When asked to sign the certificate reply “Y.” When asked to commit reply “Y.” This batch file creates a private key and a public certificate, signed by the previously created certificate authority’ certificate, for the OpenVPN server.
Comments:
- The Common Name will be incorporated also in the filenames created in this step.
- The Common Name in this step is different from the Common Name in the previous step.

9. Choose names appropriate for each VPN client. Then, run build-key <client name> for each VPN client. When asked for a Common Name enter <client name>. This batch file creates a private key and a public certificate, signed by the previously created certificate authority’ certificate, for each OpenVPN client.
Comments:
- This step is similar to step 8.
- Again, the Common Names in this step are different from the Common Names in the previous steps.

10. Then, run the build-dh.bat file. This batch file creates a large prime number; it might take several minutes to run.
Comments:
- In order to speed up the process, try randomly wiggling the mouse in order to create more entropy in the system.
- “dh” stands for Diffie-Hellman.

11. Open a command prompt window to the OpenVPN bin directory (it doesn’t matter on which machine). Enter the command:
openvpn --genkey --secret ta.key
This creates a small keyfile named ta.key. Place a copy of this file in the OpenVPN config directory of each machine in the VPN.
Comments:
- This file is used for TLS authentication, which provides another layer of security for the VPN.

12. Now it is time to copy the files created in the previous steps from the newly created keys directory to the OpenVPN config directories on their respective machines.

Machine Files
OpenVPN server ca.crt <server Common Name>.key <server Common Name>.crt ta.key dh2048.pem
OpenVPN client ca.crt <client Common Name>.key <client Common Name>.crt ta.key
Secure, offline ca.key

Comments:
- If later you need to add a new client to the VPN, repeat steps 9, 11, and 12.

13. Edit the VPN server config file. Go to the sample-config directory and save a copy of server.conf to the filename <server Common Name>.ovpn in the OpenVPN config directory of the VPN server. Then, open this .ovpn config file in a text editor, and make the following changes:
a. Sample:
cert server.crt
key server.key
New:
cert <server Common Name>.crt
key <server Common Name>.key
c. Sample:
;tls-auth ta.key 0 # This file is secret
New:
tls-auth ta.key 0 # This file is secret
d. Sample:
;max-clients 100
New:
max-clients <maximum number of concurrent clients on your VPN>
e. Sample:
dh dh1024.pem
New:
dh dh2048.pem
Changing the other settings in the config file is up to you.
Comments:
- Using the configurations outlined in this article, the VPN server won’t allow connections from anyone unless they have both the correct TLS authentication key and the correct X509 certificate and key.
- As stated before, in this example the VPN server is also the application server on the LAN.
- TAP vs. TUN interface: Use dev tap only if you want the client on the LAN subnet. This would require bridging, which Windows 2000 does not support, so the use of dev tap is not possible with Windows 2000. Windows XP does support bridging.
- Even though the OpenVPN network connection is called a “TAP” adapter, you can still configure OpenVPN to use dev tun instead of dev tap.
- See comments in the server config file for further information.
- This step assumes that you’ll run OpenVPN as a service. If you are not, leave the file extension of the config file as .conf.
- If you want clients to be able to communicate with (e.g. ping) each other, uncomment client-to-client.
- For information on how to configure the server to assign static IP addresses to clients see http://openvpn.net/howto.html#policy.
- My sample config files can be downloaded from the link in my comment below dated April 19th, 2006.

14. Edit the client config files. Go to the sample-config directory and save a copy of client.conf to the filename <client Common Name>.ovpn in the OpenVPN config directory of each VPN client. Then, open this .ovpn config file in a text editor, and make the following changes:
a. Sample:
remote my-server-1 1194
New:
remote <static external IP address of LAN gateway/firewall> 1194
b. Sample:
cert client.crt
key client.key
New:
cert <client Common Name>.crt
key <client Common Name>.key
c. Sample:
;ns-cert-type server
New:
ns-cert-type server
d. Sample:
;tls-auth ta.key 1
New:
tls-auth ta.key 1
Changing the other settings in the config file is up to you.
Comments:
- If you are not sure of the static external IP address of your LAN’s gateway/firewall, surf to the following URL from your application server on the LAN: http://checkip.dyndns.org/.
- The only differences between each client config file are the names of the .crt and .key files.
- See comments in the client config file for further information.
- This step assumes that you’ll run OpenVPN as a service. If you are not, leave the file extension of the config file as .conf.

15. VPN client firewall issues: My experience has been that OpenVPN will work with the Windows Firewall in Windows XP Pro SP2 turned on for all adapters, including the TAP adapter. Other software firewalls that may be running on the same machine may have to be configured to allow OpenVPN through.
Comments:
- For the TAP adapter, the use of the “Client for Microsoft Networks” and “File and Print Sharing for Microsoft Networks” bindings are optional, depending on your network needs. If you don’t need them turn them off. The “QoS Packet Scheduler” might also be optional; I left it on.
- If, for some reason, you want to turn off the Windows Firewall in Windows XP Pro SP2 for the TAP adapter, here are some instructions: Right-click the TAP adapter (sometimes named “Local Area Connection 2″) and select “Properties”; click on the “Advanced” tab; click on the “Settings” button under “Windows Firewall.” in the firewall control panel applet under the “General” tab, leave the firewall turned On; click on the “Advanced” tab; turn off the firewall for the TAP adapter (uncheck the box for that connection).
- Because remote VPN clients can potentially infect internal networks, as a minimum company policy should require them to operate behind a firewall, to maintain updated antivirus and antispyware software, and to keep their operating systems configured and updated against security vulnerabilities.
- For more information on the VPN server firewall see step 22 below.

16. The OpenVPN installer installs OpenVPN as a manual service. If you want OpenVPN to automatically start as a service when logging in then change the service “Startup type” to “Automatic.” Prior to running OpenVPN as a service, you can launch OpenVPN in a console by right-clicking the .ovpn config file and then selecting “Start OpenVPN on this config file.” Once started this way you can stop OpenVPN by pressing F4 in the OpenVPN console, followed by any other key, such as the spacebar. If you would rather restart OpenVPN from the console, perhaps to put into effect a config file change, then press F3 in the console.
Comments:
- You can change the verbosity of the messages to the console by increasing the verb value in the config file to 6. This will give you more feedback on what is occurring. If two machines are talking to each other you should see UDPREAD and UDPWRITE statements in the console. Be sure to set the verb value back to a lower value, such as 3, when you are done testing.
- If you don’t have “Start OpenVPN on this config file” in the right-click context menu, and if the OpenVPN icon isn’t used for the config file, then go to Windows Explorer | Tools | Folder Options | File Types, OPVN extension / OpenVPN Config File. If the Restore Defaults button is available, click it. This should fix the icon, the file extension associativity, and the context menu.

17. The TAP adapter should be set to receive the IP address, and DNS server address(es), automatically, i.e., that DHCP is enabled. To test whether an OpenVPN client can connect to the OpenVPN server, start the OpenVPN server, and then open a command prompt window in the client, and type:
ping 10.8.0.1
If you get a reply with times, rather than timeouts, then the client can see the server.
Comments:
- Hopefully, your LAN doesn’t use IP addresses that begin with 10.8.0, else there may be a conflict with OpenVPN. The default OpenVPN network and netmask is 10.8.0.0 255.255.255.0. For dev tun, the default available IP addresses for clients are 10.8.0.4 to 10.8.0.251 (248 addresses). This can be changed in the server config file. For more information, go to the OpenVPN Man Page, and look up the directive --server network netmask under the “Server Mode” section.
- If you need a network address calculator here is a good one: IPv4 Network Calculator.

18. Another test that can be run is to test the UDP packet size. This can be done by temporarily adding the line:
mtu-test
to the bottom of a client config file. Then, start the client OpenVPN process in the console, and wait several minutes. Keep an eye on the client OpenVPN console; it will report a pair of comma-separated numbers with square brackets. If these numbers are above 1500 then there is no problem, and no changes are required. If they are less than 1500 then add the following line to the config files:
tun-mtu <value from mtu-test>
Comments:
- Usually the MTU test results are above 1500.

19. If an OpenVPN client machine is compromised, e.g., if a VPN client laptop is lost or stolen, then you can revoke that machine’s certificate, and block that machine from the VPN. The instructions are in the README.txt file in the easy-rsa directory.
Comments:
- CRL stands for Certificate Revocation List.

20. Once OpenVPN is running, and you can ping the server from the client, your client application should see the application server. All traffic on all ports between the two machines will pass through the OpenVPN tunnel on port 1194. Assuming that the client application normally connects to port 1234 on the application server, for connecting over the VPN it should be configured to connect to 10.8.0.1:1234.
Comments:
- Usually, applications listen to all interfaces, and therefore they don’t have to be told to listen to the TAP interface.

21. On Windows, if OpenVPN is not running as a service then it can also be configured to require a password or a smart card in order to start. For more information, see the OpenVPN Man Page.
Comments:
- Apparently, this works now even when OpenVPN is running as a Windows service. (I have not tested this.)

22. VPN client firewall issues: Assuming that the VPN is used only for access to specific applications, like the contact manager application server in the present example, the practical solution for protecting the LAN from a possible malware infection from an Internet-connected VPN client (in addition to your security policy for VPN clients) is to firewall the VPN server’s TAP adapter so that it only allows in the port(s) needed for the application server(s), from IP addresses that may be assigned to the VPN clients. If you have clients with differing access needs, then have the server pass out client VPN IP addresses from different ranges depending on the common name of the client, and set up the TAP adapter firewall rules to grant different access based on the IP range, and only allow access through the application’s port(s).
Comments:
- I recommend that you first get OpenVPN running without firewalling the server’s TAP adapter. Then you can experiment with the firewall configuration.
- For Windows 2000, it appears to me that its built-in TCP/IP Filtering can not be applied only to specific adapters; it must be applied to all adapters. I have gotten good results so far from the Look ‘n’ Stop 2.05 personal firewall. I’m using it to firewall the TAP-Win32 adapter on Windows 2000 Server. Look ‘n’ Stop only works on one adapter per firewall instance. I’ve used it also on Windows Server 2003, but I’ve been advised by it’s developer that the packet filter has not been optimized for a large number of simultaneous connections (e.g., 1000), and TCP SPI only handles 256 simultaneous entries.
- If your application server is running on Windows XP Pro SP2, it appears to me that using the Windows Firewall you can filter the TAP adapter independently of the other adapters. You would need to activate Windows Firewall (see step 15 above), and then either create an exception for the application program, or open a port on the “Exceptions” tab. If possible, perhaps the easiest and most secure way would be to firewall the adapter and then unblock the application program if the Windows Firewall asks about it. That way, the port would only be opened when the application program needed it.
- To learn how to assign static IP addresses to clients read about the --client-config-dir and the --ifconfig-push directives on the man page. Client configuration files can be changed without restarting the server.
- These steps are additional layers of protection, but they are not complete bullet-proof ways to protect against threats launched from within the network. For example, if you have to open port 80 for a remote client to have access to a web-based intranet/extranet, then additional protection might be needed because some malware can piggyback on the http protocol. That subject is beyond the scope of this article.
- The OpenVPN on Windows notes page has a section near the bottom titled “Notes — Firewall on the Windows client” which may counter some of my firewall comments in this article.

Acknowledgements

Thanks to James Yonan for his assistance with this article’s first version. Subsequent errors and omissions, if any, are my responsibility.

49 Responses to “A Simple OpenVPN Version 2 Installation on Windows”

  1. Stuart Finkel Says:

    Hi,

    Great article, really helpful. Have you tried to route or bridge with openVPN. I have tried everything and have not succeeded. The VPN works between the two machine very well. I did enable routing on the XP “server”.

    Is there any help fourm for openVPN?

    Thanks for your time.
    Stuart

  2. Scott Beatty Says:

    Thanks for your comments. You might try your question in this forum:

    http://openvpn.se/bb/viewforum.php?f=4

  3. Gareth Evans Says:

    One thing not mentioned here is you need to copy the ca.crt key to \easy-rsa\keys\
    On the Client machine only!!

    The only other thing I needed to do to get this to work was this in the client.ovpn and server.ovpn files….
    ..\easy-rsa\keys\ca.crt (assuming you made the .crt key ca.crt !!) STEP 14b.

    Apart from a firewall issue, this setup worked like a charm…. took a while to generate the 2048 key, but better security !!!!!

    Oh and if you did put it down I missed it….. just that I skim the setup, Impatient you see !!!
    Scott, Thanks I am sure it would have taken a lot longer without this !!!!!

  4. Scott Beatty Says:

    Thanks, Gareth. I suggest where to put ca.crt in step 12, i.e., in the config directory. Your setup is a little different, but it’s working, so congratulations!

  5. Tom Reimann Says:

    Thank you, thank you, thank you! For taking the time to write such a helpful document. I had tried various installation methods posted on the Net but none seemed to convey the ‘real world’ information that your article did.

    I (and probably not alone) have some other questions reguarding PoenVPN. It seems like a fine piece of software, but like most users, have a little difficulty in what to do next. Could you direct me to some sites or be willing to answer a few question? The FAQ document for OpenVPN has a question and an answer, but I’m not able to interpret the answer to solve my problem. Mainly, How can I link my network to the client after succesfully pinging it?

    Thank you again and hope to hear from you.

    Forever grateful,
    Tom Reimann

  6. Scott Beatty Says:

    Thanks, Tom. I generally don’t have time to answer questions, but I can give you some tips: A very good resource (in addition to the FAQ that you looked at) is the “OpenVPN 2.0 HOWTO” at http://openvpn.net/howto.html. Once when I asked a question to James Yonan he referred me to the HOWTO. With regards to your question about linking your network perhaps this section in the HOWTO is of interest: http://openvpn.net/howto.html#redirect.

    The forum mentioned in comment 2 above is a good place to post questions.

    Depending on your situation, you could also consider hiring James Yonan for a phone consultation; that’s how I got started. His contact information is at http://openvpn.net/donate.html.

  7. daniel cialdella Says:

    Thank you a lot !!!!!

    its a “real” doc to configure OpenVpn. IÃ?´m installing it in my wifi lan and your document is very usefully.

    thank you again.

    dac

  8. Juan Carlos Says:

    Thank you for the great document.

    I have one question. You say that to add a new client you need to repeat steps 9, 11, and 12. For step 11 can’t the same ta.key file be used for all clients? If not then how do you store all the different ta.key files on the server side if they all have the same name?

    Thank you again!

  9. Scott Beatty Says:

    Thanks, Juan. Yes, the same ta.key file is used for all clients. The table in item 12 shows that the ta.key file is not customized to the client name.

    Thanks.

  10. Scott Beatty Says:

    Here’s some OpenVPN news that I found interesting: In the 14 July 2005 issue of Windows Secrets Newsletter, http://www.windowssecrets.com/comp/050714/, it states that WiTopia’s PersonalVPN service, http://www.witopia.net/aboutpersonal.html, uses OpenVPN.

  11. Moastuen.com Says:

    So after a long strain I finally managed to get VPN up and running at my office. After first trying a hardware solution from Symantec that didn’t work as well as hoped, I stumbled over OpenVPN - a OpenSource software implementation… I struggled quit…

  12. Markus Weber Says:

    Thanks a lot for this great how-to.

  13. Pavel Says:

    i need conf.files on open vpn please send in my e-mai

  14. Scott Beatty Says:

    Please see steps 13 and 14 above. Also, please note that the article has been updated for version 2.0.2.

  15. Remco Says:

    Ok
    I got it running now. I have a connection to my 2000 server at the office. :D
    But now I”m wondering can I join the domain on the NT4.0 server which is another server at the office or do I only have access to the 2000 server that I have connected with???
    Remco

  16. Scott Beatty Says:

    Remco,
    Congratulations! In answer to your question, I don”t know. If you can”t test it yourself I expect that you can get your question answered in the forum linked to in comment no. 2 above.

  17. Jared Says:

    hi scott!
    found this site in a search
    have you been able to get auth-user-pass-verify to work on a windows server?
    i have my keys/connections working but would like to add a additional level so that if someone picked up the laptop they couldn’t connect w/o a user and password

    thanks
    -Jared

  18. Scott Beatty Says:

    Hi Jared,

    I have not tried auth-user-pass-verify on a Windows server, or any kind of server, but I expect that it will work. According to James Yonan, it is a username/password authentication method that can be used in conjuction with certificate/key authentication.

    Here are a couple of related references:

    http://openvpn.net/howto.html#auth

    http://openvpn.se/bb/viewtopic.php?t=286&

  19. Scott Beatty Says:

    Here is a link to another good article on OpenVPN by Charlie Hosner, published September 28, 2005 on NewsForge:

    SSL VPNs and OpenVPN: A lot of lies and a shred of truth
    http://software.newsforge.com/software/05/09/22/164231.shtml

  20. krzee Says:

    Very nice walk-through. Thank you!

  21. Mike Robinson Says:

    Thanks for the article. I’ll use it when I get Openvpn working properly. At the moment I have 2.0.5 working on three machines on the same subnet (192.168.1.0), but I want to deploy it on a WAN.

    My Openvpn server is on a machine (192.168.1.6) behind a Linux firewall, but not on the firewall machine (192.168.1.2). I’ve read the howto and it says I have to forward port 1194 through the firewall to my server on 192.168.1.6.

    Any idea how to do this? I’m not an iptables expert.

  22. Scott Beatty Says:

    Hi Mike,

    I haven’t yet done port forwarding with iptables. I’ve been doing it using the browser interface that comes with the Linksys routers.

    Here are some of the options to finding an iptables solution:

    1. Perhaps you are using a Linux distribution with a GUI firewall administrator that makes it easy to set up port forwarding.

    2. Perhaps you can use Guidedog (with KDE) to configure iptables for you:

    http://www.simonzone.com/software/guidedog/manual/kapp-forwarding.html
    http://www.simonzone.com/software/guidedog/manual/whatisportforwarding.html

    3. Perhaps you can try the openvpn-users mailing list:

    http://sourceforge.net/mailarchive/forum.php?forum_id=8453

    4. You can try asking your question in a Linux firewall forum, e.g.,

    http://www.linuxquestions.org/questions/forumdisplay.php?s=&forumid=4

    5. You can try a Google search on the subject. Here are some links that I found:

    http://www.linuxhorizon.ro/openvpn-brief.html
    http://www.linuxjournal.com/article/7949
    http://entropy.brneurosci.org/linuxsetup71.html
    http://www.alyra.org/~msph/web/?action=default/OpenVPN/read
    http://www.yolinux.com/TUTORIALS/LinuxTutorialIptablesNetworkGateway.html

    6. You can check out a Linux firewall book, e.g.,

    http://www.samspublishing.com/bookstore/product.asp?isbn=0672327716&rl=1

    Good luck!

  23. Beornwulf Says:

    Hello, I have recently installed Openvpn (latest build) and I have been trying to get it working as a service loading on windows startup. What I am trying to accomplish is having it prompt for a password and connect to the vpn (Home Office) before the Ctrl+Alt+Del screen appears, or even during. This way clients can be members of a (Home office domain) and log directly in. The cached credentials do work, but it would be nice to be able to directly log in on bootup. I have tried the forums for openvpn but no one has responded to my posts, just wondering if this has been done.

    Anyone ideas?

  24. Scott Says:

    THANKS!

    I’ve tried two or three times over the last two months to set up OpenVPN in my spare time. Once I found your step by step walk through, it only took a couple of hours to get it working. Now on to customizing and playing with firewalling the interface. This is the best resource for setting up OpenVPN on windows that I’ve found.

  25. Scott Beatty Says:

    Thanks, Scott! BTW, I’ve recently learned of OpenVPN-Admin, http://sourceforge.net/projects/openvpnadmin. I haven’t tried it yet, but it might make OpenVPN installation easier on Windows and Linux (so far). It uses Mono, which runs .Net on a variety of platforms, http://www.mono-project.com/Supported_Platforms.

  26. Shady Brady Says:

    Thanks. I was able to get it working in less than an hour! One point I’d like to mention. You can configure the client to point to a domain address vs. a static IP address. For example:
    mydomain.dynamicipservice.org . This of course assumes that you have setup an account with one of the dynamic ip services. You also will need a router or 3rd party program that lets you configure the dynamic IP service. My experience with the Linksys routers is that the DDNS service doesn’t work as well as installing one of the little service programs that runs in the windows system tray. My program of choice is DeeEnEs ( http://www.palacio-cristal.com ). It works perfectly.

    Prior to trying OpenVPN, I tried the built in VPN connection in XP and it was inconsistent and buggy. I just spent the last week trying to get a $350 Linksys RV0041 to work as a VPN server for our road warriors… I could never get it to work. Linksys fails to mention clearly that you need VPN client software to connect to this router…even though their documentation says clearly that it supports “Up to 50 separate tunnels to connect remote offices or remote users.” Linksys QuickVpn client won’t work with this router. I tried the Greenbow client (costs $60 if you want to buy it). I could access “some” of the machines on the network but it seems to break connections all the time. I gave up..

    I still haven’t worked out the kinks to setting up bridging using OpenVPN. I want to be able to access all the computers on the network but don’t want to use an XP machine to make this happen. The threat of a port flood attack on port 1194 makes me nervous. Maybe others could share their experience with stability, security etc. I’ve little to no Linux experience, so setting up a Linux box is somewhat overwhelming and confusing.

  27. guroo Says:

    Can someone tell me how to do next ? openvpn server installed on winXP machine with 5 vpn users … machine connects to internet thru PPPoE ADSL now how can i setup that all the clients when conected can surf thru this inernet connection ?

  28. Scott Beatty Says:

    @ guroo: I haven’t tried what you are asking, but this reference may help:
    http://openvpn.net/howto.html#redirect

  29. sakis Says:

    hello. i have a problem with my Openvpn. i have 1 common client and 2 defferent servers (a w2k server & a 2003 server).some times the servers must reboots (microsoft critical updates) and i have the problem that i must go to restart the openvpn services because if i don’t do that i can’t connect by openvpn and i can’t ping the servers.
    plzzzz help me. i have an idea to schedule the restart of openvpn services after every reboot but i want to know a pro idea for this problem.
    thanks in advance.

  30. Scott Beatty Says:

    @sakis: As mentioned in point 16 above, assuming that OpenVPN has been installed as a service, you can change the service startup type to Automatic.

    Here is a more detailed description:

    Control Panel > Administrative Tools > Services
    right click OpenVPN Service > Properties
    change “Startup type” to “Automatic”
    click Start, OK

  31. John McGivern Says:

    Hi!

    This another great article for a great product thanks! My one issue is that I want the openvpn client to see the whole network, not just the vpnserver itself. I can ping the vpn server from the client but nothing else internally. So far I can’t find any documentation about how to do this. Do I need static routes on my VLAN for the openvpn subnet to talk to the other internal subnets?

    Thanks in advance.

    John

  32. Scott Beatty Says:

    Thanks, John. As mentioned at the end of the comments for step 13, uncomment client-to-client in the server config file. You can find a reference in the OpenVPN documentation here: http://openvpn.net/howto.html#config

    That will enable an OpenVPN client to see the other OpenVPN clients on the same OpenVPN subnet.

    For the rest of your question, I suggest that you ask it in the forum mentioned in comment 2.

  33. John McGivern Says:

    Hi Scott, thanks for the response. I will check out the client-to-client setting. I actually meant being able to see other servers etc on the corporate LAN as opposed to vpn clients being able to see each other. However, I did discover the answer to my question. Basically you do need to add specific routes on your router/gateway device so that your internal subnets know how to get back to the vpn client subnet. So, we have a cisco catalyst switch here that acts as a gateway that needed a static route for this purpose - basically the command was

    “ip route [openvpn subnet] [netmask of openvpn subnet] [openvpn internal interface ip]” - this allows internal ip addresses to find openvpn client users/IPs

    Also, ip forwarding needs to be turned on as well. If your firewall is the actual gateway for your network then you would need to add a static route on the firewall as well for this traffic. Whatever device is your default gateway for your internal users will need this static route.

    Thanks again Scott.

    John

  34. Michael Says:

    Awesome article! I’ve noticed that when I run the VPN server on Win XP and run VNC so that I can use my desktop remotely, everything works GREAT! But, this is ONLY if I leave the username logged in. Obviously logging out will break the VPN connection, but even when I choose “switch user” option (leaving VPN and VNC running) so that nobody can sit down at the server and watch, that the connection from the client dosent work.

    Any idea why?

    Michael

  35. Scott Beatty Says:

    Thanks, Michael. I don’t have experience with this problem. I did a quick Google search on the subject, and it appears to me that this problem is not related to OpenVPN. It seems to be a VNC and Windows XP issue. For example,
    http://ask.slashdot.org/article.pl?sid=03/07/03/0048204
    http://www.realvnc.com/pipermail/vnc-list/2003-September/040864.html
    Perhaps this post has a solution:
    http://forum.ultravnc.net/viewtopic.php?p=1923
    that is, try reconnecting VNC.

    I won’t be spending any more time on this issue. By having your question listed on this page, maybe another reader may see it and know the answer. If you find a definitive solution, please feel free to post a summary here.

  36. UltraSam Says:

    Hello,

    I’ve not yet found any clear answer about my problem… sorry if some solution has already been posted on this page.

    I use OpenVPN + OPenVPN GUI under Windows XP.
    I can connect correctly by entering my password through -> Connect

    But I want to automatically run and connect OpenVPN client as a service at bootup.

    Question: where can I store my OpenVPN connection password to avoid this message when the service is starting:

    Wed Mar 15 17:20:41 2006 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
    Enter Private Key Password:
    Wed Mar 15 17:20:41 2006 ERROR: could not not read Private Key password from stdin
    Wed Mar 15 17:20:41 2006 Exiting

    I mean, I need a way to automatically provide the password to the OpenVPN service when it starts.

    Thank you for any help,

    UltraSam

  37. Scott Beatty Says:

    UltraSam,

    I have not previously been confronted with that issue, nor do I know the solution. I see that you have also asked your question in the OpenVPN Forum,

    http://openvpn.se/bb/viewtopic.php?t=556,

    which is what I was going to suggest. I hope that you find a satisfactory answer.

  38. UltraSam Says:

    Scott,

    Thanks for your reply.
    Going to try what is suggested.

    UltraSam

  39. Rich Says:

    Great Article, very easy to follow.

    I have been experimenting with Open VPN on SBS 2003, I read about bridging connection, I select the 2 nics, but there is no option to bridge them. The network on SBS, is using IP Address 192.168.0.1 subnet of 255.255.255.0 Open VPN is running on 10.8.0.1 subnet 255.255.255.252. I can ping the server from the client and vice versa. I am not sure how to get the client to be able to see the full network, I need to connect a client (using 3g) to the exchange server which is on the network 192.168.0.1 subnet 255.255.255.0. I am not sure weather to use bridging our routing.

    Thanks in Advance

  40. bill Says:

    hello,
    congrats for this great walk-through, even though it was my first attempt to setup OpenVpn this article help me a lot
    I just have problem .My server completes succesfully the server.ovpn procedure, the client , in the final step , remains in a WRWRRRRRRWRRR ……thing , do you have any idea why?

    Thank anyway

  41. Charlie Says:

    Hi Scott,

    Thanks for this walk through. Great job! It saved me a lot of time!

    OpenVPN is a great solution for the client I’m working with. But I was having trouble getting it to work. I followed your instructions and it worked the first time.

    Best wishes,
    Charlie

  42. Scott Beatty Says:

    Thanks Charlie!

  43. Scott Beatty Says:

    After a recent request for the config files, I have created a .zip file with a server and a config file that illustrate the changes mentioned in steps 13, 14, 18, and 19 above, as well as in my comment dated February 20th, 2006. These two config files are modifications of the sample config files that come with OpenVPN (you can get them without installing OpenVPN by downloading the latest source files from http://openvpn.net/download.html#stable and looking in the sample-config-files folder). There are several sample config files provided with OpenVPN, so if your needs are different from the ones discussed in this article, perhaps one of the sample config files can help you.

    My sample config files can be downloaded from http://www.sbeattyconsulting.com/code/3/sample-configs.zip. To use them, you’ll have to change the IP address and probably the certificate and key filenames. Also, if you run OpenVPN as a Windows service, then change the config file extensions from .conf to .ovpn.

  44. Lee J Says:

    Thank you for writing this article it has been very helpful though I have one problem -

    Once I connect a client to the server I can ping the Tap address on the server and even the servers external address and any other machine on the servers subnet but I cannot access the Internet ? The gateway assigned to the client is the servers Tap cards address.

    Many thanks if you find time to reply I’m sure its something simple.

    Lee

  45. Scott Beatty Says:

    Thanks Lee. I haven’t done a setup just like that, but I’d look at a couple of things:

    - Does your client adapter have a DNS IP address?

    - http://openvpn.net/howto.html#redirect

  46. Anze Says:

    great article! it’s simple and it’s easy to understand how openvpn works.

  47. Graham Says:

    Your instructions enabled me to set up OpenVPN successfully for the first time.
    It also makes it easier to understand the processes going on although I had to enable ‘Push DNS’ to get the connections working. Maybe because each end point was behind a NAT router.
    Anyway my supervisor was most impressed and now he has access to company servers from home. No pay rise though :-(

    Many Thanks

  48. Scott Beatty Says:

    Markus Feilner’s book on OpenVPN, which I recently reviewed in this blog, includes much useful information on installing OpenVPN on Windows, as well as on Linux, Mac, and other operating systems.

  49. Andrzej-Poland Says:

    Dziękuję Ci Scott (Thank You)

    This is great article for the bigginer who want to configure Open VPN.

    Andrzej