
Add one
Server
wg genkey | tee tv.key | wg pubkey > tv.pub
sudo nano /etc/wireguard/wg0.conf # add a [Peer] at the end
sudo wg syncconf wg0 <(wg-quick strip wg0)One address per device. Keep a list, and use # for notes in the config.
| Address | Device | Added |
|---|---|---|
| 10.8.0.2 | Laptop | 2026-11-02 |
| 10.8.0.3 | Phone | 2026-11-02 |
| 10.8.0.4 | TV | 2026-12-01 |
Remove one
At once, others stay connected
sudo wg set wg0 peer THEIR_PUBLIC_KEY removeThis changes memory only. Delete the block from the file too or it returns after a restart.
Let it reach one place only
On the server AllowedIPs says whose source address it is, not what it may visit. Use the firewall for that:
10.8.0.4 may reach the NAS only
sudo iptables -I FORWARD -s 10.8.0.4 -j DROP
sudo iptables -I FORWARD -s 10.8.0.4 -d 192.168.1.10 -j ACCEPTLost phone
- Remove its peerThe remove command above
- Edit the fileDelete its [Peer] block
- New keysA fresh pair for the new phone, not the old one
Should I add a PresharedKey?
You can. It adds a symmetric layer per pair; wg genpsk makes it, and both sides write the same.
How many devices can a server take?
The protocol has no limit; bandwidth and CPU decide. Dozens are fine on a small VPS.
Next letterKeep it running