Does systemd-networkd DHCPServer support configure static lease based on for example mac addresses? If yes how? The systemd-networkd documentation doesn't mention anything about it.

  • Haven't tried but... perhaps use a [Match] section with a MACAddress= line to configure static leases. Seems cumbersome, but perhaps that's the basic methodology. – RubberStamp Dec 22 '18 at 0:45
  • Doesn't seem so. According to the systemd.network documentation, MATCH section option is only to determine which interface(s) the network file should apply to. I don't think it makes sense if I use it before or after DHCPServer option. – R.J Dec 23 '18 at 11:07

Use man dhcpd.conf to confirm that this still works on systemd based systems, but, at least in older initd systems, you can use:

host hostname {
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address x.x.x.x;

within the subnet to reserve that address for the given MAC. Since this is a function of dhcpd.conf, it probably has not changed.

  • Problem is, I moved from dhcpd to systemd.network only some time ago because of simplicity and systemd integration. But it seems despite it supports configuring dhcp server for an interface, it doesn't have many configurations that was supported by other dhcp servers like dhcpd. – R.J Dec 23 '18 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.