Utiliser la méthode avec wg-quick
IP = 192.168.11.0 comme réseau pour le VPN
Configuration du serveur
cd /etc/wireguard
wg genkey | tee wg-private.key | wg pubkey > wg-public.key
vi /etc/wireguard/wg0.conf
[Interface]
#server
Address = 192.168.11.254
PrivateKey =
ListenPort = 4820
[Peer]
#client 1
PublicKey =
AllowedIPs = 192.168.11.1
#client 2
PublicKey =
AllowedIPs = 192.168.11.2
Sur le client 1
cd /etc/wireguard
wg genkey | tee wg-private.key | wg pubkey > wg-public.key
vi /etc/wireguard/wg0.conf
[Interface]
#client 1
Address = 192.168.11.1
PrivateKey =
ListenPort = 4820
[Peer]
#server
PublicKey =
AllowedIPs = 192.168.11.0/24
Démarrer le VPN
wg-quick up wg0
wg show