📋 dhcp 24.04

by anon · 2026-07-11 20:05:37
← all clips

Refreshing DHCP on Ubuntu Server 24.04

Ubuntu Server 24.04 uses netplan for network configuration, backed by either systemd-networkd (default on server) or NetworkManager. Here are the standard ways to release and renew your DHCP lease:


1. Quick & Dirty — dhclient (works everywhere)

bash

# Release the current lease

sudo dhclient -v -r


# Request a fresh lease

sudo dhclient -v


You can also target a specific interface:

bash

sudo dhclient -v -r eth0

sudo dhclient -v eth0


2. Using netplan apply (if using netplan, which you likely are)

This re-applies the netplan config, effectively restarting the network:

bash

sudo netplan apply


3. Restart the network backend (systemd-networkd)

bash

sudo systemctl restart systemd-networkd


4. Bring the interface down/up (nuclear option)

bash

sudo ip link set eth0 down

sudo ip link set eth0 up

# DHCP client on systemd-networkd will automatically request a new lease


Which one to pick?

Method

Best for

dhclient -v -r then dhclient -v

A clean release & renew without dropping other interfaces

netplan apply

If you've just edited /etc/netplan/*.yaml

systemctl restart systemd-networkd

Restarts all network managed by systemd

ip link set ... down/up

Quick bounce of a single interface

Tip: First check what backend you're running:

bash

# See if NetworkManager or systemd-networkd is managing things

systemctl status systemd-networkd

systemctl status NetworkManager


The default on Ubuntu Server 24.04 is systemd-networkd, so methods 1, 3, or 4 will work right out of the box.