
Reading wg show
peer: xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=
endpoint: 203.0.113.9:40112
allowed ips: 10.8.0.3/32
latest handshake: 48 seconds ago
transfer: 1.21 GiB received, 9.87 GiB sent| You see | It means |
|---|---|
| No latest handshake | It never succeeded |
| More than three minutes | Down now, or simply idle |
| received stays 0 | Packets leave and nothing returns |
| endpoint changed | They moved to another network, normal roaming |
Backup
Only /etc/wireguard matters. It holds private keys, so encrypt the archive.
sudo tar cz /etc/wireguard | gpg -c > wg-backup.tar.gz.gpgThe home IP changed
With a host name in Endpoint, WireGuard resolves it once, at start. After a dynamic DNS change it must be resolved again; on Linux the official repository has reresolve-dns.sh to run every minute. On a phone, switch it off and on.
Change the port
Change ListenPort on the server and Endpoint on every device, open the new port, restart the interface.
Update
- WindowsThe app tells you, press update
- LinuxWith the system
- Phones and MacApp stores; APK users install the new file over the old
Rotate keys regularly?
Session keys change every two minutes by themselves. Long-term keys can stay unless they leaked.
Where are the logs?
On Windows the Log tab can save a file; on Linux journalctl -u wg-quick@wg0.
Next letterThe first tunnel