networking:openvpn:openvpn-setup
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| networking:openvpn:openvpn-setup [2026/11/28 09:29] – oscar | networking:openvpn:openvpn-setup [2026/11/28 10:08] (current) – [Deploy Certificates & Keys] oscar | ||
|---|---|---|---|
| Line 52: | Line 52: | ||
| </ | </ | ||
| - | ===== 2. Create own CA certificate ===== | + | ===== Create own CA certificate ===== |
| Create CA certificate by running `easyrsa build-ca`. It asks to enter information that will be incorporated into your certificate request. | Create CA certificate by running `easyrsa build-ca`. It asks to enter information that will be incorporated into your certificate request. | ||
| < | < | ||
| Line 71: | Line 71: | ||
| </ | </ | ||
| ===== Create Server Certificate & Key ===== | ===== Create Server Certificate & Key ===== | ||
| - | Creating a server key and certificate is a 2-step easyrsa: | + | Creating a server key and certificate is done in 2-steps with `easyrsa`: |
| - `gen-req` generates a private key and a sign request (CSR) | - `gen-req` generates a private key and a sign request (CSR) | ||
| - `sign-req` uses the CA key and certificate to issue a signed public certificate | - `sign-req` uses the CA key and certificate to issue a signed public certificate | ||
| Line 108: | Line 108: | ||
| * Signs with the CA using your CA private key and CA certificate (// | * Signs with the CA using your CA private key and CA certificate (// | ||
| - | ===== 4. Generating Diffie-Hellman (DH) params ===== | + | ===== Generating Diffie-Hellman (DH) params ===== |
| The Diffie–Hellman (DH) Algorithm is a key-exchange protocol that enables two parties communicating over public channel to establish a mutual secret without it being transmitted over the Internet. DH enables the two to use a public key to encrypt and decrypt their conversation or data using symmetric cryptography. | The Diffie–Hellman (DH) Algorithm is a key-exchange protocol that enables two parties communicating over public channel to establish a mutual secret without it being transmitted over the Internet. DH enables the two to use a public key to encrypt and decrypt their conversation or data using symmetric cryptography. | ||
| After initializing a PKI, any entity can create DH params that needs them. | After initializing a PKI, any entity can create DH params that needs them. | ||
| Line 123: | Line 123: | ||
| This may take a few minutes to complete. | This may take a few minutes to complete. | ||
| - | ===== 5. TLS-AUTH ===== | + | ===== TLS-AUTH ===== |
| The tls-auth directive adds an additional HMAC signature to all SSL/TLS handshake packets for integrity verification. Any UDP packet not bearing the correct HMAC signature can be dropped without further processing. The tls-auth HMAC signature provides an additional level of security above and beyond that provided by SSL/TLS. It can protect against:DoS attacks, port flooding, Port scanning, Buffer overflow vulnerabilities, | The tls-auth directive adds an additional HMAC signature to all SSL/TLS handshake packets for integrity verification. Any UDP packet not bearing the correct HMAC signature can be dropped without further processing. The tls-auth HMAC signature provides an additional level of security above and beyond that provided by SSL/TLS. It can protect against:DoS attacks, port flooding, Port scanning, Buffer overflow vulnerabilities, | ||
| Line 139: | Line 139: | ||
| ===== Create Client Certificate and Key Pair ===== | ===== Create Client Certificate and Key Pair ===== | ||
| + | Creating a Client key and certificate is done in 2-steps with `easyrsa`: | ||
| + | - `gen-req` generates a private key and a sign request (CSR) | ||
| + | - `sign-req` uses the CA key and certificate to issue a signed public certificate | ||
| - | n this step, you will first generate the client key and certificate pair. If you have more than one client, you can repeat this process for each one. Please note, though, that you will need to pass a unique name value to the script for every client. Throughout this tutorial, the first certificate/ | + | === Generate client private key === |
| + | In this step, you will first generate the client key and certificate pair. If you have more than one client, you can repeat this process for each one. Please note, though, that you will need to pass a unique name value to the script for every client. Throughout this tutorial, the first certificate/ | ||
| + | < | ||
| + | $ / | ||
| + | -------------------------------------------------------- | ||
| - | $ easyrsa gen-req MyClientName | + | Notice |
| + | ------ | ||
| + | Private-Key and Public-Certificate-Request files created. | ||
| + | Your files are: | ||
| + | * req: / | ||
| + | * key: / | ||
| + | </ | ||
| + | This will: | ||
| + | * Generate a private key (// | ||
| + | * Creates a certificate signing request (// | ||
| + | * nopass | ||
| - | This will create a private key for the client and a certificate request file called | + | === Sign client key === |
| - | + | This will create a private key for the client and a certificate request file called | |
| - | $ easyrsa sign-req | + | < |
| + | $ / | ||
| + | --------------------------------------------------------- | ||
| + | Notice | ||
| + | ------ | ||
| + | Certificate created at: | ||
| + | * / | ||
| + | </ | ||
| In the output, you’ll be asked to verify that the request comes from a trusted source. Type yes and press ENTER to confirm this. | In the output, you’ll be asked to verify that the request comes from a trusted source. Type yes and press ENTER to confirm this. | ||
| - | | + | This will: |
| + | * Reads the request from // | ||
| + | * Applies the client profile/ | ||
| + | * Signs with the CA using your CA private key and CA certificate (// | ||
| | | ||
| ===== Deploy Certificates & Keys ===== | ===== Deploy Certificates & Keys ===== | ||
| Line 159: | Line 187: | ||
| |ca.key |key signing machine only |Root CA key |YES| | |ca.key |key signing machine only |Root CA key |YES| | ||
| |dh2048.pem |server only |Diffie Hellman parameters |NO| | |dh2048.pem |server only |Diffie Hellman parameters |NO| | ||
| - | |MyServerName.crt |server only |Server Certificate |NO| | + | |myvpnserver.crt |server only |Server Certificate |NO| |
| - | |MyServerName.key |server only |Server Key |YES| | + | |myvpnserver.key |server only |Server Key |YES| |
| - | |MyClientName.crt |client1 only |Client1 Certificate |NO| | + | |myvpnclient.crt |client1 only |Client1 Certificate |NO| |
| - | |MyClientName.key |client1 only |Client1 Key |YES| | + | |myvpnclient.key |client1 only |Client1 Key |YES| |
| === Server Deployment === | === Server Deployment === | ||
| Line 178: | Line 206: | ||
| - **ca.cert** --> insert contents --> between the < | - **ca.cert** --> insert contents --> between the < | ||
| - | - **MyClientName.key** --> insert contents --> between the < | + | - **myvpnclient.key** --> insert contents --> between the < |
| - | - **MyClientName.crt** --> insert contents --> between the < | + | - **myvpnclient.crt** --> insert contents --> between the < |
| - **ta.key** --> insert contents --> between the < | - **ta.key** --> insert contents --> between the < | ||
networking/openvpn/openvpn-setup.1795858172.txt.gz · Last modified: by oscar
