•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Setup VPN on CentOS 8

  • Home
  • Client
  • Knowledgebase
  • Network
  • Setup VPN on CentOS 8

Table Of Content

Related Articles

  • Data Center Redundancy: N+1
  • What is the difference between Latency, Bandwidth and Throughput?
  • How To Point A Domain Name To An IP Address
  • How to do a speed test using Psychz looking glass?
  • Quagga Routing - Install, Configure and setup BGP
  • Guide to establish a GRE Tunnel and BGP peering session on MikroTik RouterOS
  • Common Types of Network Attacks
  • Community Strings For Psychz Networks
  • IPv4 - Subnetting made easy
  • Centos add virtual IP(s)
  • Views: (2315)
  • Votes: (0)
Was this article helpful?
VOTE

Setup VPN on CentOS 8

Publisher: Psychz Networks,  February 17,2021

A VPN (Virtual Private Network) is a simple application that allows you to protect your online privacy and make it difficult for hackers by masking your IP addresses and keeping your identity anonymous by hiding your location. VPN can also be used for many other purposes, such as maintaining internet freedom by accessing data from outside your region, improving data security, and keeping your browsing history a secret.

The following article will learn how to install and configure OpenVPN on CentOS 8 (Linux system). OpenVPN is an open-source and free virtual private network (VPN) software. This tutorial provides step-by-step instructions for configuring an OpenVPN server on CentOS 8 Linux server.

  • Update system
  • Find IPv4/IPv6 IP address.
  • Install OpenVPN
  • OpenVPN client configuration
  • Conclusion

Step 1: Update your system

# sudo yum update

Next, install tar on CentOS and also install wget on CentOS 8

# sudo yum install tar wget

Step 2: Note your server’s IPv4 or IPv6 address

Use the IP command as follows:

# ip a

# ip a show eth0

We can try the following dig command/host command to find out your public IP address from the Linux command line:

[root@centos-8 ~]# dig +short myip.opendns.com @resolver1.opendns.com

Output

104.217.3.7

Please note down 104.217.3.7 IP address. You need to replace this one with your actual IPv4.

NOTE:

Most cloud servers have two types of IP address:

Public static IP address directly assigned to your box and routed from the Internet. For example, Linode, Digital Ocean, and others give you direct public IPv4/IPv6 addresses. Private static IP address directly attached to your server, and your server is behind NAT with a public IP address. The script will automatically detect your networking setup. All you have to do is provide a correct IPv4 or IPv6 address when asked for it. Hence, we used the above command to determine our IP address in advance.

Step 3: Download and run centos-8-vpn.sh script

Use wget command to download the file from the repository

# wget https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh -O centos-8-vpn.sh

Make sure you set up permissions using the chmod command:

# chmod +x centos-8-VPN.sh

Installing OpenVPN server on CentOS 8 Linux using the centos-8-vpn.sh. Now all you have to do is run shell script on Linux:

# sudo ./centos-8-vpn.sh

Step 4: Configuring the VPN

How do I start/stop/restart the OpenVPN server on CentOS 8 ?

Stop the server

# sudo systemctl stop openvpn-server@server.service

Start the server

# sudo systemctl start openvpn-server@server.service

Restart the server

# sudo systemctl restart openvpn-server@server.service

Get the server status

# sudo systemctl status openvpn-server@server.service

Output:

[root@centos-8 ~]# sudo systemctl status openvpn-server@server.service
● openvpn-server@server.service - OpenVPN service for server
Loaded: loaded (/etc/systemd/system/openvpn-server@.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-02-11 02:34:28 PST; 5 days ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 56968 (openvpn)
Status: "Initialization Sequence Completed"
Tasks: 1 (limit: 23722)
Memory: 1.4M
CGroup: /system.slice/system-openvpn\x2dserver.slice/openvpn-server@server.service
└─56968 /usr/sbin/openvpn --status /run/openvpn-server/status-server.log --status-version 2 --suppress-timestamps --cipher AES-256-GCM --ncp-ciphers AES-256-GCM:AES-128-GCM:AES-256-CBC:AES-128->
Feb 11 02:34:28 centos-8 openvpn[56968]: Could not determine IPv4/IPv6 protocol. Using AF_INET
Feb 11 02:34:28 centos-8 openvpn[56968]: Socket Buffers: R=[212992->212992] S=[212992->212992]
Feb 11 02:34:28 centos-8 openvpn[56968]: UDPv4 link local (bound): [AF_INET][undef]:1194
Feb 11 02:34:28 centos-8 openvpn[56968]: UDPv4 link remote: [AF_UNSPEC]
Feb 11 02:34:28 centos-8 openvpn[56968]: GID set to nobody
Feb 11 02:34:28 centos-8 openvpn[56968]: UID set to nobody
Feb 11 02:34:28 centos-8 openvpn[56968]: MULTI: multi_init called, r=256 v=256
Feb 11 02:34:28 centos-8 openvpn[56968]: IFCONFIG POOL: base=10.8.0.2 size=252, ipv6=0
Feb 11 02:34:28 centos-8 openvpn[56968]: IFCONFIG POOL LIST
Feb 11 02:34:28 centos-8 openvpn[56968]: Initialization Sequence Completed
[root@centos-8 ~]#

Conclusion

If you were successfully able to execute all the steps given above, you have successfully installed the OpenVPN server on your server with CentOS 8. The data transmitted over VPN is encrypted and is decrypted at the user's end. For more information on OpenVPN configuration options, please refer to their documentation here on https://openvpn.net/access-server-manual/tools-documentation-and-support/

Related Articles

  • Data Center Redundancy: N+1
  • What is the difference between Latency, Bandwidth and Throughput?
  • How To Point A Domain Name To An IP Address
  • How to do a speed test using Psychz looking glass?
  • Quagga Routing - Install, Configure and setup BGP
  • Guide to establish a GRE Tunnel and BGP peering session on MikroTik RouterOS
  • Common Types of Network Attacks
  • Community Strings For Psychz Networks
  • IPv4 - Subnetting made easy
  • Centos add virtual IP(s)
  • Views: (2315)
  • Votes: (0)
Was this article helpful?
VOTE
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801