[systemd-devel] Systemd-nspawn -- Canot add interface to container

Lennart Poettering lennart at poettering.net
Thu Oct 2 00:30:45 PDT 2014


On Thu, 25.09.14 10:21, Marcel Holtmann (marcel at holtmann.org) wrote:

> Hi James,
> 
> > I'm having another issue with private networking in systemd-nspawn. This one 
> > I'm not so certain is a bug, but probably some kind of mistake on my part. 
> > Base on my reading of the systemd-nspawn man page though, I can't figure out 
> > what the problem is. Basically, all I'm tring to do is remove an interface 
> > from the host namespace and provide it to the container. Details are included 
> > below (This is systemd 216-r3 in Arch Linux ARM).
> > 
> > [root at host01 ~]# systemd-nspawn --network-interface=wlan0 -M1 -bD 
> > /home/lanvpn/
> > Spawning container 1 on /home/lanvpn.
> > Press ^] three times within 1s to kill container.
> > Failed to move interface wlan0 to namespace: File exists
> 
> actually netdev interfaces like wlan0 can not move into network namespaces by themselves. With wireless hardware, the underlying physical device (for example phy0) needs to move into the namespace. Which means that all netdev that belong to a specific phyX will move with it into the namespace.
> 
> Try using "iw phy <phyname> set netns <pid>" to achieve this.

Marcel, what does this internally do? Maybe this is something we
should somehow expose in nspawn as well?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list