2017-12-15 06:22 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0014168CentOS-6kernelpublic2017-11-22 22:35
Platformx86_64OSCentOS 6OS Version
Product Version6.9 
Target VersionFixed in Version 
Summary0014168: Physical network devices can't be moved to network namespace
DescriptionOne can move virtual devices like veth or macvlan to another net namespace, but when you try to move a real device like eth0 or br0 out of root network namespace, you'll get a RTNETLINK error "Invalid argument". I tested this with 2.6.32-696.13.2.el6.x86_64.

This is due to a bug in mainline kernels up to 2.6.34. See net/core/dev.c, dev_change_name():
        /* Don't allow real devices to be moved when sysfs
         * is enabled.
        err = -EINVAL;
        if (dev->dev.parent) {
                printk(KERN_INFO "real device is not allowed to be moved\n");
                goto out;

It was fixed in 2.6.35 with commit https://github.com/torvalds/linux/commit/a1b3f594dc5faab91d3a218c7019e9b5edd9fe1a ("remove the misguided fix for moving devices between namespace").

Can you backport this fix to 2.6.32?

Our use case will be running docker containers with a dedicated physical interface.
Steps To ReproduceInstall iproute version with support for "ip netns" commands
$ ip netns add mynetns
$ ip link set eth0 netns mynetns
RTNETLINK answers: Invalid argument
Tagsiproute2, kernel, network
Attached Files


There are no notes attached to this issue.

-Issue History
Date Modified Username Field Change
2017-11-22 22:35 haxtibal New Issue
2017-11-22 22:35 haxtibal Tag Attached: iproute2
2017-11-22 22:35 haxtibal Tag Attached: kernel
2017-11-22 22:35 haxtibal Tag Attached: network
+Issue History