RFC: Network namespaces in NM


Is anyone working on network namespaces support in NetworkManager? Or was thinking what is a "proper way" of implementing them?

I'm experimenting with adding support to NM and what I implemented so far is:

1. Added objects NMNetnsController which would control all network namespaces managed by NM.

2. Each network namespace is represented with an object NMNetns and exposed on DBus. There are no methods so far but only a property name which contains network namespace's name on the filesystem.

NMNetnsController exposes object NetworkNamespacesController with methods AddNetworkNamepace and ListNetworkNamespaces. The first one take a name as an argument and creates a new (iproute2 compatible) network namespace, while the second one provides a list of existing namespaces.

4. When new network namespace is created (using 
AddNetworkNamepace method) a new, private, platform layer is instantiated and loopback interface within namespace activated. Note that new platform layer has to be created because once a socket is opened in one network namespace it is bound to the given namespace no matter which namespace is active so current singleton object wouldn't work without heavy refactoring!

What I intend to do next is:

1. NM has to monitor devices/IP addresses in new network namespaces properly.

2. Methods that would allow an IPv4 or IPv6 address to be assigned in some network namespace.

All the code is here:


and since this is PoC, there are A LOT OF BUGS AND MISSING FEATURES.

So, what do you think? Any comments, suggestions, critiques, etc?


P.S. To be able to run patched NM you also need patched libndp library available here:


Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]