ip netns del zaps wg link

Maarten de Vries maarten at de-vri.es
Fri Jul 14 10:27:01 UTC 2023

On 18/05/2023 01:13, Harry G Coin wrote:
> First, Hi and thanks for all the effort!
> At least on Ubuntu latest LTS:  As advertised, if a wireguard link 
> gets created by systemd/networkd, then set into a different net 
> namespace, all works well.
> However, if that namespace is deleted, the link appears to be 'gone 
> forever'.  Other link types reappear in the primary namespace when the 
> namespace they are in gets deleted.   I'm not sure whether the link 
> retains its 'up' or 'down' state when the namespace it's in gets 
> deleted and reset to primary.  Not a big deal, doesn't happen often.
> This is 100% repeatable.   Some other answer than 'inaccessible until 
> the next reboot' would be nice.


This behavior is exactly what I would expect. I'm using namespaces to 
restrict access to a wireguard link. If the namespace gets destroyed, I 
absolutely do not want other programs to have access to the wireguard link.

You can simply re-create the wireguard link to use it again. This may 
not be the most convenient for you, but your use case seems to be a bit 
unconventional: you are moving and deleting a resource created by 
systemd and/or networkd manually. You are mixing automatic and manual 
management, so there is a risk of breaking the automatic management.

Alternatively, you could move the interface back before deleting the 

Kind regards,

Maarten de Vries

More information about the WireGuard mailing list