wg-quick(8)
Set up and tear down WireGuard VPN interfaces with a simple configuration file.
Synopsis
wg-quick [ up | down | save | strip ] [ INTERFACE ]Description
wg-quick is a utility for easily bringing up and tearing down WireGuard VPN tunnels. It reads a configuration file (typically /etc/wireguard/INTERFACE.conf) and automatically configures the network interface, IP addresses, routing, and firewall rules needed for the VPN to function.
The tool simplifies WireGuard setup by handling common tasks like setting MTU, managing IP routes, and applying firewall rules. Configuration files use a simple INI-style format that extends the standard wg configuration with network-specific options.
wg-quick requires root privileges to create interfaces and modify network settings. It works on Linux and also on macOS, Windows, and FreeBSD with appropriate adaptations.
Common options
| Flag | What it does |
|---|---|
up INTERFACE | Bring up the WireGuard interface by reading its config file and setting up routing/firewall |
down INTERFACE | Tear down the WireGuard interface, removing routing rules and firewall modifications |
save INTERFACE | Save the current state of the WireGuard interface to its config file for persistence |
strip INTERFACE | Remove all IP addresses and firewall rules, leaving only the raw WireGuard interface |
Examples
Bring up the WireGuard interface 'wg0' using config from /etc/wireguard/wg0.conf
sudo wg-quick up wg0Tear down the 'wg0' interface, removing all routes and firewall rules
sudo wg-quick down wg0Save the running configuration of wg0 back to /etc/wireguard/wg0.conf
sudo wg-quick save wg0Activate a VPN client tunnel defined in /etc/wireguard/wg-client.conf
sudo wg-quick up wg-clientRemove IP configuration from wg0 while keeping the WireGuard interface active
wg-quick strip wg0Bring up WireGuard using a configuration file at a custom path
sudo wg-quick up /etc/wireguard/custom.conf