Wireguard on Raspberry

apt-cache policy wireguard to see if it is in the repository

apt install wireguard -y to get it

To created the keys

sudo su to not type in sudo for the following commands

cd /etc/wireguard

$(umask 077; wg genkey | tee privatekey | wg pubkey > publickey) produce new private and public keys

exit to required sudo again

sudo touch /etc/wireguard/wg0.conf and edit it

Address =
ListenPort = 51820
PrivateKey = </etc/wireguard/privatekey of the server>

PublicKey = </etc/wireguard/publickey of a client>
AllowedIPs =

wg-quick up wg0 to bring it up

ifconfig to see if it is there

wg-quick down wg0 to bring it down

systemctl enable wg-quick@wg0

systemctl restart wg-quick@wg0

Linurs startpage