Bring a WireGuard VPN Up or Down with wg-quick

Activate or deactivate a WireGuard VPN tunnel from the terminal with wg-quick, and verify the handshake and traffic with wg show.

LinuxwireguardclivpnMedium risk
Run sudo wg-quick up wg0 to connect your WireGuard VPN and sudo wg-quick down wg0 to disconnect it.

01Command

Command
$ sudo wg-quick up wg0

02What it does

wg-quick is the standard helper that reads a saved profile from /etc/wireguard/wg0.conf and sets up the interface, routes, and DNS entries in one command. After connecting, run wg show to confirm the latest handshake and the bytes transferred — that is the quickest way to tell the tunnel is genuinely carrying traffic. The connection survives until you bring it down or reboot; to connect automatically, enable it as a systemd service with systemctl enable wg-quick@wg0.

03Risk

RiskMedium risk
Requirementswireguard-tools (sudo apt install wireguard); config at /etc/wireguard/wg0.conf
!Warning: Routing all your traffic through the VPN can drop your SSH session or cut the internet entirely if the config's AllowedIPs or DNS settings are wrong; test from a local console first.

04Undo

Undo
$ sudo wg-quick down wg0

05Sources

  • wg(8) — Linux manual page
    Arch Linux · community · 2026-09-17
    Evidence: Official wg manual describing the WireGuard tool and its show subcommand used to verify tunnels.
  • wg-quick(8) — Linux manual page
    Arch Linux · community · 2026-09-17
    Evidence: Documents wg-quick up/down for bringing a WireGuard interface defined in /etc/wireguard/wg0.conf up and down.

Last verified: 2026-09-18 · Category: Network