Network client installer

install_openvpn_client_anolis8.sh

Designed for Anolis OS 8 (RHEL 8 compatible) hosts that use username/password OpenVPN client authentication and need a repeatable way to install the package, place client files, attach DNS hooks, and start the systemd service. When the config files are not supplied, it still installs OpenVPN and prepares /etc/openvpn/client/ for you to add them later.

One-liner

curl -fsSL helper.sh/install_openvpn_client_anolis8.sh | sudo bash
sudo bash install_openvpn_client_anolis8.sh --source-conf ./client.conf --source-login ./login.txt

Requirements

  • Anolis OS 8
  • root privileges or sudo
  • Optional: client.conf in the current directory
  • Optional: login.txt in the current directory

Best for

  • Bring up an OpenVPN client quickly on a fresh Anolis OS 8 host
  • Standardize username/password client deployment for RHEL 8 compatible servers
  • Avoid manual errors when copying config files, DNS hooks, and service commands

Highlights

  • Imports the EPEL 8 GPG key before installing OpenVPN
  • Enables EPEL 8 via the distro epel-release, falling back to the Fedora epel-release-latest-8 rpm
  • Never fails when config files are missing: installs OpenVPN, creates /etc/openvpn/client/, and prompts you to drop the files in
  • Picks up client.conf and login.txt from the current directory, or reuses them if already placed in /etc/openvpn/client/
  • Installs OpenVPN with dnf and refreshes metadata with a 120s timeout guard
  • --no-dns option installs without touching DNS (no helper, no up/down hooks, /etc/resolv.conf left alone)
  • Installs /etc/openvpn/update-resolv-conf and adds up/down hooks automatically
  • Enables and restarts openvpn-client@client automatically

Recommended procedure

  1. Optionally put client.conf and login.txt in the current working directory; if you skip this, the script still installs OpenVPN and prepares /etc/openvpn/client/ for you to add them later.
  2. Run the helper.sh installer with sudo or as root.
  3. Let the script enable EPEL 8, install OpenVPN with dnf, copy the client files when present, install the DNS helper, and restart the OpenVPN client service.
  4. A healthy run should show [OK] epel-release installed, [OK] dnf metadata refreshed, [OK] OpenVPN installed, and [OK] openvpn-client@client is active.
  5. Review systemctl status, ip addr show tun0, curl ipinfo.im/ip, and cat /etc/resolv.conf to verify the tunnel and DNS state.

Safety notes

  • Keep login.txt protected with chmod 600 and do not commit it to Git.
  • Review the remote server address, routes, and credentials inside client.conf before copying it onto a production host.
  • If you disable full-tunnel mode with route-nopull, add only the network routes you actually need through the VPN.
  • If the service does not start, inspect journalctl before retrying multiple times.

Example output

Terminal output showing install_openvpn_client_anolis8.sh completing successfully and openvpn-client@client becoming active
A healthy Anolis OS 8 run should show epel-release installation, dnf metadata refresh, OpenVPN installation, DNS helper deployment, and an active openvpn-client@client service.

Scenario article

Install an OpenVPN client on Anolis OS 8 with login.txt auth and DNS helper hooks

A practical guide to using install_openvpn_client_anolis8.sh to enable EPEL 8, install OpenVPN with dnf, place client.conf and login.txt, deploy update-resolv-conf, and enable openvpn-client@client on Anolis OS 8.

Related topics

OpenVPN client access and DNS handling

Set up OpenVPN client access on Ubuntu and CentOS 7 hosts, keep login files in the expected place, and handle DNS switching safely when private domains depend on the tunnel.

Open topic