WireGuard Commands
Modern VPN tunnel.All WireGuard pages
- sudo wg show: check WireGuard status, latest handshake and transfersudo wg show lists WireGuard peers with endpoint, allowed IPs, latest handshake and transfer. Script-friendly fields and what a missing handshake means.
- systemctl enable --now wg-quick@wg0: start WireGuard at bootsudo systemctl enable --now wg-quick@wg0 starts a WireGuard tunnel at boot. What the unit runs, reload versus restart, status checks and common start failures.
- wg genkey | tee privatekey | wg pubkey > publickey: generate WireGuard keyswg genkey | tee privatekey | wg pubkey > publickey creates a WireGuard key pair. Set umask 077 first, and add a pre-shared key with wg genpsk if needed.
- wg set wg0 peer KEY allowed-ips IP: add a WireGuard peer without restartingAdd a WireGuard peer to a running interface with wg set wg0 peer KEY allowed-ips, or edit the file and apply it with wg syncconf, then save it so it survives.