Skip to main content

Install OpenVPN on AlmaLinux 9.5

 To install OpenVPN on AlmaLinux 9.5, you can follow these steps:

1. Update the System:

Before installing any software, it's a good idea to update your system:


sudo dnf update -y

2. Install EPEL Repository:

OpenVPN is available in the EPEL (Extra Packages for Enterprise Linux) repository. First, install the EPEL repository:


sudo dnf install epel-release -y

3. Install OpenVPN:

After enabling the EPEL repository, install OpenVPN:


sudo dnf install openvpn -y

4. Install NetworkManager (Optional):

If you are using NetworkManager for managing network connections, you can install the OpenVPN plugin for NetworkManager:


sudo dnf install NetworkManager-openvpn -y

5. Configure OpenVPN:

Once installed, you need to configure OpenVPN by copying your .ovpn configuration file to the /etc/openvpn/ directory:


sudo cp /path/to/your/config.ovpn /etc/openvpn/

6. Start OpenVPN:

You can start OpenVPN by specifying the configuration file directly:


sudo openvpn --config /etc/openvpn/your_config.ovpn

If you want OpenVPN to run as a service, you can create a systemd service file as described in previous steps, or use the provided openvpn-client service unit with a slight modification to ensure it starts with the correct .ovpn file.

sudo chmod 644 /etc/openvpn/your_config.ovpn


In the [Install] section, add the WantedBy directive to ensure the service is started on boot. You can use multi-user.target, which is commonly used for services that should be started after the network is up.


Here's what the updated service file should look like:

sudo nano /etc/systemd/system/openvpn.service

[Unit]

Description=OpenVPN connection to %i

After=network.target

[Service]

Type=simple

ExecStart=/usr/sbin/openvpn --config /etc/openvpn/your_config.ovpn

Restart=on-failure

User=root

Group=root

[Install]

WantedBy=multi-user.target

Save and exit

This configuration ensures that OpenVPN starts when the system reaches the multi-user.target, which is the normal operating state for most systems.


Reload Systemd and Enable the Service:

After modifying the service file, reload the systemd configuration and enable the service to start at boot:

sudo systemctl daemon-reload

sudo systemctl enable openvpn.service

Start the Service:

If you haven't already started the service, use the following command to start it:


sudo systemctl start openvpn.service

Verify the Service is Enabled:

To confirm that the service is now enabled and will start on boot, run:

sudo systemctl is-enabled openvpn.service

7. Verify Connection:

You can verify if OpenVPN is running by checking the status:


sudo systemctl status openvpn.service

If you used a service file, make sure to reload systemd and restart the service:


sudo systemctl daemon-reload sudo systemctl restart openvpn.service

8. Troubleshooting:

If the OpenVPN service is not starting, you can check logs for any issues:


sudo journalctl -u openvpn.service

You can also check /var/log/messages or /var/log/openvpn.log (if logging is enabled in the configuration) for more detailed error information.

By following these steps, you should be able to install and configure OpenVPN on AlmaLinux 9.5. If you encounter any issues, let me know, and I'll help you troubleshoot further.

Comments

Popular posts from this blog

Vicidial Scratch installation Alma -9

Step 1 – Download the dependencies   hostnamectl set-hostname xxxxxx.xxxxx.xxx ### Use YOUR SubDomain vi /etc/hosts ##Change domain name for actual server ip (xxx.xxx.xxx.xxx   complete domain name    subdomain only) timedatectl set-timezone Asia/Kolkata yum check-update yum update -y yum -y install epel-release yum update -y yum install git -y yum install -y kernel* #Disable SELINUX sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config     reboot Step 2 – Run the Script cd /usr/src/ git clone https://github.com/manish23k/vicidial-install-scripts cd vicidial-install-scripts chmod +x alma-rocky9-ast16.sh ./alma-rocky9-ast16.sh Or the Asterisk 18 version: chmod +x alma-rocky9-ast18.sh ./alma-rocky9-ast18.sh

Vicidial Scratch installation Debian 11 with Asterisk 16, WebRTC and Dynamic Portal

  Vicidial Scratch installation Debian 11  Asterisk 16, WebRTC and Dynamic Portal apt update apt upgrade apt-get install git nano wget cd /usr/src/ git clone https://github.com/manish23k/Vici_Install_Scripts_Deb_11.git cd Vici_Install_Scripts_Deb_11/ chmod +x *.sh Run ./vici_install_deb_ast16.sh Install WebRTC ./vicidial-install-webrtc.sh Once Done with Configuration Secure Server with Vici Dynamic Portal Run ./vici_dynportal.sh

How to delete old call logs and other logs in vicidial or goautodial.

Step 1 : SSH to the server using the Putty Step 2:   login to mysql by typing   mysql -p                    (if you dont know password try below command )               mysql -ucron -p1234 Step 3 : select the asterisk database by typing               use asterisk step 4: Run the below command to check total disk occupied by asterisk database                SELECT table_schema AS "asterisk", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; Step 5 : Run the below command to check disk space consumed by each table in asterisk database SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "asterisk" ORDER BY (data_length + inde...