network manager DHCP Lease error after cloning debian to new hardware with a docking station

Linux Kernel, Network, and Services configuration.
Message
Author
_Alangave
Posts: 11
Joined: 2024-12-27 00:19

network manager DHCP Lease error after cloning debian to new hardware with a docking station

#1 Post by _Alangave »

Hello,
I have installed Debian 12 on a thinkpad laptop connect to USB-C docking station with wired network -> everything is ok in terms of USB Network, DHCP lease is ok based on docking station MAC address.
I'm using the same docking station to plug my work laptop, and personal one.
In my journey from windows to Debian, I have another laptop originally full windows in which I have created a new partition for dual boot. This later is also a Lenovo thinkpad.

I have cloned the system initially installed on the old laptop to the new partition on new laptop, adapted everything for dual boot, and it's working well with default boot on Debian.

However, when booting to Debian, the network manager is most often having timeout getting DHCP lease, but sometimes, it works!

All other machine connected to docking station are getting DHCP lease with same MAC without any problem. (full windows from work with and W/O VPN, windows partition from this laptop, old Debian laptop, other laptop )

I have dig in the internet, but I see no-one having same issue.

I suspect something
Please help :)
I getting this output from systemctl:

Code: Select all

~$ sudo systemctl status sys-subsystem-net-devices-enx0050b6e61211.device
● sys-subsystem-net-devices-enx0050b6e61211.device - ThinkPad_Lan
     Loaded: loaded
     Active: active (plugged) since Sat 2024-12-28 11:05:03 CET; 3h 23min ago
     Device: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.3/2-4.3:2.0/net/enx0050b6e61211
~$ sudo systemctl status NetworkManager-wait-online.service
× NetworkManager-wait-online.service - Network Manager Wait Online
     Loaded: loaded (/lib/systemd/system/NetworkManager-wait-online.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2024-12-28 11:06:04 CET; 3h 22min ago
       Docs: man:nm-online(1)
    Process: 1186 ExecStart=/usr/bin/nm-online -s -q (code=exited, status=1/FAILURE)
   Main PID: 1186 (code=exited, status=1/FAILURE)
        CPU: 80ms

Dec 28 11:05:04 ktlacsap2-480 systemd[1]: Starting NetworkManager-wait-online.service - Network Manager Wait Online...
Dec 28 11:06:04 ktlacsap2-480 systemd[1]: NetworkManager-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Dec 28 11:06:04 ktlacsap2-480 systemd[1]: NetworkManager-wait-online.service: Failed with result 'exit-code'.
Dec 28 11:06:04 ktlacsap2-480 systemd[1]: Failed to start NetworkManager-wait-online.service - Network Manager Wait Online.
Last edited by _Alangave on 2025-01-11 00:21, edited 1 time in total.

lindi
Debian Developer
Debian Developer
Posts: 621
Joined: 2022-07-12 14:10
Has thanked: 2 times
Been thanked: 124 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#2 Post by lindi »

Do you have the original machine and its clone connected to the same network? If you create a clone your systems will have duplicate machine-id, this will break DHCP.

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#3 Post by _Alangave »

Hello,
No, only 1 device plugged at a time on the docking station, and MAC address is the one of the workstation, not the laptop

CwF
Global Moderator
Global Moderator
Posts: 3192
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 65 times
Been thanked: 278 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#4 Post by CwF »

I suspect the docking station is holding the lease? If over a short time devices are changing but the lease persist for longer. Try to release the lease and issue anew. as root;

Code: Select all

dhclient -r
dhclient
I understand isc-dhcp-client is out-going, if not installed I have no guess.

As far as the machine-id I'm a foggy on the details. I thought that with differing ip and/or domain names some id elements can be the same and we'd see journal entries complaining but with a minimum of an alternate ip it can work.
last I remember, to change it;

Code: Select all

rm -f /etc/machine-id /var/lib/dbus/machine-id
dbus-uuidgen --ensure=/etc/machine-id
dbus-uuidgen --ensure
...then reboot
Mottainai

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#5 Post by _Alangave »

Releasing the lease didn't change anything.
Same for machine-id reset.
Thx for the later.
I'm suspecting some unique id somewhere that confuse the dhcp server of my box, but I cannot figure out so far.

Aki
Global Moderator
Global Moderator
Posts: 4165
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 121 times
Been thanked: 559 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#6 Post by Aki »

Hello,

You can search system logs for more clues; i.e., when the issue appears in current boot:

Code: Select all

sudo journalctl -b --no-pager -p err..warning
sudo journalctl -b --no-pager -g dhcp
You can also collect, analyse and share the full system log in a file (i.e. log.txt):

Code: Select all

script log.txt
sudo journalctl -b --no-pager
exit
If you wish, you can report logs in one of the following ways:
  • attach the logs to a follow-up forum message as a compressed zip or gz file
  • paste the logs into the body of a follow-up message between code tags (if they fit the size of a forum message)
Hope this helps.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#7 Post by _Alangave »

Hello,
journalctl not verbous enough i guess, i continuously get this (and forgot to share earlier) :

Code: Select all

Dec 30 15:38:19 my-machine NetworkManager[1141]: <info>  [1735569499.3860] policy: auto-activating connection 'USB Dock network' (1b7e7a95-e1b4-4289-89ec-0657765a6c73)
Dec 30 15:38:19 my-machine NetworkManager[1141]: <info>  [1735569499.3865] device (enx0050b6e61211): Activation: starting connection 'USB Dock network' (1b7e7a95-e1b4-4289-89ec-0657765a6c73)
Dec 30 15:38:19 my-machine NetworkManager[1141]: <info>  [1735569499.3866] device (enx0050b6e61211): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Dec 30 15:38:19 my-machine NetworkManager[1141]: <info>  [1735569499.3870] device (enx0050b6e61211): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Dec 30 15:38:19 my-machine NetworkManager[1141]: <info>  [1735569499.3876] device (enx0050b6e61211): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Dec 30 15:38:19 my-machine NetworkManager[1141]: <info>  [1735569499.3879] dhcp4 (enx0050b6e61211): activation: beginning transaction (timeout in 45 seconds)
Dec 30 15:39:04 my-machine NetworkManager[1141]: <info>  [1735569544.3577] device (enx0050b6e61211): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Dec 30 15:39:04 my-machine NetworkManager[1141]: <warn>  [1735569544.3587] device (enx0050b6e61211): Activation: failed for connection 'USB Dock network'
Dec 30 15:39:04 my-machine NetworkManager[1141]: <info>  [1735569544.3592] device (enx0050b6e61211): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Dec 30 15:39:04 my-machine NetworkManager[1141]: <info>  [1735569544.3811] dhcp4 (enx0050b6e61211): canceled DHCP transaction
Dec 30 15:39:04 my-machine NetworkManager[1141]: <info>  [1735569544.3812] dhcp4 (enx0050b6e61211): activation: beginning transaction (timeout in 45 seconds)
Dec 30 15:39:04 my-machine NetworkManager[1141]: <info>  [1735569544.3813] dhcp4 (enx0050b6e61211): state changed no lease

Aki
Global Moderator
Global Moderator
Posts: 4165
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 121 times
Been thanked: 559 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#8 Post by Aki »

Hello,
_Alangave wrote: 2024-12-28 13:33

Code: Select all

~$ sudo systemctl status sys-subsystem-net-devices-enx0050b6e61211.device
● sys-subsystem-net-devices-enx0050b6e61211.device - ThinkPad_Lan
     Loaded: loaded
     Active: active (plugged) since Sat 2024-12-28 11:05:03 CET; 3h 23min ago
     Device: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.3/2-4.3:2.0/net/enx0050b6e61211
[/quote]
What is the output of the following command after the IP configuration fails ?
[code]
sudo dhclient -v enx0050b6e61211
Is the name of the network device from USB-C docking station always the same (i.e. enx0050b6e61211) across reboots of the same Debian computer and different Debian computers ?

Is 00:50:b6:e6:12:11 the MAC address of the ethernet interface of the USB-C docking station ?

What is the model and manufacturer of the USB-C docking station ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#9 Post by _Alangave »

Hello,
Yes, always the same, the interface name is based on the MAC address00:50:b6:e6:12:11 (I know it by heart now :) )
The docking station is the Lenovo ThinkPad Hybrid USB-C https://www.lenovo.com/fr/fr/p/accessor ... 40af0135eu
Firmware up to date.
There must be a lock somewhere (Id ? ) preventing DHCP response.

Aki
Global Moderator
Global Moderator
Posts: 4165
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 121 times
Been thanked: 559 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#10 Post by Aki »

Hello,
_Alangave wrote: 2025-01-01 23:12 Hello,
Yes, always the same, the interface name is based on the MAC address00:50:b6:e6:12:11 (I know it by heart now :) )
The docking station is the Lenovo ThinkPad Hybrid USB-C https://www.lenovo.com/fr/fr/p/accessor ... 40af0135euFirmware up to date. There must be a lock somewhere (Id ? ) preventing DHCP response.
Just a little test. Will the DHCP lease be assigned if you unplug the docking station from its power supply before you plug in your cloned Debian machine?

Another little question: what is the installed dhcp client software currently running on the cloned Debian machine ? You can probably check with the following command:

Code: Select all

sudo ps ax | grep dhcp
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#11 Post by _Alangave »

I have tested unplugging power supply of docking station and I got lease right after.
But, my main problem is that it really get the lease randomly, once very 20 time in average, I mean, 1ce every 20 time i start the laptop
Problem is that I'm never sure, after lease is ok, it will be working next time (and is ok very rarely)

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#12 Post by _Alangave »

this is not a stable solution

CwF
Global Moderator
Global Moderator
Posts: 3192
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 65 times
Been thanked: 278 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#13 Post by CwF »

check if you are seeing peers and routers from Debian, looking for a FAILED listing for the routers mac that should be STALE or REACHABLE

Code: Select all

ip -r neighbor
Mottainai

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#14 Post by _Alangave »

Tested today : after boot, network-manager error, but if I then cut power/power back the docking station, network is back instantly ...
Don't have this issues with other laptop and/or windows partition on same laptop

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#15 Post by _Alangave »

CwF wrote: 2025-01-05 02:09 check if you are seeing peers and routers from Debian, looking for a FAILED listing for the routers mac that should be STALE or REACHABLE

Code: Select all

ip -r neighbor
After the trick of unplug/plug power, i get :
_gateway dev enx0050b6e61211 lladdr xxxxxxxxxxxx REACHABLE

CwF
Global Moderator
Global Moderator
Posts: 3192
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 65 times
Been thanked: 278 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#16 Post by CwF »

_Alangave wrote: 2025-01-06 23:02 _gateway dev enx0050b6e61211 lladdr xxxxxxxxxxxx REACHABLE
Ok, keep checking that, especially when it's not working.

I'm unsure where I'd go know... if we suspect a config issue on Debian and not a dhcp server error on the router/dock, there should be an error to find in the logs. Can you get into any config on the dock?
On Debian, look at the device specific file in /var/lib/dhcp/dhclient.leases. It does track the last lease and maybe there is an issue there?
Mottainai

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware

#17 Post by _Alangave »

Hello,
The file /var/lib/dhcp/dhclient.leases was showing a wrong Ip address, not the one I get when I powerdown/powerup the docking station.
I did dhclient -r / dhclient to renew lease, no change.
I removed the file /var/lib/dhcp/dhclient.leases , reboot, still network-manager error.
Then, I powerdown/powerup the docking station and get a lease, but the file var/lib/dhcp/dhclient.leases is not being recreated (neither for the WiFi which is working fine)
Looks like network-manager is not using dhclient ...
And network-manager service is showing failed in systemctl even after getting the lease.

CwF
Global Moderator
Global Moderator
Posts: 3192
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 65 times
Been thanked: 278 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#18 Post by CwF »

_Alangave wrote: 2025-01-09 23:46 Looks like network-manager is not using dhclient ...
I don't use network-manager so am unsure. You may try without, remove it and manually define everything in /etc/network/interfaces.d/
Mottainai

Aki
Global Moderator
Global Moderator
Posts: 4165
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 121 times
Been thanked: 559 times

Re: network manager DHCP Lease error after cloning debian to new hardware

#19 Post by Aki »

Hello,

According to the user manual of the dock [1]:
Using the Ethernet connector

The Ethernet connector has two network status indicators. When the green indicator is on, the computer is
connected to a LAN. When the yellow indicator blinks, data is being transmitted.

The following functions are available on supported computers when the dock is connected to both the
computer and the LAN
. For the supported computer information, refer to the document Network function
support – Option Compatibility Matrix available at www.lenovo.com/accessoriesguide
[..]
MAC address Pass Through
After enabling the MAC address Pass Through function, your dock MAC address is the same as that of your computer
I don't know if your cloned Debian machine is a "supported machine". If not, the MAC address of the dock may not be the MAC address of the network interface configured by the Debian machine on which you are experiencing the problem. So for unsupported computers, the Lenovo documentation does not clarify which MAC address is sent to the dhcp server to request a dhcp lease.

You can do some further tests with the network manager, if you wish.

You can dump the network configuration (as seen by the Network Manager) for both original and cloned Debian machines with the following command, replacing CONNECTION_NAME with the ethernet connection name listed by the first of the two commands:

Code: Select all

$ nmcli connection show --active
$ nmcli -f active connection show "CONNECTION_NAME"
A further test could be done collecting the output of previous commands from a third Debian computer, different from the first two.

Some other logs could be collected before and after powering off/turning on the docking station.

Comparing the three logs could give some more clues.

--
[1] ThinkPad Hybrid USB-C with USB-A Dock User Guide

--
note: please update the subject of the first message to add the information about the dock station; i.e.:
network manager DHCP Lease error after cloning debian to new hardware with a docking station
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

_Alangave
Posts: 11
Joined: 2024-12-27 00:19

Re: network manager DHCP Lease error after cloning debian to new hardware with a docking station

#20 Post by _Alangave »

To day, I swapped the docking station with another one, same model/brand, new MAC address and, guess what ? same issue
I'm lost

Post Reply