Amazon holiday deals See deals →ad

Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

Linux IP Address Renew: How to Refresh DHCP

To renew a Linux computer’s DHCP address, use the command for the network service managing the connection: NetworkManager users can reconnect their active connection with nmcli, while systems managed by systemd-networkd can use networkctl renew. The ip command displays and configures addresses, but ip address by itself does not ask a DHCP server for a new lease.

What renewing an IP address means

Most Linux computers on a home or office network receive an IPv4 address through DHCP. A DHCP server—often the router—leases an address to a device for a set period. Renewing means asking the server to extend or replace that lease. It is not the same as changing the address manually, restarting the router, or simply viewing the address with ip addr.

A renewal does not guarantee a different address. If the current address is still valid and available, the server may offer the same one again. That is normal: the goal is a working lease, not necessarily a new number. DHCPv4 clients typically try to renew a lease before it expires, so manually renewing is mainly useful when troubleshooting a connection or when a network has changed.

Linux does not have one universal renewal command because distributions and installations use different network managers. A command intended for one manager may fail, do nothing, or conflict with another service if it is applied to the wrong setup.

Identify the network manager and interface

First find the interface connected to the network and the service controlling it. Run ip link to list interfaces and ip -4 addr to see IPv4 addresses. Names such as enp3s0 commonly refer to wired Ethernet, while wlp2s0 is often wireless; names vary by hardware and configuration. Ignore lo, the loopback interface.

To check for NetworkManager, run systemctl is-active NetworkManager. For systemd-networkd, try systemctl is-active systemd-networkd. A desktop distribution often uses NetworkManager; a server or minimal installation may use systemd-networkd, the older ifupdown tools, or another network service. The existence of a command such as dhclient does not prove it manages the active interface.

NetworkManager can show devices and connection profiles with nmcli device status and nmcli connection show. The device is the interface; the connection is the profile containing settings such as DHCP, Wi-Fi credentials, and routes. Matching the active profile to the correct device helps avoid disconnecting a different network.

Renew a connection managed by NetworkManager

For a straightforward reconnect, identify the device in nmcli device status, then run sudo nmcli device disconnect enp3s0 followed by sudo nmcli device connect enp3s0, replacing enp3s0 with the actual interface. NetworkManager will activate a suitable connection profile and negotiate configuration, including DHCP when that profile is set to use it.

You can also bring a particular profile down and up. Find its name in nmcli connection show --active, then run sudo nmcli connection down id "Wired connection 1" and sudo nmcli connection up id "Wired connection 1", using the actual profile name. Profile names containing spaces need quoting in a shell. On Wi-Fi, a reconnect can briefly interrupt access while the device associates with the access point and obtains network settings.

These commands interrupt the connection. If you are logged in remotely over SSH, disconnecting the interface you use can end your session and prevent you from reconnecting. Prefer a local terminal or an out-of-band management connection before changing the network path. A normal NetworkManager lease renewal may happen automatically, so do not repeatedly cycle the connection if there is no actual problem.

Renew with systemd-networkd

If systemd-networkd manages the interface and its configuration uses DHCP, you can request renewal with sudo networkctl renew enp3s0. Replace the example name with the interface shown by ip link or networkctl list. Use networkctl status enp3s0 to inspect the link and its network configuration before and after the request.

This method applies to links handled by systemd-networkd, not automatically to every Linux machine that happens to run systemd. If the interface is managed by NetworkManager, use NetworkManager instead. Starting or stopping network services at random can disrupt connectivity or create competing configuration, so identify the active manager rather than trying every command you find online.

When dhclient is the right tool

dhclient is a DHCP client found on some Linux systems, especially older or manually configured setups. If it is installed and is the process responsible for the interface, a common release-and-request sequence is sudo dhclient -r enp3s0 and then sudo dhclient enp3s0. The first command releases the lease; the second asks for configuration again. Check dhclient --help or the local manual because options and availability can differ.

Do not run this sequence blindly on an interface controlled by NetworkManager or systemd-networkd. Those managers normally run or coordinate their own DHCP clients. A separate client can create confusing results, such as an address being replaced or removed while the manager still believes it owns the connection. If dhclient is missing, that does not mean DHCP is unavailable; the network manager may implement DHCP without exposing that command.

Check whether the renewal worked

After requesting a renewal, check the interface and route rather than assuming success from a command returning without an obvious error. Useful checks include:

  • ip -4 addr show dev enp3s0 to inspect the IPv4 address assigned to the interface.
  • ip route to see whether a default route is present and which interface it uses.
  • nmcli device show enp3s0 for NetworkManager address, gateway, and DNS details.
  • networkctl status enp3s0 for a systemd-networkd-managed link.

Substitute your real interface name. A usable address, route, and DNS configuration are separate pieces of network setup: an address can appear even when the default gateway or name resolution is broken. Test a numeric destination and a hostname separately if needed. For example, a successful connection to an IP address but failed website names points toward DNS rather than a DHCP address problem.

It is also normal for the displayed address to remain unchanged after renewal. DHCP servers commonly remember a client and offer its previous address again. If your actual goal is a different address, renewal alone may not achieve it; the server may reserve the current address for that device or have no alternative address available.

Common problems and mistaken fixes

If the interface has no address, check the physical or Wi-Fi link first. A cable unplugged, disabled wireless radio, failed Wi-Fi authentication, or disconnected access point can prevent DHCP from reaching a server. A renewal cannot fix a broken link. NetworkManager’s device status or networkctl status can help distinguish a disconnected link from a DHCP failure.

If the client reports that no DHCP offer arrived, possible causes include a router DHCP service that is disabled, an exhausted address pool, a network policy that rejects the device, or a VLAN or access-point configuration that puts it on the wrong network. Check the router or network administrator’s DHCP settings and, where available, system logs. On systems using systemd, journalctl -u NetworkManager or journalctl -u systemd-networkd can show relevant service messages.

A frequent misconception is that sudo ip addr flush dev enp3s0 renews DHCP. It does not: it removes addresses from the interface, but it does not itself ask the DHCP server for a lease. Flushing an address can leave the machine offline, especially if no DHCP client is then instructed to run. Similarly, bringing a link down and up with ip link changes its link state; it is not the same as telling a network manager to renew a lease.

If the address looks correct but internet access still fails, inspect the default route and DNS settings before repeating renewals. A gateway outage, firewall rule, captive portal, or DNS resolver problem can resemble an IP issue. A renewal may obtain fresh settings when those settings were stale, but it cannot repair an upstream outage or incorrect router configuration.

IPv6 and static addresses

DHCP renewal instructions for IPv4 do not necessarily apply to IPv6. IPv6 addresses may be configured using DHCPv6, router advertisements, or both; a device can also create a link-local address without any router assigning a public or private network address. Network managers handle these mechanisms according to the connection profile. For IPv6, inspect the interface with ip -6 addr and review the active manager’s status rather than assuming an IPv4 command renews every address type.

A manually configured static address is not a DHCP lease, so there is nothing to renew. If an interface uses a static address, its address, gateway, or DNS settings must be corrected in the configuration that controls it. On a managed work or school network, avoid substituting a self-chosen address: it can duplicate another device’s address or violate network policy.

Frequently Asked Questions

What is the simplest Linux command to renew an IP address?
There is no single command for every Linux system. Use NetworkManager’s nmcli for a NetworkManager connection, networkctl renew for a systemd-networkd link, or dhclient only when that client actually manages the interface.

Does ip addr renew DHCP?
No. ip addr displays or changes address configuration, but it does not contact a DHCP server to renew a lease. Use the tool belonging to the active network manager.

Why did my IP address stay the same after renewal?
The DHCP server can renew the existing lease and offer the same address again. Renewal restores or extends configuration; it does not promise a different address.

Can I renew an IP address over SSH?
You can, but disconnecting or restarting the interface carrying your SSH session can drop the connection and leave you unable to return. Use a local console or another management route when possible.

How do I get a different IP address?
A DHCP renewal may not change it. The router or DHCP administrator controls available addresses and reservations. For a legitimate need to change the address, check the network’s configuration or ask its administrator rather than assigning an arbitrary address.

Do I need to renew my Linux IP address regularly?
Usually not. DHCP clients normally renew leases automatically. Manual renewal is useful for troubleshooting or applying changed network settings, but repeatedly renewing a healthy connection is unnecessary.

Linux IP Address Renew: How to Refresh DHCP
Scroll to top