Ubuntu 24.04.1 LTS Server: systemd-networkd and DHCPv4 client on enp4s0 takes too long

Abstract: Resolve systemd-networkd DHCPv4 delay on enp4s0 by setting LinkLocalAddressing=no to skip IPv6 probes.

Created: 2026-09-21 by
The delay in systemd-networkd acquiring a DHCPv4 address on enp4s0 is typically caused by the client waiting for link-local IPv6 configuration or failing to detect carrier status quickly. By configuring LinkLocalAddressing=no and ensuring the network file correctly identifies the interface as an Ethernet port, you can bypass unnecessary IPv6 probes and force immediate DHCP negotiation. This approach resolves the timeout without relying on non-existent directives, ensuring your server connects within seconds just like your other interfaces.

Understanding the Root Cause of the Delay

When systemd-networkd starts, it attempts to bring up all managed interfaces according to their respective .network files. For many modern Linux distributions, including Ubuntu 24.04 LTS, the default behavior includes attempting to configure a link-local IPv6 address (FE80::/10) even if you only intend to use IPv4. This process involves sending Neighbor Discovery Protocol (NDP) packets and waiting for a response or a timeout period. If your network environment does not support IPv6 or if the switch port is slow to respond to these probes, the network service will hang until the IPv6 timeout expires before finally falling back to or proceeding with DHCPv4. Another common cause is the detection of "carrier" status. Some network drivers or virtualized environments may report that the physical link is up before the actual data path is ready, or vice versa. If systemd-networkd believes the link is down initially, it may wait for a state change event that never arrives promptly, delaying the start of the DHCP client. Additionally, if the interface is misidentified as a wireless or mobile broadband connection rather than a wired Ethernet port, systemd-networkd might apply different default policies that include additional roaming or stability checks, further increasing latency.

Configuring the Network File Correctly

To resolve this, you must edit the specific network configuration file for enp4s0. These files are located in /etc/systemd/network/. You should look for a file that matches the interface, often named something like 10-enp4s0.network or eth0.network depending on how udev rules have mapped the hardware. Open this file with a text editor such as nano or vim. Inside the file, ensure the [Match] section explicitly targets the correct interface name. It is crucial to use Name=enp4s0 rather than wildcards unless you intend to apply the settings to multiple interfaces. Below the match section, the [Network] block must contain the directive to request an IP address via DHCP. The standard directive is DHCP=ipv4. Using DHCP=yes is also valid but less explicit; specifying ipv4 tells the daemon to only attempt IPv4 address acquisition, which can sometimes speed up the process by skipping IPv6-related logic entirely. ```ini [Match] Name=enp4s0 [Network] DHCP=ipv4 LinkLocalAddressing=no ``` The addition of LinkLocalAddressing=no is critical. This directive explicitly instructs systemd-networkd not to assign a link-local address to the interface. By disabling this step, you remove the need for the system to perform NDP exchanges, which are often the primary culprit behind multi-second delays during boot or network restarts. Without this setting, the system waits for the IPv6 link-local timeout, which can take several seconds on busy or misconfigured networks.

Restarting the Network Service

After saving your changes to the .network file, you must reload the systemd-networkd configuration for the changes to take effect. You do not need to reboot the entire server. Instead, run the following command in the terminal: sudo systemctl restart systemd-networkd This command stops the network management daemon and starts it again, causing it to re-read all configuration files in /etc/systemd/network/. Once restarted, check the status of the service to ensure there are no errors: systemctl status systemd-networkd You can also monitor the journal logs in real-time to see what happens when the interface comes up. Use the following command to watch for messages related to enp4s0: journalctl -u systemd-networkd -f Look for lines indicating that the DHCP client has started and received an offer from the server. With LinkLocalAddressing=no set, you should observe a significant reduction in the time between the interface being marked as "ready" and having an IP address assigned. If the interface still takes too long, verify that the physical cable is securely connected and that the switch port is configured correctly. In virtualized environments, ensure that the virtual network adapter is attached to a bridge or VLAN that properly forwards DHCP broadcasts. For users experiencing similar connectivity issues on older Ubuntu versions or virtual machines, reviewing past solutions for KVM networking may provide additional context on virtual switch configurations. See our guide on [Ubuntu 22.04 VM Internet Connection Issues](/news/1206445/ubuntu-22-04-vm-internet-connection-issue) for insights into virtual bridge setups.

Verifying the Configuration

Once the service has restarted, verify that enp4s0 has obtained an IP address using the ip addr show enp4s0 command. Ensure that the address is present and that the state is UP. You can also test connectivity by pinging your gateway or an external DNS server. If the delay persists, consider checking the kernel ring buffer for any driver-level errors using dmesg | grep enp4s0. Driver issues can sometimes manifest as delayed link detection, which is distinct from the systemd-networkd configuration delays discussed here. It is also worth noting that if you are using a static IP address instead of DHCP, the same principles apply regarding link-local addressing. Disabling link-local addressing can still improve boot times for static configurations by preventing unnecessary neighbor discovery probes. However, for dynamic addresses, ensuring the DHCP client starts immediately is paramount. If you encounter issues where network tools fail to display addresses correctly after making these changes, remember that some legacy commands may behave differently in modern Linux environments. For more information on interpreting network output, refer to our article on [ifconfig and IPv4 Addresses](/news/1145977/ifconfig-and-ipv4-addresses).

Frequently Asked Questions

Why does my server take so long to get an IP on boot?

The delay is usually caused by systemd-networkd waiting for link-local IPv6 configuration or carrier detection timeouts. Disabling LinkLocalAddressing forces the system to skip these steps and proceed directly to DHCP negotiation.

Can I use DHCPv6 instead of DHCPv4?

Yes, you can change the directive to DHCP=ipv6 or DHCP=yes to allow both protocols. However, if IPv6 is not supported by your network, enabling it may introduce similar delays due to probe timeouts.

What if the interface name changes?

Interface names can change if hardware is moved or added. To avoid this, use MAC=xx:xx:xx:xx:xx:xx in the [Match] section instead of Name=. This ensures the configuration applies to the specific physical device regardless of its kernel-assigned name.

How do I debug network startup issues?

Use journalctl -u systemd-networkd -f to watch logs in real-time. Look for errors related to DHCP requests, link state changes, or configuration parsing failures to identify the exact point where the process stalls.

Does this fix apply to Ubuntu 22.04?

Yes, the LinkLocalAddressing directive is available in systemd-networkd across recent Ubuntu versions. The configuration syntax remains consistent, though package updates may slightly alter default behaviors.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More