[systemd-devel] Changing configurations with networkd

Michael Olbrich m.olbrich at pengutronix.de
Wed Jul 23 00:50:37 PDT 2014


Hi,

I've been experimenting with systemd-networkd to see where it fits my
use-cases. I'm looking for some insight if the issues I'm seeing are bugs,
features just not implemented yet or if my use-case is out of scope for
networkd.
The most common use-case I have is rather simple: One ethernet interface
that can be configured either with a static IP address or via DHCP. The
configuration usually comes from some custom configuration data, so I'll
probably have a default config as part of the rootfs and generate the real
config during startup in /run. This works rather well and is much nicer
than some custom shell scripts.
The interesting part is, when the configuration changes: I'm working with
embedded devices and network access is rarely part of the primary function
of the device. As a result, rebooting the device to change the network
config is not acceptable.

So I tried to change a static IP address by changing the config and
restarting networkd. The result was an interface with two addresses. And
worse, the old address was still the preferred on.
I realize, that a smooth transition is probably impossible for complex
configuration possibilities of networkd. But I don't need smooth. How about
optionally shutting down an interface when networkd stops?
ShutdownWithNetworkd=yes or something like that in the config file?

Another thing I noticed is with DHCP without changing the configuration:
Networkd forgets the lease during restart and sends a dhcp discover. Then
the server might offer a different address. The problem is, that the new
address is in the same subnet as the old address, so it is added as
secondary address. When the valid_lft of the old address expires then
_both_ addresses are removed :-/.
I think the lease should be remembered and reused in this case.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


More information about the systemd-devel mailing list