هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
OpenVPN builds a tunnel over UDP or TCP (default 1194/udp, or 443/tcp to pass strict firewalls). Authentication uses a PKI: a CA, a server certificate and one certificate per client (made with easy-rsa), optionally plus username/password or MFA. Configs are .conf (server) and .ovpn (client, can contain the certificates inline). It is older and slower than WireGuard, but very common in companies and works almost everywhere.
طريقة الكتابة
openvpn --config FILE
systemctl start openvpn-server@NAME | openvpn-client@NAMEالأجزاء الرئيسية
Server config keys
port/proto/dev- 1194, udp|tcp, tun.
ca/cert/key/dh- PKI files.
tls-cryptFILE- Encrypt and protect the control channel.
server10.8.0.0255.255.255.0- VPN address pool.
push"route…"- Routes for clients.
data-ciphersAES-256-GCM:CHACHA20-POLY1305- Allowed ciphers.
usernobody/groupnobody- Drop root after start.
crl-verifyFILE- Revoked clients list.
الخيارات 4
الأكثر استخدامًا
Command flags
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Install (EPEL) and make a PKI with easy-rsa
2Make the tls-crypt key
openvpn --genkey tls-crypt /etc/openvpn/server/tc.key3A small server config
cat /etc/openvpn/server/vpn.conf port 1194 proto udp dev tun ca ca.crt cert vpn1.crt key vpn1.key dh none tls-crypt tc.key server 10.8.0.0 255.255.255.0 push "route 192.168.122.0 255.255.255.0" data-ciphers AES-256-GCM:CHACHA20-POLY1305 user nobody group nobody persist-key persist-tun crl-verify crl.pem4Open the firewall and start
firewall-cmd --permanent --add-service=openvpn --add-masquerade && firewall-cmd --reload systemctl enable --now openvpn-server@vpn5Check connected clients
cat /run/openvpn-server/status-vpn.log journalctl -u openvpn-server@vpn -n 306Client file (inline certs)
head -8 laptop-hosam.ovpn client dev tun proto udp remote vpn.example.com 1194 remote-cert-tls server <ca> -----BEGIN CERTIFICATE-----7Connect from Linux
openvpn --config laptop-hosam.ovpn nmcli connection import type openvpn file laptop-hosam.ovpn8Remove a lost laptop (revoke)
9Check certificate expiry
openssl x509 -in /etc/openvpn/server/vpn1.crt -noout -enddate10Make a new client for a colleague
لا يوجد شيء يطابق هذا الفلتر.
انتبه
- Keep the CA private key offline if you can; whoever has it can make valid clients.
- Without
crl-verify, revoked clients can still connect. - Do not use
comp-lzo/compression (VORACLE attack) and old ciphers (BF-CBC).
الملفات
/etc/openvpn/server/- Server configs and keys.
/etc/openvpn/easy-rsa/pki/- The PKI (CA key!).
نصائح للحفظ
- For new small setups WireGuard is simpler; OpenVPN is good when you need TCP/443 or existing clients.
رموز الخروج
0 | Success. |
1 | Error. |