WireGuard is a contemporary VPN protocol that gives a easy, quick, and safe approach to set up a digital non-public community. This is learn how to arrange a WireGuard VPN on CentOS 8 and entry it through Home windows 10/7 and cell gadgets:Step 1: Set up WireGuard on CentOS 8Connect to your CentOS 8 server through SSH.
Set up the EPEL repository:
sudo dnf set up epel-release
Set up WireGuard and its dependencies:Step 2: Generate WireGuard KeysCreate the private and non-private keys for the server
sudo mkdir /and many others/wireguard && cd /and many others/wireguard
sudo umask 077
sudo wg genkey | tee privatekey | wg pubkey > publickey
Create the private and non-private keys for every consumer:
sudo wg genkey | tee privatekey_client1 | wg pubkey > publickey_client1
sudo wg genkey | tee privatekey_client2 | wg pubkey > publickey_client2
Copy the general public keys for every consumer and add them to the server’s configuration file:
cat /and many others/wireguard/publickey_client1 >> /and many others/wireguard/shoppers.checklist
cat /and many others/wireguard/publickey_client2 >> /and many others/wireguard/shoppers.checklist
Step 3: Configure WireGuardCreate the WireGuard configuration file
sudo nano /and many others/wireguard/wg0.conf
Add the next configuration to the file:
Deal with = 10.0.0.1/24
SaveConfig = true
PrivateKey = SERVER_PRIVATE_KEY
ListenPort = 51820
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32
Substitute SERVER_PRIVATE_KEY with the server’s non-public key, and CLIENT_PUBLIC_KEY with the consumer’s public key.
Save and shut the file.Step 4: Begin WireGuardStart the WireGuard interfaceCheck the standing of the WireGuard interface:Step 5: Hook up with the VPN
On Home windows, obtain and set up the WireGuard consumer from the official website.
On cell gadgets, obtain and set up the WireGuard app from the app retailer.
Import the configuration file you created in Step 3 into the consumer.
Hook up with the VPN.
That is it! You need to now be capable to entry your CentOS 8 server through the WireGuard VPN out of your Home windows and cell gadgets.