Beruflich Dokumente
Kultur Dokumente
1. Download the installer from here and run it on the server computer. 2. Install OpenVPN on each client. (This step can be skipped for now and done at any convenient time)
4. Edit the following lines in vars.bat, replacing "US", "CA," etc. with your company's information:
5. 6. 7. 8. 9. set set set set set KEY_COUNTRY=US KEY_PROVINCE=CA KEY_CITY=SanFrancisco KEY_ORG=OpenVPN KEY_EMAIL=mail@host.domain
5. Save the file and exit notepad. 6. Run the following commands:
7. vars 8. clean-all
prompted, enter your country, etc. These will have default values, which appear in brackets. For your "Common Name," a good choice is to pick a name to identify your company's Certificate Authority. For example, "OpenVPN-CA":
Country Name (2 letter code) [US]: State or Province Name (full name) [CA]: Locality Name (eg, city) [SanFrancisco]: Organization Name (eg, company) [OpenVPN]:
o o o o
o o o
Organizational Unit Name (eg, section) []: Common Name (eg, your name or your server's hostname) []:OpenVPN-CA Email Address [mail@host.domain]:
3. Client certificates and keys: 1. For each client, choose a name to identify that computer, such as "mike-laptop" in this example.
2. build-key mike-laptop o When prompted, enter the "Common
Name" as the name you have chosen (e.g. "mike-laptop") 3. Repeat this step for each client computer that will connect to the VPN. 4. Generate Diffie Hellman parameters (This is necessary to set up the encryption)
5. build-dh
Configuration Files
1. Find the sample configuration files:
2. Start Menu -> All Programs -> OpenVPN -> OpenVPN Sample Configuration Files
upon
the Common Name of each client. 4. Edit the following line, replacing "my-server-1" with your server's public Internet IP Address or Domain Name. If you need help, see Static Internet IP below.
5. remote my-server-1 1194
5. Save the file as C:\Program Files\OpenVPN\easy-rsa\mike-laptop.ovpn (in this example. Each client will need a different, but similar, config file depending upon that client's Common Name.)
2. Copy these files from C:\Program Files\OpenVPN\easy-rsa\ on the server to C:\Program Files\OpenVPN\config\ on each client (mike-laptop, in this example):
3. 4. 5. 6. ca.crt mike-laptop.crt mike-laptop.key mike-laptop.ovpn
Starting OpenVPN
1. On both client and server, run OpenVPN from:
2. Start Menu -> All Programs -> OpenVPN -> OpenVPN GUI
2. Double click the icon which shows up in the system tray to initiate the connection. The resulting dialog should close upon a successful start.
If you have connection problems, make sure to set a rule on your server's firewall allowing incoming traffic on UDP port 1194.
Port Forwarding
If your server is behind a router, you will need to forward the port chosen for OpenVPN (in this example UDP 1194) to the server. Consult your router's documentation for details on this. To set up port forwarding, you will likely need to set up the server with a static local IP address instead of the default dynamic (changing) IP. Instructions for Windows XP may be found here. Make sure to choose a static IP address that is not in the range your router might assign as a dynamic IP, but is within the router's subnet (usually 192.168.0.xxx , 10.0.0.xxx , or similar).
Static Internet IP
Your server will need to have a static internet IP or Domain Name to be accessible over the long term. One solution is to sign up for an account with DynDNS and install the DynDNS Updater on your server. When signing up you will determine the static Domain Name of your server. (For example, "myserver.dyndns.org") You will use this Domain Name in the client configuration files as part of the "remote" directive.
2. Find the OpenVPN service, and set its Startup Type to "automatic." 3. Optionally, start the service now.
Security Tips
1. Transmit all needed files to the client computers using a secure means such as a USB drive (email is not always a secure means). 2. Choose a port other than UDP 1194, and replace the port number wherever this guide mentions UDP port 1194.
If including OpenVPN in a cloned server build you will find that all servers will have the same MAC address for the TAP device. This will cause packet loss across the network. Standard methods of changing the IP address from scripts do not work on the TAP device, to resolve this delete and recreate the TAP device using the scripts included with OpenVPN:
C:\Program Files\OpenVPN\bin\deltapall C:\Program Files\OpenVPN\bin\addtap
You will then have to rename the connection to match the entry in the config file.