DHCP
Most important commands to remember
networkctl status— inspect configuration known to systemd-networkd.ip -4 address— inspect IPv4 addresses actually installed on interfaces.
Commands and flags
| Command or option | Meaning |
|---|---|
networkctl status --all --no-pager |
Show detailed status for all links directly in the terminal. |
ip -4 address show |
Show IPv4 addresses, prefixes, and lifetimes; -4 selects IPv4. |
This example is for systemd-networkd. A desktop managed by NetworkManager can have working DHCP while networkctl reports links as unmanaged.
The concepts that matter
1. DHCP supplies configuration automatically
DHCP, the Dynamic Host Configuration Protocol, lets a client obtain network settings without someone entering each value manually. DHCPv4 can supply an address, subnet mask, router, DNS servers, and other options.
The server assigns from a configured pool according to policy. A reservation can make a particular client receive a consistent address, but that address is still delivered through DHCP rather than configured statically in the guest.
2. Initial acquisition is a conversation
A common new-client exchange is Discover → Offer → Request → Acknowledge. The client looks for servers, receives an offer, selects configuration, and obtains confirmation. This mnemonic describes initial acquisition, not every possible renewal or restart exchange.
Early traffic may use broadcast because the client does not yet have usable configuration. A DHCP relay can carry requests between client networks and a server elsewhere; the server need not sit on every local subnet.
3. An address is leased, not owned forever
A lease authorizes use for a period. The client normally tries to renew before expiry. If its original server does not answer, it can later try rebinding more broadly.
Renewal failure is not necessarily immediate loss of connectivity while a valid lease remains. Once the lease expires without replacement, the client must stop using that leased address. Lease duration and address lifetimes are time values, not packet counters.
4. Receiving settings does not prove they work
An address can be assigned while the gateway, DNS configuration, or upstream path is wrong. DHCP troubleshooting therefore separates obtaining settings from using them successfully.
DHCPv6 is a different protocol, and IPv6 also uses Router Advertisements and can configure addresses through SLAAC. In particular, an IPv6 default router is learned through Router Advertisements rather than a DHCPv6 equivalent of the DHCPv4 router option. Do not transfer the IPv4 acquisition sequence unchanged to IPv6.
One small example
Optional: use a Linux VM already managed by systemd-networkd. These commands only read state and do not renew or release its lease.
networkctl status --all --no-pager
ip -4 address show
In networkctl, find the active interface and any displayed address, gateway, DNS, or DHCP-server information. The exact fields depend on systemd version and configuration. A configured or routable state does not establish internet access.
In ip, read the inet address and prefix. The dynamic flag and finite valid_lft / preferred_lft values can provide context, but an address listing alone does not reconstruct the DHCP exchange. Lifetimes are seconds or forever.
Static addressing, no DHCP details, or an unmanaged link are valid outcomes. If systemd-networkd is not your manager, this example is not evidence of DHCP failure. No configuration changes or cleanup are needed.
Keep this idea: DHCP distributes time-limited configuration; inspect the installed settings separately from whether traffic succeeds.