iproute2 (ip netns)
gkotton at redhat.com
Tue Sep 25 07:53:50 UTC 2012
I have run into the following problem and maybe someone on the list can
help shed some light. Maybe this is just a misunderstaning on my behalf
and I hope that someone can help.
Openstack Quantum makes use of namespaces for the DHCP and L3 agents.
This enables one to make use of overlapping IP's. In the Fedora
packaging we create a quantum user that runs the above mentioned agents.
Each agent can create one or more namespaces. There is a sudoers file
for quantum. The contents are below:
[root at localhost sudoers.d]# cat quantum
quantum ALL = (root) NOPASSWD: SETENV: /usr/bin/quantum-rootwrap
When one of the agents creates a namespace the root user is unable to
access the namespace:
List of namespaces:
[root at localhost sudoers.d]# ip netns
Trying to read configured interfaces in namespace:
[root at localhost sudoers.d]# ip netns exec
qdhcp-0c642a75-0402-4013-a0d0-6eb8b1b9c9cc ip link
seting the network namespace failed: Invalid argument
It seems that the reason for this is that the permissions are as follows:
[root at localhost ~]# ll /var/run/netns/
----------. 1 root root 0 Sep 24 09:00
----------. 1 root root 0 Sep 24 09:02
If the agents are run by a the root user and not quantum then the
permission of the files are:
-r--------. 1 root root 0 Sep 24 09:00
-r--------. 1 root root 0 Sep 24 09:02
And the ip link operation succeeds.
I would assume that the root should have permission to access the
More information about the devel