[lxc-users] tap interface in unprivileged container?

Dirk Geschke dirk at lug-erding.de
Tue Jul 21 19:43:44 UTC 2015


Hi LXC-Users,

> is there an easy way to create/move a tap interface to an unprivileged
> container?

I think, I found a solution:

   # ip tuntap add mode tap tap0
   # ip link set tap0 netns 16077

This creates a tap interface with name tap0, 16077 is the PID of
the init process in the container. If the container is started
with this config line

  lxc.mount.entry = /dev/net/tun dev/net/tun none bind,create=file 0 0

it seems to work. At least, I get a tap0 interface and get no
further errors, so far...

Is there an easy way to find the PID of the init in the container
or something else to move the interface to the correct container?

Best regards

Dirk
-- 
+----------------------------------------------------------------------+
| Dr. Dirk Geschke       / Plankensteinweg 61    / 85435 Erding        |
| Telefon: 08122-559448  / Mobil: 0176-96906350 / Fax: 08122-9818106   |
| dirk at geschke-online.de / dirk at lug-erding.de  / kontakt at lug-erding.de |
+----------------------------------------------------------------------+


More information about the lxc-users mailing list