We’ll go over how to set up OpenVPN server on Windows 10 in this article. Remote access to a network is made secure through virtual private networks. Popular open-source VPN solution OpenVPN offers security and encryption along with flexibility and user-friendliness.
Setting up a vpn server on windows
Step 1: Download and Install OpenVPN
- Setting up an OpenVPN server on Windows 10:
- Download and install OpenVPN
- Visit the OpenVPN website and download latest version of the software
- Once the download is complete, run installation file and follow prompts to install OpenVPN
Step 2: Generate Certificates and Keys
OpenVPN requires certificates and keys to secure connections between the client and the server. We will use EasyRSA utility to generate these certificates and keys.
- Download EasyRSA from OpenVPN website.
- Extract the contents of the downloaded archive to a folder of your choice.
- Open a command prompt and navigate to the folder where you extracted EasyRSA files.
- Run the command: init-config.bat
- Run the command: vars.bat
- Run the command: clean-all.bat
- Run the command: build-ca.bat
The build-ca.bat command will generate a root certificate that will be used to sign the server and client certificates. Enter the requested information for the root certificate, such as country, state/province, and organization.
- Run the command: build-key-server.bat server
This command will generate a server certificate and key. Enter the requested information, such as country, state/province, and organization.
- Run the command: build-key.bat client1
This command will generate a client certificate and key. You can repeat this step to generate certificates and keys for additional clients.
Step 3: Configure OpenVPN Server
Once you have generated the necessary certificates and keys, it is time to configure the OpenVPN server.
- Create a new folder, such as C:\OpenVPN, to store the configuration files.
- Copy the server certificate (server.crt) and key (server.key) generated in Step 2 to the new folder.
- Create a new text file in the folder and name it server.ovpn.
- Open the server.ovpn file in a text editor and add the following lines:
dev tun proto udp port 1194 ca "C:\\OpenVPN\\server.crt" cert "C:\\OpenVPN\\server.crt" key "C:\\OpenVPN\\server.key" dh "C:\\OpenVPN\\dh2048.pem" server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 184.108.40.206" push "dhcp-option DNS 220.127.116.11" keepalive 10 120 comp-lzo persist-key persist-tun status openvpn-status.log verb 3
Let’s go through the configuration options line by line:
dev tun– Sets the tunnel device to use (tun for routed IP traffic).
proto udp– Sets the protocol to use (UDP is recommended for better performance).
port 1194– Sets the port number for OpenVPN to listen on.
ca– Specifies the path to the server certificate authority file.
cert– Specifies the path to the server certificate file.
key– Specifies the path to the server key file.
dh– Specifies the path to the Diffie-Hellman parameters file (dh2048.pem is a good default choice
server 10.8.0.0 255.255.255.0– Specifies the virtual IP address pool for clients to use.
ifconfig-pool-persist ipp.txt– Persists the virtual IP address pool in the specified file.
push "redirect-gateway def1 bypass-dhcp"– Routes all client traffic through the VPN.
push "dhcp-option DNS 18.104.22.168"and
push "dhcp-option DNS 22.214.171.124"– Specifies DNS servers to use for clients.
keepalive 10 120– Sends a keepalive message every 10 seconds and waits 120 seconds for a response before timing out.
comp-lzo– Enables LZO compression for better performance.
persist-tun– Persists the encryption key and tunnel device between restarts.
status openvpn-status.log– Logs OpenVPN status information to the specified file.
verb 3– Sets the verbosity level for logging.
Save the server.ovpn file and close the text editor.
Step 4: Configure Firewall and Network Settings
In order to allow traffic to pass through the VPN, you will need to configure your Windows firewall and network settings.
- Open Windows Firewall with Advanced Security.
- Click on Inbound Rules and then click on New Rule.
- Select Port and click Next.
- Select UDP and enter 1194 in the Specific local ports field. Click Next.
- Select Allow the connection and click Next.
- Select Domain, Private, and Public for the profile settings and click Next.
- Name the rule OpenVPN and click Finish.
Next, you will need to enable IP forwarding on the server.
- Open a command prompt as administrator.
- Enter the command: netsh interface ipv4 set interface “Ethernet” forwarding=enabled
Replace “Ethernet” with the name of your network interface.
Step 5: Start OpenVPN Server
Now that everything is configured, you can start the OpenVPN server.
- Open a command prompt as administrator.
- Navigate to the folder where you saved the server.ovpn file.
- Enter the command: openvpn –config server.ovpn
The OpenVPN server should start up and begin listening for client connections.
To start the OpenVPN server, open a command prompt as administrator and navigate to the folder where you saved the server.ovpn file. Run the following command:
openvpn –config server.ovpn
If everything is configured correctly, you should see output similar to the following:
Thu Apr 29 23:30:20 2021 OpenVPN 2.4.9 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Nov 17 2020 Thu Apr 29 23:30:20 2021 Windows version 10.0 (Windows 10 or greater) 64bit Thu Apr 29 23:30:20 2021 library versions: OpenSSL 1.1.1h 22 Sep 2020, LZO 2.10 Thu Apr 29 23:30:20 2021 WARNING: No server certificate verification method has been enabled. See openvpn site for more info. Thu Apr 29 23:30:20 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]192.168.1.101:1194 Thu Apr 29 23:30:20 2021 UDP link local: (not bound) Thu Apr 29 23:30:20 2021 UDP link remote: [AF_INET]192.168.1.101:1194
This indicates that the OpenVPN server is running and listening on port 1194.
Step 6: Connect to OpenVPN Server
To connect to the OpenVPN server from a client, you will need to install the OpenVPN client software on the client machine. Once installed, follow these steps:
- Copy the client certificate (client1.crt) and key (client1.key) generated in Step 2 to the client machine.
- Create a new text file in the OpenVPN client installation directory and name it client.ovpn.
- Open the client.ovpn file in a text editor and add the following lines:
client dev tun proto udp remote <server ip address> 1194 resolv-retry infinite nobind persist-key persist-tun ca "C:\\OpenVPN\\server.crt" cert "C:\\OpenVPN\\client1.crt" key "C:\\OpenVPN\\client1.key" comp-lzo verb 3
<server ip address> with the IP address of the OpenVPN server.
- Save the client.ovpn file and close the text editor.
- Start the OpenVPN client and click the Connect button.
You should now be connected to the OpenVPN server and able to access resources on the server’s network.
Q: What is OpenVPN?
A: An open-source VPN system called OpenVPN offers security and encryption together with flexibility and user-friendliness.
Q: Why would I need to set up OpenVPN server on Windows 10?
A: By setting up an OpenVPN server on Windows 10: you can give your customers or staff members safe remote access to your network and permit them to work from home or other remote locations without jeopardising the security of your network.
Q: Is it difficult to set up an OpenVPN server on Windows 10?
A: While setting up an OpenVPN server on Windows 10 does require some technical knowledge and effort: it is not overly difficult to accomplish. You can relatively easily set up an OpenVPN server on Windows 10 by following the steps in this article.
Q: Is OpenVPN free?
A: Yes, It is a free as well as open-source software.
Q: Can I use OpenVPN to connect to a remote network from my Windows 10 computer?
A: You can connect to a distant OpenVPN server from your Windows 10 PC by using OpenVPN client software.
Q: Can I use OpenVPN to connect to a remote network from other operating systems?
A: Yes, OpenVPN is cross-platform and can be used to connect to a remote network from other operating systems: macOS and Linux.
Q: Can I set up an OpenVPN server on a different operating system besides Windows 10?
A: Yes, OpenVPN can be installed and set up on a variety of operating systems: Linux and macOS.
Q: What other security measures should I take when setting up an OpenVPN server?
A: Check your network remains secure, you need also set up extra security measures: two-factor authentication, using strong passwords, and routinely updating your server software, in addition to the OpenVPN server.
- How to connect vpn on windows
- How to change NordVPN to a specific location
- How to use a VPN to access geo-restricted content
OpenVPN is up and running: you should be able to accept connections from distant clients.
Remember that setting up your network security is just the start. Along with properly configuring and securing your OpenVPN server. Other best practises include use of two-factor authentication, use of strong passwords, and upkeep of your server software.
It is a reliable and flexible VPN solution. It can provide your network with security and privacy it needs.
You can set up an OpenVPN server on Windows 10 with a small bit of work and begin taking advantage of a safe and secured network.