Evolution request for managing namespaces
Stéphane Veyret
Tue Apr 07 08:19:01 2020
Hi,
I spent a lot of time trying to use dhcpcd in namespaces. Maybe I did
not do it correctly, but I feel there should be improvements in order
to ease such usages.
My use case is the following: I have a Docker container running. I
added a (macvlan) interface in this container, connected to the
physical host interface. Now I want to ask the DHCP server an address
for the container.
The problem is that the dhcpcd service is already started in the host,
in order to provide address to the host interfaces. So, when I try to
execute:
nsenter -t 1234 -n dhcpcd container-eth0
dhcpcd actually sends the request to the running master process, which
does not see the container-eth0 interface and so is not working. What
I had to do is stop the running service, then execute the namespace
request, and restart the service.
An evolution which seems simple to me and which would be very helpful
would be a cli option to force dhcpcd to create a new process and not
call the master, even if present (the contrary of --master).
There could be a more complex evolution to directly manage namespace
in dhcpcd, so that the single master daemon would also see interfaces
in provided namespaces. This could also be interesting as there may be
multiple interfaces with same name in multiple namespaces, which would
create conflict for the creation of the pid file.
What do you think? Does this make sense or am I mistaken?
--
Bien cordialement, / Plej kore,
Stéphane Veyret
Archive administrator: postmaster@marples.name