Home ยป Install and Configure WireGuard on Debian / Ubuntu

Install and Configure WireGuard on Debian / Ubuntu

0 comment 100 views

Follow below.

Install WireGuard

apt install wireguard

Generate Private Key

wg genkey | sudo tee /etc/wireguard/server.key

Generate Public Key

sudo cat /etc/wireguard/server.key | wg pubkey | sudo tee /etc/wireguard/server.pub

Configure WireGuard Server

nano /etc/wireguard/wg0.conf

Update the follow as follow.

[Interface]
Address = 10.8.0.4/32
#SaveConfig = true
ListenPort = 51820
PrivateKey = 

[Peer]
#Client 1
PublicKey = 
AllowedIPs = 10.8.0.1/32
Endpoint = 103.11.22.33:51820
PersistentKeepalive = 25

[Peer]
#Client 2
PublicKey = 
AllowedIPs = 10.8.0.2/32
Endpoint = 139.11.22.33:51820
PersistentKeepalive = 25

Start and Enable the service

sudo systemctl start [email protected]
sudo systemctl enable [email protected]

Then do the same on another site server.

Refer
https://www.howtoforge.com/how-to-install-wireguard-vpn-on-debian-11/
https://ubuntu.com/server/docs/wireguard-vpn-site2site

Leave a Comment