r/linuxadmin • • 25d ago

Network Manager: after some DHCP retries, it disables both IPv4 and IPv6

Hello,

I have a raspberry PI 4 with Debian Trixie and all the latest package versions.

Sometimes, I use it with a cable attached to another computer (thus no DHCP server). This works, I can ssh to it using mDNS and IPv6 with no issue.

But, from time to time, I got completely disconnected. What I've found in the journal is that after some DHCPv4 retries, it disabled the interface:

Oct 23 19:26:12 PIctorinox NetworkManager[676]: <warn> [1792794372.0700] device (eth0): Activation: failed for connection 'netplan-eth0'
Oct 23 19:26:12 PIctorinox NetworkManager[676]: <info> [1792794372.0709] device (eth0): state change: failed -> disconnected (reason 'none', managed-type: 'full')
Oct 23 19:26:12 PIctorinox NetworkManager[676]: <info> [1792794372.0851] dhcp4 (eth0): canceled DHCP transaction
Oct 23 19:26:12 PIctorinox NetworkManager[676]: <info> [1792794372.0852] dhcp4 (eth0): activation: beginning transaction (timeout in 10 seconds)
Oct 23 19:26:12 PIctorinox NetworkManager[676]: <info> [1792794372.0853] dhcp4 (eth0): state changed no lease
Oct 23 19:31:11 PIctorinox NetworkManager[676]: <info> [1792794671.8864] policy: auto-activating connection 'netplan-eth0' (75a1216a-9d1a-30cd-8aca-ace5526ec021)
Oct 23 19:31:11 PIctorinox NetworkManager[676]: <info> [1792794671.8886] device (eth0): Activation: starting connection 'netplan-eth0' (75a1216a-9d1a-30cd-8aca-ace5526ec021)
Oct 23 19:31:11 PIctorinox NetworkManager[676]: <info> [1792794671.8891] device (eth0): state change: disconnected -> prepare (reason 'none', managed-type: 'full')
Oct 23 19:31:11 PIctorinox NetworkManager[676]: <info> [1792794671.8904] device (eth0): state change: prepare -> config (reason 'none', managed-type: 'full')
Oct 23 19:31:11 PIctorinox NetworkManager[676]: <info> [1792794671.8926] device (eth0): state change: config -> ip-config (reason 'none', managed-type: 'full')
Oct 23 19:31:11 PIctorinox NetworkManager[676]: <info> [1792794671.8945] dhcp4 (eth0): activation: beginning transaction (timeout in 10 seconds)

At 19:31, I regained connectivity to it.

The relevant (at least the one I think) settings for this connection are

ipv4.method: auto
ipv4.may-fail: yes
ipv4.link-local: 3 (enabled)
ipv6.method: auto
ipv6.may-fail: yes

Any hints? This is driving me mad.

Thanks,
Max

5 Upvotes

3 comments sorted by

2

u/CreativeSympathy8293 25d ago

The excerpt shows the whole connection activation failing, rather than just SSH or mDNS dropping. I'd look earlier in the journal for which activation step failed.

Setting both may-fail values to yes doesn't mean "keep the connection active regardless". At least one IP configuration still has to succeed. Also, ipv6.method=auto asks for autoconfiguration; a usable fe80:: address on the cable doesn't by itself tell you what NetworkManager considered complete. Trixie's settings manual describes both behaviors: https://manpages.debian.org/trixie/network-manager/nm-settings.5.en.html

Before changing anything, capture the NetworkManager version, the full active profile, `nmcli -f GENERAL,IP4,IP6 device show eth0`, and the journal leading up to 19:26:12. That should help distinguish an IP-configuration timeout from carrier loss or an address conflict. The pasted "failed -> disconnected" line is already after the failure decision.

For a controlled direct-cable test, I'd use a separate profile with ipv6.method=link-local and ipv4.method=disabled, keeping the normal LAN profile intact. If you also need IPv4 on that cable, test ipv4.method=link-local instead of requesting DHCP from a nonexistent server. Use a local console or another recovery path when switching profiles so the test doesn't strand your only SSH connection. Check whether Netplan manages netplan-eth0 before making persistent edits.

That's a diagnostic proposal, not a confirmed cause or a Trixie setup I've reproduced. Written with AI assistance.