WireGuard - Ajouter un nouveau client

Ce tutoriel explique comment ajouter un nouveau client WireGuard sur le Raspberry Pi hébergeant AdGuard Home.


1. Créer le dossier du client


cd /opt/papa-network/wireguard/clients
mkdir -p windows
cd windows

2. Générer les clés


umask 077
wg genkey | tee windows.key | wg pubkey > windows.pub

3. Récupérer les clés


cat windows.key
cat windows.pub

4. Ajouter le client au serveur

Éditer :


sudo nano /etc/wireguard/wg0.conf

Ajouter à la fin du fichier :


[Peer]
PublicKey = <CONTENU_DE_WINDOWS.PUB>
AllowedIPs = 10.200.1.X/32

Remplacer X par une adresse IP libre.

Exemple :


10.200.1.4

5. Créer le fichier client


nano windows.conf

[Interface]
PrivateKey = <CONTENU_DE_WINDOWS.KEY>
Address = 10.200.1.4/32
DNS = 192.168.1.2
[Peer]
PublicKey = <CLE_PUBLIQUE_DU_SERVEUR>
Endpoint = papa.numericare.fr:51820
AllowedIPs = 192.168.1.0/24,10.200.1.0/24
PersistentKeepalive = 25

6. Recharger WireGuard


sudo systemctl restart wg-quick@wg0

7. Vérifier le serveur


sudo wg

Le nouveau Peer doit apparaître.


8. Générer le QR Code (Android / iPhone)


qrencode -o /opt/papa-network/wireguard/qr/windows.png < windows.conf

Ou directement dans le terminal :


qrencode -t ansiutf8 < windows.conf

9. Import du client

Plateforme Action
Windows Importer le fichier windows.conf dans WireGuard.
Linux Copier le fichier dans /etc/wireguard/wg0.conf puis démarrer wg-quick@wg0.
Android / iPhone Scanner le QR Code.

10. Vérification

Depuis le client :


ping 192.168.1.2

Puis :


nslookup google.fr

Le serveur DNS doit être :


192.168.1.2

Bonnes pratiques


Revision #1
Created 2026-07-12 08:06:02 UTC by Nico là
Updated 2026-07-12 08:06:44 UTC by Nico là