Failed to move network device "wlan0" to network namespace 2153: Operation not permitted


(Chengdu Ding) #1

Excuse me, I’m trying to move wlan0 interface from host to lxc, but I always get the problem “Failed to move network device wlan0 to network namespace 2153: Operation not permitted”. I used a external wifi dongle, and my configuration of lxc likes belows.

lxc.network.type = phys
lxc.network.flags = up
lxc.network.link = wlan0
lxc.network.name = wlan0

Can someone give me some advice? Thank you.


(Stéphane Graber) #2

The wlan0 device is a child device of the physical wireless card, some drivers let you have multiple wlan devices on a single phy device but they all need to be moved as one unit between namespaces.

You may want to try setting the interface to phy0 (link and name) which may fix this. It could also depend on the wireless driver.


(Chengdu Ding) #3

@stgraber, like belows?

lxc.network.type = phys
lxc.network.flags = up
lxc.network.link = phy0
lxc.network.name = phy0


(Stéphane Graber) #4

I think so, yes


(Chengdu Ding) #5

It doesn’ work, because the phy0 doesn’t exist. When I startup the lxc, the problem is “lxc_network - network.c:instantiate_phys:347 - Failed to retrieve ifindex for phy0”.
I have used “ifconfig -a” to check the existence of phy0, but I only find the wlan0.