Subject: Re: Deleting a network namespace

From: [email-masked] (Eric W. Biederman)
Date: Thu, 28 Mar 2013 04:05:52 -0700

David Shwatrz <[email-masked]> writes:

> Hello,
> When assigning a network interface to a network namespace and
> afterwards deleting the namespace, we will not see the network
> interface in any other namespace (including the default namespace) anymore:
>
> ip netns add ns1
> ip link set eth0 netns ns1
> ip netns del ns1
>
> This means that in fact we cannot use this interface again (only after
> rebooting)
> Am I right on this ?

Interfaces that represent physical hardware are moved to init_net.
Interfaces that are purely software constructs are deleted.

> Is moving an interface back to the default (init) namespace,
> when deleting the namespace which contains it, can be considered?

If you aren't seeing that your interface is either a purely software
construct like the veth or dummy interfaces or something still has a
reference to your network namespace.

Eric