On Jan 09, Guus Sliepen <[email protected]> wrote: > However, it becomes more difficult if, for example, you have two eth0 > interfaces in different namespaces, but also configured differently. Yes, but iproute already supports bind-mounting files in /etc/, so I just need to create /etc/netns/$NAMESPACE/network/interfaces and everything works.
> Then your first possibility is the easiest one. But then you could also
> mount a private /run/network tmpfs?
I tried hard, but this cannot work because "ip netns exec" creates every
time a new ephemeral mount namespace:
unshare(CLONE_NEWNS) = 0
mount("", "/", 0x8089fca, MS_REC|MS_SLAVE, NULL) = 0
> There is the a related bug, #651919, which also asks for namespace
> support, but turnned around: ifupdown is run in the default namespace,
> but creates interfaces in a different namespace. Less elegant maybe, on
> the other hand it will work better during boot?
No matter if you enter the namespace manually or magically by ifupdown
itself you need a different state file.
I think that my approach of explicitly entering the namespace feels more
natural because you need to use the same command anyway to start your
daemons etc.
--
ciao,
Marco
signature.asc
Description: PGP signature

