wg-quick: 'wg0' already exists
Fixes wg-quick refusing with wg-quick: 'wg0' already exists. Use when an interface from an earlier run is still up. Covers bringing it down before re-creating it. Not for RTNETLINK file-exists on addresses, or missing configs.
wg-quick: 'wg0' already exists
TL;DR: a wg0 interface is already up from an earlier run, so wg-quick will not create a second one. Run sudo wg-quick down wg0 first, then up again. This bites when a previous up half-succeeded or the config was applied by hand.
wg-quick: 'wg0' already existsSteps
- Take the existing interface down:
sudo wg-quick down wg0Expected: no output.
- Confirm it is gone:
ip link show wg0Expected: Device "wg0" does not exist.
- Bring it up fresh:
sudo wg-quick up wg0Expected: the interface is created and wg show wg0 lists peers.
When this applies
- re-running
wg-quick upafter it was killed midway - scripts that call
upwithout a matchingdown - the interface was created manually and then wg-quick ran
When it doesnt
RTNETLINK answers: File exists— leftover addresses, a level deeper than this- config file missing — different error entirely
- you actually want two tunnels — give the second a different interface name
Compatibility
wireguard-tools wg-quick on Linux.
Other phrasings
wg-quick interface already existscannot create wg0: exists
Why it happens
wg-quick refuses to create an interface that already exists rather than silently reusing it, because reusing it could mean applying a new config to a live tunnel halfway.
Edge cases
- If
downclaims the interface is not defined butip linkshows it, delete it directly withip link delete wg0. - Persistent interfaces managed by systemd-networkd should be restarted through the service, not wg-quick.