OpenVPN Road Warrior Installer
August 3, 2026 ยท View on GitHub
OpenVPN Road Warrior Installer
โก A production-ready OpenVPN deployment script featuring automated installation, dual-stack IPv4/IPv6 support, hardened security defaults, and an integrated Unbound recursive DNS resolver.
๐ OpenVPN Road Warrior Installer enables you to deploy a secure, production-ready OpenVPN server in under a minuteโeven with no prior VPN administration experience.
Designed to be minimal, non-intrusive, and security-focused, the script automates the entire deployment process, including PKI generation, firewall configuration, routing, DNS integration, and client provisioning, allowing you to bring a fully functional VPN server online with minimal effort.
Table of Contents
- Supported Distributions
- Requirements
- Quick Start
- Key Features
- Extended DNS Options
- Post-Installation Management
- Security Hardening Defaults
- Changelog
- Support & Donation
- License
Supported Distributions
| ๐ง Distribution | โ๏ธ Minimum Version | ๐ฆ Repository Channel |
|---|---|---|
| Ubuntu | 22.04 LTS | Official OpenVPN APT |
| Debian | 11 (Bullseye) | Official OpenVPN APT |
| AlmaLinux | 8 | Copr @OpenVPN/openvpn-release-2.6 |
| Rocky Linux | 8 | Copr @OpenVPN/openvpn-release-2.6 |
| CentOS / Stream | 8 | Copr @OpenVPN/openvpn-release-2.6 |
| Oracle Linux | 8 | Copr @OpenVPN/openvpn-release-2.6 |
| Fedora | Latest Stable | Distribution Native |
Note
โ ๏ธ Debian Testing and Debian Unstable (Sid) are currently not supported to maintain installation predictability.
Requirements
- ๐ค Superuser privileges (
rootorsudo) - ๐ An active network interface with a global IPv4/IPv6 address
- ๐ TUN device enabled on the host (
/dev/net/tun) - โก A systemd-based Linux distribution
- ๐ Bash โฅ 4.0
Quick Start
Choose one of the installation options below to begin the interactive setup:
๐ Option 1: Maintained Version (Recommended)
This version is maintained by alsyundawy and includes all the features listed in this repository (e.g., dual-stack IPv4/IPv6, extended DNS options, security hardening, colorized output, and enhanced client management).
Using wget:
wget https://raw.githubusercontent.com/alsyundawy/OpenVPN-Install/refs/heads/master/openvpn-install.sh \
-O openvpn-install.sh && sudo bash openvpn-install.sh
Using curl:
curl -O https://raw.githubusercontent.com/alsyundawy/OpenVPN-Install/refs/heads/master/openvpn-install.sh \
&& sudo bash openvpn-install.sh
โ Option 2: Original Creator's Version (Nyr)
This runs the original script (openvpn-install-nyr.sh) by Nyr.
Using wget:
wget https://raw.githubusercontent.com/alsyundawy/OpenVPN-Install/refs/heads/master/openvpn-install-nyr.sh \
-O openvpn-install-nyr.sh && sudo bash openvpn-install-nyr.sh
Using curl:
curl -O https://raw.githubusercontent.com/alsyundawy/OpenVPN-Install/refs/heads/master/openvpn-install-nyr.sh \
&& sudo bash openvpn-install-nyr.sh
๐ The script will guide you through:
- Selecting the primary network interface (IPv4 / IPv6).
- Choosing the transport protocol (UDP is highly recommended, or TCP).
- Defining the listening port (default:
1194). - Selecting your preferred DNS resolver.
- Providing the initial client name.
๐พ Upon completion, the installer saves a client configuration file (.ovpn)
directly to the script directory.
๐ฑ OpenVPN Client Applications
Once the installation completes, the installer automatically generates a client configuration profile (.ovpn) in the same directory where the installation script was executed.
The generated .ovpn file contains everything required to establish a secure VPN connection, including the server configuration, certificates, cryptographic parameters, and client settings.
Simply download one of the recommended OpenVPN clients below, import the generated .ovpn profile, and connect securely to your VPN server.
Tip
๐ก The generated .ovpn profile is fully compatible with:
- ๐ช OpenVPN Connect
- ๐ช OpenVPN GUI
- ๐ Tunnelblick
- ๐ Viscosity
- ๐ง OpenVPN 3 Linux
- ๐ง NetworkManager OpenVPN
- ๐ง KDE Plasma NetworkManager
- ๐ MikroTik RouterOS v7 (.ovpn Import)
๐ช Windows
โญ Recommended Client
OpenVPN Connect (Official)
Official download
Supported operating systems
- Windows 11
- Windows 10
- Windows Server 2022
- Windows Server 2019
โจ Features
- Official OpenVPN client
- Easy
.ovpnimport - Automatic profile management
- Automatic updates
- Modern user interface
- Multi-profile support
๐ Alternative Client
OpenVPN GUI (Open Source)
GitHub
https://github.com/OpenVPN/openvpn-gui
Recommended for users who prefer a lightweight native Windows client.
Features
- Completely free
- Open source
- Small footprint
- Multiple VPN profiles
- System tray integration
- Auto-connect support
๐ฅ Import .ovpn using OpenVPN Connect
- ๐ Download the generated
.ovpnprofile. - ๐ฆ Install OpenVPN Connect.
- ๐ Launch the application.
- โ Click Add Profile.
- ๐ Select Upload File.
- ๐ Choose your generated
.ovpn. - ๐ Enter your VPN username and password (if required).
- ๐พ Save the profile.
- โ Click Connect.
Tip
You can also drag and drop the .ovpn file directly into OpenVPN Connect on Windows.
๐ฅ Import .ovpn using OpenVPN GUI
- Install OpenVPN GUI.
- Open the application.
- Select Import โ Import File.
- Choose your
.ovpnfile. - Wait until the profile is successfully imported.
- Right-click the OpenVPN tray icon.
- Select the imported profile.
- Click Connect.
Alternatively, copy the .ovpn file into:
C:\Users\<username>\OpenVPN\config\
or
C:\Program Files\OpenVPN\config\
The profile will automatically appear inside OpenVPN GUI after restarting or rescanning the configuration directory.
๐ macOS
โญ Recommended Client
OpenVPN Connect (Official)
Download
Supported versions
- macOS Sequoia
- macOS Sonoma
- macOS Ventura
- Apple Silicon
- Intel Macs
๐ Free & Open Source
Tunnelblick
Website
Tunnelblick is the most popular free OpenVPN client for macOS and is fully compatible with standard .ovpn profiles.
Features
- Free
- Open Source
- Native macOS integration
- Automatic certificate management
- Supports multiple VPN profiles
๐ผ Commercial Alternative
Viscosity
Website
https://www.sparklabs.com/viscosity/
Features
- Modern interface
- Advanced routing
- DNS management
- Connection statistics
- Automatic reconnect
๐ฅ Import .ovpn using OpenVPN Connect
- Install OpenVPN Connect.
- Open the application.
- Click Upload File.
- Select your
.ovpn. - Enter credentials if requested.
- Save.
- Connect.
๐ฅ Import .ovpn using Tunnelblick
- Install Tunnelblick.
- Double-click the generated
.ovpn. - Choose Install for Me or Install for All Users.
- Approve the installation.
- Enter your macOS administrator password if requested.
- Click Connect.
๐ฅ Import .ovpn using Viscosity
- Open Viscosity.
- Navigate to
Preferences. - Select
Connections. - Click
+. - Choose
Import Connection โ From File.... - Select the
.ovpnprofile. - Save.
- Connect.
๐ง Linux
โญ Official Client
OpenVPN 3 Linux
Download
๐ฅ๏ธ Recommended GUI Clients
The following desktop environments support importing .ovpn files using NetworkManager.
- GNOME
- KDE Plasma
- Cinnamon
- XFCE
- MATE
- Budgie
- Unity
๐ข GNOME Desktop
Install
sudo apt update
sudo apt install network-manager-openvpn network-manager-openvpn-gnome
Import: Settings โ Network โ VPN โ + โ Import from File โ Select your .ovpn profile โ Connect
๐ต KDE Plasma
Install
sudo apt update
sudo apt install plasma-nm network-manager-openvpn
Import: System Settings โ Network โ Connections โ Add VPN โ Import VPN Connection โ Select .ovpn
โ๏ธ Import Using NetworkManager CLI
nmcli connection import type openvpn file client.ovpn
List imported connections
nmcli connection show
Connect
nmcli connection up client
The imported profile is stored as a NetworkManager connection, allowing you to manage it from your desktop environment.
๐ป Command Line (OpenVPN)
Install OpenVPN
Debian / Ubuntu
sudo apt update
sudo apt install openvpn
Fedora
sudo dnf install openvpn
RHEL / AlmaLinux / Rocky Linux
sudo dnf install openvpn
Connect
sudo openvpn --config client.ovpn
Disconnect: press CTRL + C
๐ผ Commercial Client
Viscosity
https://www.sparklabs.com/viscosity/
Supports Linux and provides an easy graphical interface for importing .ovpn files.
๐ Connect to OpenVPN Using .ovpn on MikroTik RouterOS
Starting with RouterOS v7.12, MikroTik supports importing an OpenVPN client configuration directly from a standard .ovpn file. This greatly simplifies deployment by automatically importing supported VPN parameters, certificates, and authentication settings. For the best compatibility and latest OpenVPN improvements, use the latest stable RouterOS v7 release.
Important
โ
RouterOS v7.12 or later is required for .ovpn import.
โญ The latest stable RouterOS v7 release is strongly recommended.
๐ Requirements
Before importing your VPN profile, make sure you have:
- โ MikroTik RouterOS v7.12+
- โ WinBox, WebFig, or SSH access
- โ
Generated
.ovpnprofile - โ VPN username
- โ VPN password
- โ Correct date and time
- โ NTP synchronization enabled
Tip
TLS certificate validation depends on the router's system clock. Always enable NTP before connecting to an OpenVPN server.
๐ Method 1 โ Import Using WinBox (Recommended)
Step 1 โ Upload the Profile
Open Files and drag and drop your generated client.ovpn into the router.
Step 2 โ Import the Profile
Open PPP โ OVPN โ Import, choose client.ovpn, enter Username and Password, then click Import.
RouterOS will automatically import supported configuration from the profile, including certificates, remote server settings, ciphers, authentication parameters, and TLS authentication when present. Supported parameters depend on the RouterOS version.
Step 3 โ Verify Import
Navigate to Interfaces โ OVPN Client. A new interface (e.g. ovpn-client) should appear. Enable it if necessary.
๐ป Method 2 โ Import Using CLI
Upload client.ovpn to the router, then import it:
/interface/ovpn-client/import-ovpn-configuration \
file-name=client.ovpn \
ovpn-user=myuser \
ovpn-password=mypassword \
skip-cert-import=no
If the client private key is protected:
/interface/ovpn-client/import-ovpn-configuration \
file-name=client.ovpn \
ovpn-user=myuser \
ovpn-password=mypassword \
key-passphrase=myPrivateKeyPassword
โถ Enable the VPN
List interfaces
/interface/ovpn-client/print
Enable
/interface/ovpn-client/enable 0
Replace 0 with your interface number if different.
๐ Monitor Connection Status
/interface/ovpn-client/monitor 0
Example output
status: connected
uptime: 00:25:42
local-address: 172.16.200.2
remote-address: 172.16.200.1
Show details
/interface/ovpn-client/print detail
A connected interface displays the R flag.
๐ Route Internet Traffic Through VPN
Automatically install the default route
/interface/ovpn-client
set 0 add-default-route=yes
Use DNS servers provided by the VPN
/interface/ovpn-client
set 0 use-peer-dns=yes
Verify routing
/ip/route/print
๐งช Verify Connectivity
Ping Cloudflare DNS
/tool/ping 1.1.1.1
Ping Google DNS
/tool/ping 8.8.8.8
Check default routes
/ip/route/print
View DNS configuration
/ip/dns/print
๐ Security Recommendations
- โ Always keep RouterOS updated.
- โ Enable automatic NTP synchronization.
- โ
Verify the server certificate whenever possible (
verify-server-certificate=yes). - โ Generate a unique VPN profile for each router.
- โ
Protect exported
.ovpnfiles because they may contain certificates and private keys. - โ Disable unused VPN profiles.
โ RouterOS OpenVPN Limitations
RouterOS implements its own OpenVPN client and does not support every OpenVPN directive.
Current notable limitations include:
- โ Some OpenVPN directives are unsupported.
- โ LZO compression is not supported and should not be used.
- โ ๏ธ Compatibility depends on the RouterOS version.
- โ UDP and TCP are supported in modern RouterOS v7 releases.
- โ
TLS authentication can be imported from supported
.ovpnprofiles.
For the latest supported directives and client capabilities, consult the official MikroTik OpenVPN documentation.
Note
This installer generates standard OpenVPN client profiles designed to work with current RouterOS v7 .ovpn import functionality. If your VPN profile uses unsupported directives, RouterOS may ignore them or require manual adjustment according to the official MikroTik documentation.
โ Verify VPN Connection
After successfully connecting to your VPN, verify that your traffic is actually routed through the encrypted tunnel.
๐ Check Your Public IP Address
Linux / macOS
curl ifconfig.me
or
curl https://icanhazip.com
Windows (PowerShell)
curl ifconfig.me
or
Invoke-RestMethod https://icanhazip.com
Verify
The returned public IP address should be your VPN server's public IP address, not your local ISP's address.
๐ Check Your Location
Visit one of the following websites:
Verify:
- โ Public IP
- โ Country
- โ ASN
- โ ISP
๐ก๏ธ Test for DNS Leaks
Visit https://dnsleaktest.com or https://browserleaks.com/dns
Expected result
- Only your VPN DNS servers should appear.
- Your ISP DNS servers should NOT be visible.
๐ Test IPv6
If your VPN server supports IPv6, verify that IPv6 traffic is also routed through the VPN.
Visit https://test-ipv6.com
Expected
- โ IPv6 Reachability
- โ No IPv6 Leak
๐ Verify the VPN Tunnel
Check your routing table.
Linux
ip route
IPv6
ip -6 route
macOS
netstat -rn
Windows
route print
The default route should point to the VPN tunnel when full-tunnel mode is enabled.
๐ Verify DNS Resolution
Linux / macOS
dig openvpn.net
or
nslookup openvpn.net
Windows
nslookup openvpn.net
DNS queries should succeed using the DNS server provided by your VPN configuration.
๐ Verify VPN Interface
Linux
ip addr
Look for tun0 or tun1
macOS
ifconfig
Look for utun
Windows
ipconfig
Look for an OpenVPN TAP Adapter or OpenVPN Data Channel Offload Adapter depending on the installed client.
๐จ Troubleshooting
Authentication Failed
Possible causes
- Incorrect username
- Incorrect password
- Revoked certificate
- Expired certificate
Solution
- Verify your credentials.
- Regenerate a new
.ovpnprofile if necessary. - Contact your VPN administrator.
TLS Handshake Failed
Possible causes
- Incorrect system time
- Firewall blocking VPN traffic
- Wrong server hostname
- Invalid certificate
Recommended checks
- Verify the server address.
- Ensure UDP/TCP ports are reachable.
- Synchronize your system clock using NTP.
- Check the VPN client log for TLS or certificate errors.
DNS Leak
Possible causes
- Local DNS still in use
- Split DNS configuration
- VPN DNS not pushed correctly
Solution
- Reconnect.
- Flush the DNS cache.
- Verify DNS settings.
- Use the Local Unbound DNS option provided by this installer.
Unable to Import .ovpn
Possible causes
- Corrupted profile
- Unsupported directives
- Incorrect file encoding
Solution
- Generate a new profile.
- Download the file again.
- Update your VPN client to the latest version.
Connection Drops Frequently
Possible causes
- Unstable Internet connection
- Firewall interruption
- Idle timeout
- Network changes (Wi-Fi โ Ethernet)
Recommended actions
- Use the latest OpenVPN Connect version.
- Enable automatic reconnect.
- Review the client log for timeout or authentication errors.
๐ Security Best Practices
- ๐ Generate a unique
.ovpnprofile for every user and every device. - ๐ซ Never share
.ovpnfiles publicly. - ๐ Store VPN profiles in a secure location.
- ๐๏ธ Revoke compromised certificates immediately.
- ๐ Rotate client certificates periodically.
- ๐ Use strong passwords for accounts requiring username/password authentication.
- ๐ Keep the client operating system updated.
- โฌ๏ธ Keep your OpenVPN client updated.
- ๐ Enable automatic NTP synchronization.
- ๐ก๏ธ Use the Local Unbound DNS option for maximum privacy whenever possible.
- ๐ฅ Allow only the required VPN ports through your firewall.
- ๐ค Grant VPN access only to trusted users.
๐ Additional Resources
๐ Official OpenVPN Documentation
https://openvpn.net/community-resources/
๐ OpenVPN Connect User Guide
https://openvpn.net/connect-docs/
๐ฌ OpenVPN Community
๐ Report Issues
If you encounter a bug or have a feature request, please open an issue on GitHub.
https://github.com/alsyundawy/OpenVPN-Install/issues
โญ Support the Project
If this project has helped you, please consider:
- โญ Starring the repository
- ๐ด Forking the project
- ๐ Reporting bugs
- ๐ก Suggesting new features
- โค๏ธ Sponsoring development
Your support helps improve this project for the entire OpenVPN community.
Tip
Always download VPN client software from the official vendor, keep your .ovpn profile private, and periodically verify your public IP address, DNS servers, and routing after connecting to ensure all traffic is passing through the VPN tunnel as expected.
Key Features
- โก Official Repository Integration: Configures official OpenVPN repositories dynamically for Debian/Ubuntu and RHEL-based systems to ensure you run the stable 2.6.x branch instead of outdated packages.
- ๐ Full Dual-Stack IPv4/IPv6 Routing: Automatic subnets mapping and address assignment for dual-stack hosts, with manual IPv6 fallback when auto-discovery does not detect a global IPv6 address.
- ๐ Hardened Cryptography: Uses standard RFC 7919
ffdhe2048Diffie-Hellman parameters (safe and instant generation), SHA-512 authentication, andtls-cryptpayload encryption keys. - ๐ก๏ธ Integrated Unbound Resolver: Provides a one-click local Unbound setup
with built-in DNS rebinding protection (RFC1918 + ULA), DNSSEC validation,
anti-spoofing (
use-caps-for-id), and strict caching rules. - ๐ฆ Idempotent Firewall Handlers: Safely configures
firewalldoriptables/nftablesservices. Direct rules are audited before insertion/removal to prevent duplicates and routing table pollution. - ๐ท๏ธ SELinux-Aware: Automatically checks SELinux enforcing states and updates
context policy labels for custom ports using
semanage. - ๐จ Colorized Output: Bright ANSI-colored terminal output with an enhanced interactive menu interface for improved readability.
- ๐ง Advanced Client Management: Add, renew, revoke, list certificates, and view connected clients โ all from a single management menu.
- ๐ก๏ธ Hardened Input Validation: Port range enforced (1โ65535), octal-safe
IPv4 arithmetic, robust IPv6 validation, and
EXIT/INT/TERMsignal trap for clean exit handling with automatic temporary file cleanup. - ๐ Atomic Operations: Client
.ovpngeneration and CRL updates use atomic temp-file-then-move patterns to guarantee consistency under concurrent access. - ๐งน Clean Uninstall: Full removal of firewall rules, SELinux labels, Unbound
config, systemd services, and all PKI data with
systemctl daemon-reloadpost-cleanup.
Extended DNS Options
๐ The script offers 36 pre-configured resolvers alongside system defaults and custom inputs:
- ๐ Local Resolver:
Local Unbound(Local caching resolver with DNSSEC)
- ๐ Global Anycast Resolvers:
Google Public DNS(Standard & IPv6)Cloudflare DNS(Standard, Security-filtered, or Family-filtered)Quad9 DNS(Secure, Unsecured, or ECS-supported)OpenDNS(Home or FamilyShield)
- ๐บ๏ธ Region-Specific & Alternative Resolvers:
AliDNS,DNSPod,114DNS,Baidu DNS,OneDNS,DNSPaiCleanBrowsing(Security, Adult, or Family filters)Verisign,DNS.WATCH,Yandex(Basic, Safe, or Family)Level3/Lumen,Neustar(Default, Threat, or Family)Oracle Dyn,Alternate DNS,Comodo Secure DNS,Freenom World
- โ๏ธ Custom Input:
- Accepts multiple comma/space-separated IPv4 and IPv6 addresses.
โก The script presents 37 DNS choices during setup:
| # | Provider | Primary | Notes |
|---|---|---|---|
| 1 | Local Unbound | 172.16.200.1 | DNSSEC + DNS rebind protection |
| 2 | Current system resolvers | โ | Parsed from /etc/resolv.conf |
| 3 | 8.8.8.8 | IPv4 + IPv6 | |
| 4 | Cloudflare Standard | 1.1.1.1 | IPv4 + IPv6 |
| 5 | Cloudflare Security | 1.1.1.2 | Malware filtering |
| 6 | Cloudflare Family | 1.1.1.3 | Adult content filtering |
| 7 | Quad9 Secure | 9.9.9.9 | Threat blocking |
| 8 | Quad9 Unsecured | 9.9.9.10 | No filtering |
| 9 | Quad9 ECS | 9.9.9.11 | ECS-enabled |
| 10 | OpenDNS Home | 208.67.222.222 | IPv4 + IPv6 |
| 11 | OpenDNS FamilyShield | 208.67.222.123 | Family filter |
| 12 | AdGuard Default | 94.140.14.14 | Ad blocking + IPv6 |
| 13 | AdGuard Family | 94.140.14.15 | Family filter |
| 14 | AdGuard Non-Filtering | 94.140.14.140 | No filtering |
| 15 | AliDNS | 223.5.5.5 | IPv4 + IPv6 |
| 16 | DNSPod | 119.29.29.29 | โ |
| 17 | 114DNS | 114.114.114.114 | โ |
| 18 | Baidu DNS | 180.76.76.76 | โ |
| 19 | OneDNS | 117.50.10.10 | โ |
| 20 | DNSPai | 101.226.4.6 | โ |
| 21 | CleanBrowsing Security | 185.228.168.9 | IPv4 + IPv6 |
| 22 | CleanBrowsing Adult | 185.228.168.10 | IPv4 + IPv6 |
| 23 | CleanBrowsing Family | 185.228.168.168 | IPv4 + IPv6 |
| 24 | Verisign | 64.6.64.6 | โ |
| 25 | DNS.WATCH | 84.200.69.80 | IPv4 + IPv6 |
| 26 | Yandex Basic | 77.88.8.8 | IPv4 + IPv6 |
| 27 | Yandex Safe | 77.88.8.88 | Malware filtering |
| 28 | Yandex Family | 77.88.8.7 | Family filter |
| 29 | Level3 / Lumen | 209.244.0.3 | โ |
| 30 | Neustar Default | 156.154.70.1 | IPv4 + IPv6 |
| 31 | Neustar Threat Protection | 156.154.70.5 | IPv4 + IPv6 |
| 32 | Neustar Family Secure | 156.154.70.3 | โ |
| 33 | Oracle Dyn | 216.146.35.35 | โ |
| 34 | Alternate DNS | 198.101.242.72 | โ |
| 35 | Comodo Secure DNS | 8.26.56.26 | โ |
| 36 | Freenom World DNS | 80.80.80.80 | โ |
| 37 | Custom resolvers | User-defined | IPv4 and/or IPv6 |
Tip
Option 1 (Local Unbound) is recommended for maximum privacy โ it resolves DNS recursively on the server itself with DNSSEC validation and 0x20 encoding anti-spoofing.
Post-Installation Management
๐ง Run the script again at any time to access the administrative menu:
sudo bash openvpn-install.sh
OpenVPN is already installed.
Select an option:
1) Add a new client
2) Renew client configuration
3) Revoke an existing client
4) List client certificates
5) List connected clients
6) Remove OpenVPN
7) Exit
| ๐ Menu Option | ๐ ๏ธ Action Description |
|---|---|
| Add a new client | Validates name uniqueness, signs a new key pair, and generates the .ovpn profile atomically. |
| Renew client configuration | Regenerates the .ovpn file for an existing client without changing the certificate or key. |
| Revoke an existing client | Revokes the certificate with [y/N] confirmation, performs atomic CRL replacement, and removes the .ovpn file. |
| List client certificates | Displays all active (non-revoked) client certificate names from the PKI index. |
| List connected clients | Reads the OpenVPN status log or falls back to ss to show active VPN sessions. |
| Remove OpenVPN | Gracefully removes firewall rules (IPv4+IPv6 SNAT), SELinux labels, Unbound config, systemd services, PKI, and calls daemon-reload. |
Security Hardening Defaults
- ๐ก๏ธ Strict Permissions: The installer runs under a restrictive
umask 077and enforceschmod 600on private keys and client profiles. - ๐ฅ Least Privilege: The OpenVPN server daemon drops privileges to run as the
unprivileged user
nobodyand thenogroup/nobodysystem group after initialization. - ๐ง Anti-Leak Measures: Pushes
block-outside-dnspolicies to client devices to prevent DNS leakages outside the encrypted tunnel. - ๐ CRL Permissions: The Certificate Revocation List (
crl.pem) is owned and accessible specifically to the unprivileged OpenVPN daemon so dynamic revocation checks function without root. - ๐ฅ Firewall SNAT Hardening: Firewalld direct SNAT rules include the
! -ddestination guard to prevent masquerading VPN-to-VPN traffic, with correct regex matching for rule idempotency. - ๐ Port Validation: Port input is strictly validated within the full range of 1โ65535 to prevent misconfiguration.
- ๐ฆ Signal Trapping:
SIGINT,SIGTERM, andEXITare trapped for clean installer exit โ no orphaned processes, partial configurations, or broken terminal color states. - ๐ Atomic
.ovpnGeneration: Client config files are written to a temp file first (mktemp+chmod 600) then moved atomically to the final path to prevent partial writes. - ๐๏ธ Revocation Cleanup: Revoking a client immediately removes the
.ovpnfile to prevent re-use of revoked credentials. - ๐ Atomic CRL Replacement: CRL updates use
cp+mv -fto guarantee the livecrl.pemis never in an inconsistent state during rotation. - ๐ต Daemon Reload on Uninstall:
systemctl daemon-reloadis called after removing unit files to flush stale systemd cache entries.
Changelog
๐ [v2.0.3] - 2026-08-03
- ADD: IPv6 manual fallback โ when auto-discovery (
ip -o -6 addr show scope global) finds no global IPv6 address (IPv6 not yet bound, link-local only, or scoped differently), the installer now offers a manual IPv6 entry option so dual-stack can still be enabled instead of silently falling back to IPv4-only. - SEC: Consolidated signal trap handlers (
EXIT/INT/TERM) to reset terminal colors and clean up tracked temporary files via_TMP_FILESarray on any exit path โ no orphaned temp files or broken color states. - SEC: EasyRSA download now saves to a verified temporary file (
mktemp), validates it as a valid gzip tarball (tar -tzf) before extraction, preventing corrupt or partial archive installations. - SEC:
curlfallback for EasyRSA download now uses-fsSL(follow redirects, silent, SSL-verified, show errors) for stricter HTTP safety. - SEC: Atomic
.ovpngeneration โ client config is written to amktempfile withchmod 600then moved atomically to prevent partial writes or insecure intermediate states. - SEC: Atomic CRL replacement โ
cp+mv -fpattern ensurescrl.pemis never inconsistent during rotation, preventing VPN service disruption. - SEC: Exclude local loopback addresses (
127.0.0.1,::1) when parsing system resolvers. - FIX: Management menu โ Add client now checks for duplicate certificate name and prints a clear error message instead of silently failing.
- FIX: Management menu โ Revoke client now requires explicit
[y/N]confirmation before revoking, preventing accidental revocations. - FIX: Management menu โ Remove OpenVPN now calls
systemctl daemon-reloadafter removing unit files to flush stale systemd cache entries. - FIX: Management menu โ
semanage port -dduring uninstall now uses|| trueto prevent abort when the port label was never set. - FIX: Replace bare
|| exit 1oncdcalls with|| dieso trap cleanup always executes on early directory-change failures. - FIX: Remove unused
COLOR_WHITEandCOLOR_DIMvariables (ShellCheck SC2034). - FIX:
append_line_if_missingnow validates file existence and usesgrep --for end-of-options safety; annotated as intentionally unused (SC2317). - FIX: Correct firewalld direct rule removal regex โ includes
! -dguard for SNAT rules to properly match rules containing destination negation. - FIX: Remove client
.ovpnfile upon certificate revocation. - OPT: Centralize top-level menu logger definition and enhance terminal color trap cleanup.
- FIX: Harden IPv6 validation helper against invalid boundary colons.
- FIX: Improve EasyRSA URL parsing โ strip carriage return (
\r) characters from redirect headers for reliable version tag extraction. - FIX: Port validation now strictly enforces the full range 1โ65535.
- FIX: Improve
resolv.conffallback logic inpush_dnsfor edge-case system resolver configurations. - FIX: Dynamic subnet parsing during uninstallation.
- ADD: Colorized terminal output โ bright ANSI colors (
\033[1;9x) with dedicated log helpers:log_header,log_subheader,log_prompt,log_info,log_ok,log_warn,log_error. - ADD:
SIGINT/SIGTERM/EXITtrap for clean exit handling during installation. - ADD:
list_clientsโ displays all active client certificates from PKI index. - ADD:
list_connectedโ shows active VPN sessions via status log orss. - ADD:
renew_clientโ regenerates.ovpnbundle without modifying the certificate or key. - DOC: Updated DOCNOTE and inline CHANGELOG with complete management menu fix notes.
- LINT: ShellCheck 0 warnings, jscpd 0 duplicates, cspell 0 misspellings.
๐ [v2.0.2] - 2026-07-25
- CHG: Default IPv4 VPN subnet changed from
10.8.0.0/24to172.16.200.0/24. - CHG: Removed openSUSE and Arch Linux support to streamline distribution maintenance.
- FIX: Prevent bash octal arithmetic error in
is_valid_ipv4for numbers with leading zeroes. - FIX: Correct
firewalld_direct_rule_existspattern matching to handle priority prefix. - FIX: Add fallback path checking for
resolv.confsystem resolver parsing. - FIX: Sanitize carriage return (
\r) characters when parsing EasyRSA download headers. - FIX: Add robust fallback helper
generate_client_configfor client.ovpnbundle generation. - FIX: Dynamic subnet parsing during uninstallation for backward compatibility.
- OPT: Centralize client config generation logic and ensure strict ShellCheck compliance.
๐ ๏ธ [v2.0.1] - 2026-07-19
- ADD: Support for RHEL 8 base, AlmaLinux 8, Rocky Linux 8, and Oracle Linux 8.
- ADD: Dynamic EasyRSA version fetching to always use the latest release.
- FIX: Pacman and Zypper package uninstallation commands for Arch/openSUSE.
- FIX: Secure atomic CRL file replacement using
mvto prevent VPN dropouts. - FIX: Pre-delete old
.ovpnfiles to prevent writing to pre-existing insecure files. - FIX: Use
systemctl is-activeinstead ofpgrepfor reliable Unbound checks. - FIX: Avoid empty package arguments when firewall package is not needed.
- FIX: Harden IPv4 and IPv6 validation helpers for custom DNS input.
- FIX: Safer
/etc/os-releaseparsing without polluting shell state excessively. - FIX: Make firewalld direct rule insertion/removal more idempotent.
- FIX: Improve resolver parsing to support IPv6 system resolvers.
- FIX: Safer file permissions with
umask 077and explicitchmodoperations. - FIX: Guard command dependencies and common failure points consistently.
- OPT: Use
ip -ofor more stable address enumeration. - OPT: Centralize logging and helper routines.
- SEC: Reduce unsafe command handling and improve uninstall resilience.
๐ [v2.0.0] - 2026-07-19
- ADD: Official OpenVPN 2.6 repository integration (Debian/Ubuntu/RHEL/ Fedora).
- ADD: Extended DNS provider list โ 35 providers (options 2โ36): Google, Cloudflare (Standard/Security/Family), Quad9 (Secure/Unsecured/ECS), OpenDNS (Home/FamilyShield), AdGuard (Default/Family/Non-Filtering), AliDNS, DNSPod, 114DNS, Baidu DNS, OneDNS, DNSPai, CleanBrowsing (Security/Adult/Family), Verisign, DNS.WATCH, Yandex (Basic/Safe/Family), Level3/Lumen, Neustar (Default/Threat/Family), Oracle Dyn, Alternate DNS, Comodo Secure DNS, Freenom World DNS.
- ADD: IPv6 DNS push for dual-stack systems on all supported providers.
- ADD: Local Unbound resolver option (option 1) with DNSSEC hardening, DNS rebinding protection, and OpenVPN-specific configuration.
- ADD:
installOpenVPNRepo()function for official repository setup. - ADD:
installUnbound()function with per-distro package management. - ADD: Unbound systemd service validation with retry loop.
- FIX: ShellCheck SC2164 โ all
cdcalls guarded with|| exit. - FIX: ShellCheck SC2155 โ declare and assign separately.
- FIX: ShellCheck SC2086 โ double-quoting all variable expansions.
- FIX: ShellCheck SC2006 โ replaced backtick substitutions with
$(). - FIX: ShellCheck SC2166 โ use
[[ ]]for compound conditions. - FIX: Custom DNS input validation now also accepts IPv6 addresses.
- OPT: DNS case block replaced with array-driven
push_dns()helper. - OPT: Unbound restart validated with retry loop (up to 10 attempts).
- SEC: Unbound:
hide-identity,hide-version,harden-glue,harden-dnssec-stripped. - SEC: Unbound: DNS rebinding protection for RFC1918 + IPv6 ULA ranges.
- SEC: Unbound:
use-caps-for-id(0x20 encoding) anti-spoofing. - DOC: Updated header, feature list, usage, and inline comments.
๐ [v1.x] - Legacy
- Original Nyr/openvpn-install baseline implementation.
Support and Donation
โ If this project helps secure your network, please support the continued maintenance of the installer:
Nyr (Original Creator)
alsyundawy (Version Maintainer)
๐ฎ๐ฉ Scan QRIS (GoPay, OVO, Dana, LinkAja, Mobile Banking)
License
๐ This project is licensed under the terms of the MIT License.
- Copyright (c) 2013-2026 Nyr
- Copyright (c) 2026 alsyundawy