From: "Ward, David - 0663 - MITLL" <david.ward-OVIABD91gjs3uPMLIKxrzw@public.gmane.org>
To: Daniel Lezcano <dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>,
"Eric W. Biederman"
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Subject: netns: Issues with deleting virtual interfaces during namespace cleanup
Date: Sat, 26 Feb 2011 11:59:27 -0500 [thread overview]
Message-ID: <4D69316F.4000606@ll.mit.edu> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2410 bytes --]
(Apologies for the cross-post, but Thunderbird messed up the formatting
when I sent this originally, and then I realized I sent it to the wrong
list.)
A patch was applied to the kernel in November 2008 that deletes virtual
network interfaces when network namespaces are cleaned up
(d0c082cea6dfb9b674b4f6e1e84025662dbd24e8). A discussion about this
patch took place on this list
(https://lists.linux-foundation.org/pipermail/containers/2008-October/013460.html),
where Daniel Lezcano wrote:
> After discussing with Benjamin, this patch means an user can no longer
> manage a pool of virtual devices because they will be automatically
> destroyed when the namespace exits. I don't think it is a big concern,
> but just in case I am asking :)
I currently have two use cases where this behavior is not desirable:
1. I use a veth pair device to connect two containers together (as
opposed to connecting a container to the host). To do this, I
create the veth pair device manually in the host with iproute2
("ip link add type veth"). Then when I start each container, it
pulls in one of the interfaces of the veth pair device with
"lxc.network.type = phys". When I stop one of the containers, its
interface to the veth pair device is deleted instead of moved back
to the host, so I can not just start the stopped container again
and re-establish the same link.
2. I start a process in the host that creates a TUN/TAP interface,
such as a VPN client. I pull the TUN/TAP interface into the
container with "lxc.network.type = phys". When the container
exits, the TUN/TAP interface is deleted because it is a virtual
interface, while the VPN client process continues to run in the
host. Again I can not just start the container again with the
same connection; I have to restart the VPN client.
It makes sense that virtual network interfaces that get created inside a
container should be deleted when the container exits. However, I feel
that network interfaces from the host that get assigned to the container
should be returned to the host when the container exits, whether they
are physical or virtual.
Can the kernel distinguish between network interfaces that were created
inside the namespace, and network interfaces that were moved there?
David
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5650 bytes --]
[-- Attachment #2: Type: text/plain, Size: 206 bytes --]
_______________________________________________
Containers mailing list
Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers
next reply other threads:[~2011-02-26 16:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-26 16:59 Ward, David - 0663 - MITLL [this message]
[not found] ` <4D69316F.4000606-OVIABD91gjs3uPMLIKxrzw@public.gmane.org>
2011-02-26 22:32 ` netns: Issues with deleting virtual interfaces during namespace cleanup Daniel Lezcano
[not found] ` <4D697F6A.9000907@free.fr>
[not found] ` <4D697F6A.9000907-GANU6spQydw@public.gmane.org>
2011-02-27 5:16 ` Renato Westphal
[not found] ` <AANLkTinQQHKiujHNet07kbK5eqYvp6-2iBnn27v2-85+-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-27 9:02 ` Eric W. Biederman
2011-02-27 9:19 ` Daniel Lezcano
[not found] ` <4D6A1726.1010400@free.fr>
[not found] ` <4D6A1726.1010400-GANU6spQydw@public.gmane.org>
2011-02-27 15:28 ` Renato Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D69316F.4000606@ll.mit.edu \
--to=david.ward-oviabd91gjs3upmlikxrzw@public.gmane.org \
--cc=dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.