$linuxjunkies
>

wg-quick(8)

Set up and tear down WireGuard VPN interfaces with a simple configuration file.

UbuntuDebianFedoraArch

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

FlagWhat it does
up INTERFACEBring up the WireGuard interface by reading its config file and setting up routing/firewall
down INTERFACETear down the WireGuard interface, removing routing rules and firewall modifications
save INTERFACESave the current state of the WireGuard interface to its config file for persistence
strip INTERFACERemove 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 wg0

Tear down the 'wg0' interface, removing all routes and firewall rules

sudo wg-quick down wg0

Save the running configuration of wg0 back to /etc/wireguard/wg0.conf

sudo wg-quick save wg0

Activate a VPN client tunnel defined in /etc/wireguard/wg-client.conf

sudo wg-quick up wg-client

Remove IP configuration from wg0 while keeping the WireGuard interface active

wg-quick strip wg0

Bring up WireGuard using a configuration file at a custom path

sudo wg-quick up /etc/wireguard/custom.conf

Related commands