1

I have my eth0 interface configured for DHCPv4 via netplan:

network:
    version: 2
    renderer: networkd
    ethernets:
        eth0:
            dhcp4: true
            dhcp6: true
            optional: true

How do I tell systemd-networkd to renew my DHCP lease? I know with dhclient it's as simple as dhclient -r eth0 && dhclient eth0, as explained in many other answers on this site, but how do I do it for systemd-networkd?

I'm in Ubuntu 18.04 Server.

0

I found a freedesktop.org mailing list post from Tom Gundersen in August 2014 that answers my question, at least as of the time it was written:

> Is there a way to force a DHCPv4 release/renew with systemd-networkd?

We don't currently allow dynamic interaction with networkd, but you can force renew the release by either restarting networkd or unplugging/replugging the cable (or switching your wifi off/on if that's what you are using).

-t

So apparently if you do one of these two things, systemd-networkd will renew your DHCP lease.

  • Did it work for you? This seems right, but systemctl restart systemd-networkd didn't help, only dhclient -v -r eth0; dhclient -v eth0 (testing with dhcpdump -i eth0 on other terminal). – Pablo Bianchi Sep 23 '19 at 6:26
  • @PabloA If you're using systemd-networkd, then you don't want to use dhclient...it will interfere with systemd-networkd. Or, perhaps more accurately, systemd-networkd will probably interfere with your use of dhclient at some point. I'm not 100% sure that it worked, as I didn't really look that closely in my router's webpage after running the command, but I assume it did since I see that in multiple other answers on this site that that's the correct way to do it for systemd-networkd. – villapx Sep 23 '19 at 20:28

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.