This two scripts install & configure Wireguard on a CentOS8 "server" (peer) and on a Ubuntu 18.04 "client" peer. Of course, if you replace the # Installation
script parts, these instructions can also be used on other distributions like Debian, CentOS 7, Fedora, etc..
Possible pitfall: When you change something in the /etc/wireguard/wg0.conf
configuration file on the server, ensure to disable the wg-quick@wg0
service in advance:
sudo systemctl stop wg-quick@wg0
sudo systemctl disable wg-quick@wg0
sudo vim /etc/wireguard/wg0.conf # edit what ever you like
sudo systemctl enable --now wg-quick@wg0