Commit 054e8c

2026-12-04 21:24:53 David Sommerseth: Quick overhaul, updating most important things to v2.7
Pages/Getting started with OpenVPN.md ..
@@ 24,18 24,12 @@
proto udp
```
-
- in both client and server configurations. For TCP, the server requires
-
+ To use TCP, you need:
```
- proto tcp-server
+ proto tcp
```
- and the client requires
-
- ```
- proto tcp-client
- ```
+ This needs to be added to both client and server configurations.
Then a port number is needed. The official OpenVPN port number is 1194, but any port number between 1 and 65535 will work. If you don't provide the 'port' option, 1194 will be used. An example using port 443
@@ 59,7 53,7 @@
remote myvpn.example.com 443 tcp-client
```
- For advanced setups, it is also possible to use <connection> blocks, read more about that in the [OpenVPN man page](/Openvpn24ManPage).
+ For advanced setups, it is also possible to use <connection> blocks, read more about that in the [OpenVPN man page](https://build.openvpn.net/man/openvpn-2.7/openvpn.8.html).
If you want to run multiple VPN clients on the same host, it is advisable to also add 'nobind' to your configuration file. This makes OpenVPN use a random client side port when connecting. Without it, it will use the same port number as used to connect to the server.
@@ 69,17 63,10 @@
local 192.168.100.1
```
- Please do note that the OpenVPN server **can not** listen to multiple incoming ports, neither multiple protocols. You need separate OpenVPN instances for tackling that.
-
- It is also possible to connect using IPv6. In the current 2.3 releases, you will need to replace `udp`, `tcp-client` or `tcp-server` with `udp6`, `tcp6-client` or `tcp6-server` as the argument to the `--proto` option. From the OpenVPN 2.4, OpenVPN will try both IPv6 and IPv4 when just using `udp`/`tcp-client`/`tcp-server`. To enforce only IPv4-only, you need to use `udp4`, `tcp4-client` or `tcp4-server`; and similar to enforce IPv6-only with `udp6`/`tcp6-client`/`tcp6-server`.
-
-
## Configuring encryption
- OpenVPN can work in two different modes in regards to encryption. It can use static encryption or Public Key Infrastructure (PKI). In this How-To we will cover PKI encryption, as that is the most common way to use OpenVPN.
-
- The advantage of static encryption is that it is very easy to configure. The disadvantage of this type setup is that if your encryption key is compromised, all VPN data can easily be decrypted - even VPN data which has been captured in the past. It does not provide any type of perfect forward secrecy. And you need to ensure that the key is securely copied to both hosts. If you want to change the key, it must be changed on all clients. Last of all, static encryption also only allows a single connection to your server. How to configure static encryption can be found in the [Static Key Mini Howto](/StaticKeyMiniHowto).
+ OpenVPN can work in two different modes in regards to encryption. This guide will describe the way OpenVPN is commonly used, using Public Key Infrastricture (PKI). Newer OpenVPN releases also supports what is called `--peer-fingerprint`, which is a more lightweight setup than PKI. There are good examples for the `peer-fingerprint` approach in the [`openvpn-examples(5)` man-page](https://github.com/OpenVPN/openvpn/blob/master/doc/man-sections/example-fingerprint.rst).
- The PKI mode resolves many of these issues static encryption has. It allows multiple clients to connect to the same server, each client and server have separate keys. But it is more complex to set up. A PKI setup requires a Certificate Authority (CA). There exists plenty of alternatives for CA management. You should NOT go any where to buy yourself new certificates as that will make the VPN tunnel much less secure (unless you add extra authentication layers). In addition to that, a commercial certificate for OpenVPN does not provide you with any additional benefits. You will need to control your own CA for optimal security.
+ In PKI mode. it allows multiple clients to connect to the same server, where each client and server have separate keys. A PKI setup requires a Certificate Authority (CA), which issues certificates for both the server and clients. There exists plenty of alternatives for CA management. You should NOT go any where to buy yourself new certificates as that will make the VPN tunnel much less secure (unless you add extra authentication layers). In addition to that, a commercial certificate for OpenVPN does not provide you with any additional benefits. You will need to control your own CA for optimal security.
Setting up a proper CA is not covered in this How-To. But a good starting point will be to look at easy-rsa, in particular version 3.
https://github.com/OpenVPN/easy-rsa/blob/master/doc/EasyRSA-Readme.md
@@ 96,10 83,10 @@
The server in addition needs a DH parameters file. This can be generated by using the OpenSSL:
```
- $ openssl dhparam -out dh2048.pem 2048
+ $ openssl dhparam -out dh4096.pem 4096
```
- The 2048 indicates how many bits the DH prime number should consist of. The value of 2048 bits should in most cases be secure enough (as of October 2015), but it is ideal to have the DH prime number length to match the length of the RSA key. So if your key is 4096 bits, it is advisable to have 4096 bits DH parameters.
+ The 4096 indicates how many bits the DH prime number should consist of. The value of 4096 bits should in most cases be secure enough (as of October 2025), but it is ideal to have the DH prime number length to match the length of the RSA key.
BEWARE:
You should avoid generating keys on any devices which does not have a good entropy source for random data. This includes most of the common wifi routers and similar embedded devices. In many cases virtual machines also does not have a good entropy source or it can be manipulated by the hypervisor. Try as far as possible to generate keys and DH parameters on bare-metal equipment.
@@ 115,7 102,7 @@
key server-key.pem
cert server-crt.pem
ca ca-crt.pem
- dh dh2048.pem
+ dh dh4096.pem
remote-cert-eku "TLS Web Client Authentication"
```
@@ 147,7 134,7 @@
Those ciphers which are listed with '(variable)' in the output can have a variable key length, controlled by the --keysize option.
- **WARNING:** By default OpenVPN does currently use the Blowfish cipher, but that is now discouraged due to general issues with Blowfish, RC4, CAST5 and DES/3DES. If you need to use any of these weaker algorithms, do at least consider to add `--reneg-bytes 64000000` to your configuration. If your server version is >= 2.3.14 or 2.4.1 this will be done for you. For more information see [wiki:SWEET32].
+ **WARNING:** By default OpenVPN used the Blowfish cipher, but that is discouraged due to general issues with Blowfish, RC4, CAST5 and DES/3DES. (See [wiki:SWEET32] for details) OpenVPN 2.6 and newer will negotiate the best encryption cipher both sides supports.
To use the preferred AES-GCM algorithm with 256 bits encryption, add this line to both client and server configs:
@@ 236,9 223,9 @@
### Even stricter certificate checks
- It is also possible through a plug-in or the --tls-verify script hook to add additional checks on certificates. This can also protect you somewhat better if you loose control over your CA private key, if you check the client certificate's finger print/digest against a local database you have collected.
+ It is also possible through a plug-in or the `--tls-verify` script hook to add additional checks on certificates. This can also protect you somewhat better if you loose control over your CA private key, if you check the client certificate's finger print/digest against a local database you have collected.
- For client configurations you can also easily add --verify-x509-name, where you provide for example the certificate subject of the server. This will ensure that only a server who identifies itself as a particular server will be accepted. For example like this:
+ For client configurations you can also easily add `--verify-x509-name`, where you provide for example the certificate subject of the server. This will ensure that only a server who identifies itself as a particular server will be accepted. For example like this:
```
verify-x509-name 'C=US, O=Test CA, CN=myvpn.example.com' subject
@@ 267,7 254,7 @@
First we need to setup a virtual network device. OpenVPN supports two types of such devices, TUN and TAP. The difference is that TUN only
passes TCP/IP traffic and does not provide any broadcast traffic across the VPN tunnel. This provides a fairly efficient tunnel with the lowest overhead. For more advanced setups the TAP device may be used, which is also able to transport other protocols than just TCP/IP. TAP mode transports Ethernet frames instead of just IP packets.
- So there are many ways to configure the network layer in OpenVPN. The general recommendation, and the one we will cover here, is what is often called "routed tun". That means we use a tun device and use traditional TCP/IP routing techniques. For an overview of TAP mode and bridging vs routing, see the [Bridging and Routing](/BridgingAndRouting) page for more information.
+ So there are many ways to configure the network layer in OpenVPN. The general recommendation, and the one we will cover here, is what is often called "routed tun". That means we use a tun device and use traditional TCP/IP routing techniques. For an overview of TAP mode and bridging vs routing, see the [Bridging and Routing](/Pages/BridgingAndRouting) page for more information.
To configure a tun device, just add this line to both client and server configurations:
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9