network namespaces

Ido Barkan ibarkan at redhat.com
Sat Jul 11 23:04:31 PDT 2015


Hi,

My ideas come from our use case.

I am a part of Ovirt networking team and we test our hypervisor agent (VDSM)
using multiple functional tests that actually mess with the host networking.
Currently we use our own 'namespace' (random device prefixes). This has many disadvantages
for examle:
 * name clashes
 * test devices residues
 * host networking system contamination.

So, it would be nice for our network manipulating libraries to leverage an underlying feature
of libnl that resembles  "ip netns exec NETNSNAME command ..."
e.g. rtnl_link_get_by_name might get an 'optional' namespace name.

This could make application that depend on libnl network unaware and ,in our case of a test 
framework, unaware of the host network system and solve the above problems.


Thanks,
Ido

----- Original Message -----
From: "Thomas Haller" <thaller at redhat.com>
To: "Ido Barkan" <ibarkan at redhat.com>, libnl at lists.infradead.org
Sent: Thursday, July 9, 2015 11:03:06 PM
Subject: Re: network namespaces

On Tue, 2015-07-07 at 10:54 -0400, Ido Barkan wrote:
> Hi all,
> 
> Does libnl support (or intend to support) specifying network 
> namespaces?
> If so, how does one can add/get/set a link in a specific network 
> namespace?

I think there is no explicit support and it's not planned.

Do you have some ideas in this regard?


I didn't try this, but I would expect that as a user you can switch
into anothe netns, connect your netlink socket, and possibly switch
back. Then your netlink socket is connected to the other netns.



Thomas
_______________________________________________
libnl mailing list
libnl at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/libnl



More information about the libnl mailing list