Article View

Scroll down to read the full article.

The Ghost in the Machine: Debugging Intermittent Mellanox NIC Failures on systemd-networkd

calendar_month November 25, 2026 |
Quick Summary: Veteran SRE's guide to troubleshooting a specific, frustrating race condition causing intermittent Mellanox ConnectX-5 NIC failures on Linux with ...

Alright, listen up. If you've ever spent three days pulling your hair out because a server reboots, ip a shows an IP, but nothing on the network works – and then it magically fixes itself after a second reboot – you're probably dealing with a ghost. Or, more accurately, a deeply irritating race condition between a highly performant NIC driver and a pedantic network manager. Specifically, the Mellanox ConnectX-5 and systemd-networkd, on specific Linux kernels. This isn't theoretical. This is real pain.

We hit this in a high-throughput Kubernetes cluster where nodes would occasionally boot up, report their internal NIC (enpXsY) as healthy with an assigned IP, but couldn't reach anything. Not the gateway, not other pods, nothing. ping failed. curl timed out. Yet, networkctl status showed the interface as 'configuring' or 'unmanaged', despite an address being present. It was a contradiction wrapped in an enigma, with a side of 'why me?'

The Symptoms: Your Network Is Lying To You

Here’s the rundown of what you’ll see. The server boots. You check ip a:

3: enpXsY: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 10.0.0.42/24 brd 10.0.0.255 scope global enpXsY
valid_lft forever preferred_lft forever
inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever

Looks good, right? Nope. Try pinging the gateway. Instant Destination Host Unreachable or just silence. Check networkctl status enpXsY. It’ll often report something like:

● 3: enpXsY
Link File: /etc/systemd/network/10-enpXsY.network
Network File: /usr/lib/systemd/network/99-default.network
Type: ether
State: configuring (unmanaged/carrier/no-route)
Path: /sys/devices/pci0000:c3/0000:c3:00.0/0000:c4:00.0/0000:c5:00.0/0000:c6:00.0/net/enpXsY
HWID: 00:xx:xx:xx:xx:xx
MTU: 1500
Address: 10.0.0.42
Gateway: 10.0.0.1
DNS Servers: 10.0.0.2
10.0.0.3

The critical part: State: configuring (unmanaged/carrier/no-route). It thinks it has an IP and gateway, but it's fundamentally confused. A subsequent reboot *might* fix it, which is the most infuriating part of all. It makes you question sanity, hardware, and your life choices.

The Battlefield: Where This Error Breeds

This isn't a universal bug. It's a specific cocktail of hardware and software. Your mileage may vary, but if you're in this ballpark, prepare for pain.

ComponentVersions Triggering ErrorNotes
Network Interface Card (NIC)Mellanox ConnectX-5 (mlx5_core driver)Potentially ConnectX-4/6 as well, anything with similar driver loading characteristics.
Operating SystemUbuntu 20.04 LTS, Ubuntu 22.04 LTSOther distributions using systemd-networkd with similar kernel versions may be affected.
Linux Kernel5.15.x, 5.17.xSpecifically tested on 5.15.0-XX-generic and 5.17.0-XX-generic. Later kernels might have subtly different timings.
Network Managersystemd-networkdThe core of the problem lies here. NetworkManager might exhibit similar issues, but with different symptoms.

A complex
A complex

The Wild Goose Chase: What Didn't Work

Before we get to the solution, let's list the usual suspects that waste your time:

  • Replacing cables: Nope.
  • Updating Mellanox firmware: Good practice, but didn't solve this specific issue.
  • Reinstalling mlx5_core driver: No dice.
  • Bouncing the interface (ip link set dev enpXsY down; ip link set dev enpXsY up): Sometimes works, but not a persistent fix and requires manual intervention.
  • Restarting systemd-networkd: Often works, but again, manual and misses the boot-time race.
  • Adding Requires=network-online.target or After=network-online.target to dependent services: This is good practice for services that need network, but it doesn't fix the underlying problem of networkd itself getting stuck. For insights into building robust pipelines, check out N8n Unleashed: Architecting a Hyper-Efficient Data Enrichment & Notification Pipeline, where reliable network access is paramount.

The Root Cause

Here's the ugly truth: it's a subtle timing mismatch during boot. The mlx5_core driver, while loaded, isn't always *fully* ready to present a stable interface to systemd-networkd in time, especially regarding IPv6 capabilities. systemd-networkd, by default, tries to configure LinkLocalAddressing=ipv6 first. On these specific kernel/driver versions, the IPv6 stack on the Mellanox NIC can be slightly delayed or encounter a transient issue during initial bring-up, causing networkd to effectively 'give up' or get stuck in a weird state while still allowing the IPv4 address to be assigned by DHCP or static config.

It's not that the IPv6 stack fails permanently; it's that systemd-networkd interprets this temporary unreadiness as a permanent failure or stalls on its configuration flow. It's like calling someone who's still putting on their shoes and hanging up because they didn't answer immediately. The IPv4 configuration might *appear* to complete, but networkd never properly transitions the interface to an 'operational' state, preventing routing and general network traffic.

The Fix: Tell systemd-networkd to Chill on IPv6 (for now)

The workaround is shockingly simple: explicitly tell systemd-networkd to ignore IPv6 link-local addressing during initial boot for the problematic interface. This bypasses the specific timing window where it gets stuck. It forces networkd to proceed with IPv4 configuration without waiting for a potentially delayed IPv6 readiness, which often isn't critical for initial boot anyway.

You need to modify the .network file for your specific interface. Locate your configuration file, typically in /etc/systemd/network/. It might be named something like 10-enpXsY.network or similar.

Add or modify the [Link] section:

sudo nano /etc/systemd/network/10-enpXsY.network

[Match]
Name=enpXsY

[Network]
DHCP=yes
LinkLocalAddressing=no

[Link]
# Add this line specifically for the problematic interface
LinkLocalAddressing=no

Yes, you need LinkLocalAddressing=no under [Network] AND [Link]. The [Network] section applies to the overall network configuration, while the [Link] section applies to the properties of the device itself. While often redundant, in this specific race condition, ensuring both are explicitly set to no provides the necessary sledgehammer. After making this change, reload systemd-networkd and restart the service:

sudo networkctl reload
sudo systemctl restart systemd-networkd

Then, ideally, reboot the server to test. The issue should vanish. No more intermittent network failures on boot.

A microscopic view of a circuit board trace with a hairline crack
A microscopic view of a circuit board trace with a hairline crack

Why This Works

By explicitly setting LinkLocalAddressing=no, you're telling systemd-networkd not to bother with IPv6 link-local addresses for that specific interface during its initial setup. This removes the problematic dependency on the Mellanox driver's IPv6 stack being immediately ready. It allows networkd to proceed directly with IPv4 (or other configured addresses) and transition the interface to the 'routable' state without getting hung up.

This isn't a permanent disablement of IPv6 on the system; it's a specific instruction to systemd-networkd for this interface. Other interfaces or services can still use IPv6 if configured. For performance-critical applications, especially those leveraging AI inference, every millisecond counts, and removing such bottlenecks is crucial. Understanding these intricate interactions is as important as understanding the latest advancements in AI hardware like Neuron: The Blistering Edge of AI Inference. These small configuration tweaks can have disproportionately large impacts on system stability and uptime.

This fix doesn't address the underlying kernel/driver timing issue itself, but it provides a robust, predictable workaround that ensures your Mellanox NICs come up reliably every single time. Learn from my pain. Don't let your systems play hide-and-seek with network connectivity.

Discussion

Comments

Read Next