Repository navigation
Conversation
yuwata
left a comment
There was a problem hiding this comment.
Not tested yet. Only nitpicky comments.
|
BTW, what happens when |
|
Ah, please also add And of course, adding testcases are welcome. If not, I will try to add that later as usual :-) |
2880739 to
ab7d61d
Compare
Usually we move one end not the both end . To communicate from outside. One end in namespace other end in parent system |
|
huh, how is this supposed to be used? I mean, .netdev files are one thing, but if you can't apply .network on them, how are they supposed to be useful? |
We can implement similar to |
|
well, but how would you tell networkd to manage interfaces (as in: apply .network files) in some specific netns? |
|
(i figure you'd have to add a new concept of .netns files or so, that define a netns each, and then only reference these from .netdev and .network files. and probably also .link files. And then networkd would have to subscribe to all network events in all these .netns namespaces too, in addition to the host one. that would be quite some new infrastructure though I#d guess?) |
|
yes mostly we can do that probably simpler I would work on it . Looks interesting to me . thanks. |
There was a problem hiding this comment.
It may not be necessary, but still I prefer to enable destroy callback.
If you really do not like that, then please drop netdev_ref() below, otherwise the NetDev object will not be freed.
|
@poettering you were right. It's kind of impossible to manage links in the network namespace for networkd running in one instance . Any other ideas we can implement like in networkctl to set up or add address to links ? |
|
@ssahani one approach for teaching netns support to networkd might be something like this:
I think such an approach would be relatively minimal. And it would make it very easy for people to create a new managed netns: "systemctl enable --now [email protected]" would suffice. Would that make sense? |
|
yes thanks ! |
|
Sounds good. Any progress on this? @poettering |
|
@nafets227 when creating such "inter-namespace" interfaces it should be possible to simply specifiy the source namespace to use by its name. |
|
Also mentioned in #11103 (which OP states this intends to close) is differing birth to 'running' namespace. This is particularly great with WireGuard, that's where I learnt about it, but I'm sure there's other use cases. I'd suggest adding |
|
This seems good, is anyone working on this at the moment? |
| <para>Specifies the name for network namespace in which networkd will create net device. | ||
| If specified namespace doesn't exist then networkd will create it before creating the device.</para> | ||
| </listitem> | ||
| </varlistentry> |
There was a problem hiding this comment.
From reading this I'm not clear what a "Network namespace" is...
I mean.. from a kernel point of view, network namespaces don't have names at all. the iproute2 tools have a concept of named namespaces, but it's purely user-space IIUC.
This might also be a unit name in the "JoinNamespaceOf" sense...
I think this deserves to be a bit more explicit.
There was a problem hiding this comment.
"Network namespace" context: http://man7.org/linux/man-pages/man7/namespaces.7.html
I mean.. from a kernel point of view, network namespaces don't have names at all.
You piqued my curiosity... http://man7.org/linux/man-pages/man8/ip-netns.8.html
So the names come from /var/run/netns/, and ip netns identify can be given a PID to reverse-lookup a name.
(Re-reading your comment it seems you knew all that, but anyway, links for others curious!)
|
Also curious how this is gonna work with |
|
So it seems like this will provide a mechanism for choosing the network namespace of a device at its creation, but what about moving an already created device? This would be very useful when using network namespaces for a VPN setup like the one described here. This could be useful if either:
|
I believe as it stands this patch creates the netns and then moves the device into it, so the creation namespace would be that of the parent process; which is not that helpful for the wg workflow we've described. |
|
NB: Seems to have been superseded by #14915 |
This allows to specify the name for network namespace in which networkd will create net device.
If specified namespace doesn't exist then networkd will create it before creating the device
closes #11103