Fedora 40 has no IPv4 connectivity after startup for 10 minutes

I’m running Fedora 40 KDE spin (F36 was my last reinstall) on a Thinkpad T460 with both wired and Wi-Fi Ethernet connections. For a few weeks now after startup (definitely after cold boot, not sure about resume) it won’t connect to some web sites for ~10 minutes, then everything works.

When this recurred today I looked into it. I can access google fine and ping shows it using an IP6 address. But www.ebay is unreachable, using an IPv4 address. I think ifconfig -a only showed inet6 addresses for both interfaces.

This sounds like the old topic Fedora 35 server not getting ipv4 address via dhcp , but my problem fixes itself after ~10 minutes.
I looked in journalctl output and didn’t see any obvious “failed to establish IPv4 connectivity” message. journalctl does include shortly after boot

... NetworkManager[1705]: <info>  [1729540599.2098] dhcp4 (enp0s31f6): activation: beginning transaction (timeout in 45 seconds)

seconds later it gets an IPv6 address:

... seconds later:
... NetworkManager[1705]: <info>  [1729540601.0004] policy: set 'Wired connection 1' (enp0s31f6) as default for IPv6 routing and DNS
... systemd-resolved[1565]: enp0s31f6: Bus client set default route setting: yes
... NetworkManager[1705]: <info>  [1729540601.0043] dhcp6 (enp0s31f6): state changed new lease, address=fd0e:48e6:b537::9f1 2601:645:8800:53cb::9f1

and then I see nothing more about dhcp4 or IPv4, until about 10 minutes after boot there is

... <info>  [1729541117.8174] dhcp4 (enp0s31f6): state changed new lease, address=192.168.1.176, acd pending

So… why does it take 10 minutes to get an IP4 connection?
A few more notes:

  • I ran nmcli connection show <Wired_ethernet_UUID> while broken and working and the only change to output is a new line ipv6.method: auto.
  • systemd-networkd.service is loaded but disabled (I think this is the default in Fedora).
  • Could it be my Wi-Fi router? In 2022 I installed OpenWRT on my Archer C2600/AC2600, haven’t upgraded it since.
  • Later in 2022 I set my router to use Cloudflare DNS using 1.1.1.1 and 1.0.0.1.

What should I do next time this happens? Thanks!

Maybe the “acd pending” notice is a clue about something? Address Conflict Detection is enabled by default as of Fedora Linux 40.

https://fedoraproject.org/wiki/Changes/Enable_IPv4_Address_Conflict_Detection

Try disabling it and see if that helps? Or double-check your network to be sure there are not multiple devices trying to receive the same IP address?

1 Like

Could this possibly be a result of the random MAC address now being used in fedora?

If the system was last installed with f36 there may be 2 or more networkmanager connections existing for the interface and having different MACs in each for the same SSID connection.

You can look in /etc/NetworkManager/system-connections/ to see the defined connections and if there are more than one located there for your home ssid then conflict could be the cause.

I would remove the appropriate connection files from there, then reboot and reconnect the network to see if that fixes the issue.

You can also set a fixed MAC for the interface of different forms in the network setup panel for wifi for each AP as shown below (I use permanent since I am behind 2 firewalls at home and no direct network connection plus I use a reserved IP on the router for my host). The choices there are permanent, random, stable, stable per ssid, or preserve. This is on Workstation with the gnome settings panel.

Thanks for the suggestion! I have no MAC addresses set for wired Ethernet or Wi-Fi in KDE System Settings > Wi-Fi & Networking. My /etc/NetworkManager/system-connections/MYHOMENET.nmconnection seems to contain only one connection

[connection]
id=MYHOMENET
uuid=blah-blah
type=wifi
interface-name=wlp4s0
permissions=user:spage:;

[wifi]
mode=infrastructure
ssid=MYHOMENET

Also, the laptop has both wired Ethernet (no SSID) and Wi-Fi connections, yet I think neither works for IPv4 addresses for those first 10 minutes. Now that it’s working the laptop is currently connecting to IPv4 and IPv6 addresses over wired Ethernet.

Maybe the “acd pending” notice is a clue about something?

Thanks for the thought. The very next line in journalctl, with the same timestamp, is

... NetworkManager[1705]: <info>  [1729541117.9865] dhcp4 (enp0s31f6): state changed new lease, address=192.168.1.176

So dhcp4 quickly assigns that IPv4 address to wired ethernet after “acd pending”. Then a few lines later, still within the same timestamp, it assigns an IPv4 address to the Wi-Fi interface with a similar pair of messages. But why didn’t dhcp4 do this at boot 10 minutes earlier? :thinking:

How do I request an IPv4 address when I didn’t get one at boot? DuckDuckGo found recommendations to use dhclient -r enp0s31f6 which seems to work if I use sudo, and networkctl renew enp0s31f6 but that fails because “systemd-networkd is not running.”

Issues like this are normally troubleshooted with tcpdump or Wireshark.
Capture and analyze the relevant traffic:

sudo tcpdump -evnni any udp port 67

Then compare the output with the DHCP server log.

1 Like

The default Fedora installation doesn’t use dhclient but uses the built-in dhclient of NetworkManager. You can use dhclient, but you need to tell NetworManager in the NetworkManager.conf file.

systemd-networkd isn’t used in default Fedora, but if you want use that, you have to make sure NetworkManager is disabled or maybe even uninstalled.

Thanks! It sounds like next time it happens I should try

nmcli device connect enp0s31f6
nmcli device connect wlp4s0

possibly preceded with disconnect commands. But I don’t see how to tell NetworkManager to give the working connections an IPv4 address; they already got an IPv6 address at boot. Maybe nmcli connection mod 'Wired connection 1' ipv4.method auto. Strange.

I have a NETGEAR R6260 with OpenWRT firmware that iirc has some bug where if something disconnects/reconnects from Ethernet too-many times the port stopped working. It was something small too because a daily server reboot could trigger it.

I solved it by putting my Ethernet stuff behind a hub connected to the router (stuff could re-connect on the hub no problem and maintain a persistent connection with the router).

If you’re doing anything like hardware offload NAT that could trigger something odd too. Checking all cables involved and changing the Ethernet connections to different LAN ports could be a thing to try too.

If your connected device to Ethernet happens to be on USB that could also cause issues (I have some Ethernet controller on USB-C that will work fine for a random amount of time and then stop regardless of re-connecting the Ethernet or restarting the OS-side driver; needed a full power-cycle on the hub)

I also have an old Phenom II board with bad onboard Ethernet. I didn’t think that could happen but the port just drops connections and doesn’t negotiate 1Gbps sometimes; disabled it in BIOS and use a PCI-E one no problem :stuck_out_tongue:


Hopefully it’s something less-hardware involved though! I never had Fedora loose connectivity on Ethernet for any reason that wasn’t hardware-related.

Thanks, I don’t think any of that applies to my case. And why would any of that result in my Fedora laptop getting IPv6 addresses for wired Ethernet and Wi-Fi at boot, but not IPv4 addresses for about 10 minutes?

It could be something with my OpenWRT router, but alas I can’t contact it at 192.xxx.1.1 when IPv4 isn’t working and it doesn’t seem to respond to web requests at its IPv6 http://[xx::xx:xx:xx:xx] URL.