
What you need
- A Linux server with a public IP.
- Half an hour.
- A decision about the gate: UDP 1194 is fast, TCP 443 gets through.
1. Appoint the issuer
sudo apt install easy-rsa
make-cadir ~/ca && cd ~/ca
./easyrsa init-pki
./easyrsa build-caYou will be asked for a password. That password and pki/private/ca.key are the seal of the whole city.
2. Stamp the first papers
./easyrsa build-server-full server nopass
./easyrsa build-client-full laptop nopass
./easyrsa gen-crl
openvpn --genkey tls-crypt tc.key3. Configure the server
port 1194
proto udp
dev tun
topology subnet
server 10.9.0.0 255.255.255.0
ca ca.crt
cert server.crt
key server.key
dh none
tls-crypt tc.key
crl-verify crl.pem
remote-cert-tls client
data-ciphers AES-256-GCM:CHACHA20-POLY1305:AES-128-GCM
keepalive 10 60
persist-tun
user nobody
group nogroupPut ca.crt, server.crt, server.key, crl.pem and tc.key in the same folder.
4. Open the gate
sudo ufw allow 1194/udp
sudo systemctl enable --now openvpn-server@server
sudo systemctl status openvpn-server@serverOn a cloud server also allow UDP 1194 in the security group.
5. Make an .ovpn
Get the skeleton from the profile maker, then paste in four pieces: ca.crt, laptop.crt, laptop.key, tc.key. Import it into the client. When the log says Initialization Sequence Completed, you are through.
Is something missing with dh none?
No. Keys are now exchanged on elliptic curves and the dh file is no longer needed.
How long do certificates last?
easy-rsa defaults to 825 days for clients and servers and ten years for the CA. Put it in your calendar.
Walk onImport a profile