networkmanager and dhcl_lease_time

Michael Traxler M.Traxler at gsi.de
Mon Jun 24 17:36:33 UTC 2024


Hello Andrei,

thanks for you reply!

Here is the initial transaction when the interface comes up with the
transmitted lease time of 86400s which is also recognized by the client.

tshark  -i eno2 -f "(port 67 or port 68) and ip host 192.168.103.123"

Frame 1: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
     Interface id: 0 (eno2)
         Interface name: eno2
     Encapsulation type: Ethernet (1)
     Arrival Time: Jun 24, 2024 16:51:10.651854399 CEST
     [Time shift for this packet: 0.000000000 seconds]
     Epoch Time: 1719240670.651854399 seconds
     [Time delta from previous captured frame: 0.000000000 seconds]
     [Time delta from previous displayed frame: 0.000000000 seconds]
     [Time since reference or first frame: 0.000000000 seconds]
     Frame Number: 1
     Frame Length: 342 bytes (2736 bits)
     Capture Length: 342 bytes (2736 bits)
     [Frame is marked: False]
     [Frame is ignored: False]
     [Protocols in frame: eth:ethertype:ip:udp:bootp]
Ethernet II, Src: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b), Dst: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
     Destination: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
         Address: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Source: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         Address: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.100.50, Dst: 192.168.103.123
     0100 .... = Version: 4
     .... 0101 = Header Length: 20 bytes (5)
     Differentiated Services Field: 0x10 (DSCP: Unknown, ECN: Not-ECT)
         0001 00.. = Differentiated Services Codepoint: Unknown (4)
         .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
     Total Length: 328
     Identification: 0x0000 (0)
     Flags: 0x0000
         0... .... .... .... = Reserved bit: Not set
         .0.. .... .... .... = Don't fragment: Not set
         ..0. .... .... .... = More fragments: Not set
     Fragment offset: 0
     Time to live: 128
     Protocol: UDP (17)
     Header checksum: 0xec96 [validation disabled]
     [Header checksum status: Unverified]
     Source: 192.168.100.50
     Destination: 192.168.103.123
User Datagram Protocol, Src Port: 67, Dst Port: 68
     Source Port: 67
     Destination Port: 68
     Length: 308
     Checksum: 0x3a7f [unverified]
     [Checksum Status: Unverified]
     [Stream index: 0]
Bootstrap Protocol (Offer)
     Message type: Boot Reply (2)
     Hardware type: Ethernet (0x01)
     Hardware address length: 6
     Hops: 0
     Transaction ID: 0xf181a419
     Seconds elapsed: 2
     Bootp flags: 0x0000 (Unicast)
         0... .... .... .... = Broadcast flag: Unicast
         .000 0000 0000 0000 = Reserved flags: 0x0000
     Client IP address: 0.0.0.0
     Your (client) IP address: 192.168.103.123
     Next server IP address: 192.168.100.50
     Relay agent IP address: 0.0.0.0
     Client MAC address: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
     Client hardware address padding: 00000000000000000000
     Server host name: 192.168.100.50
     Boot file name: pxelinux.0
     Magic cookie: DHCP
     Option: (53) DHCP Message Type (Offer)
         Length: 1
         DHCP: Offer (2)
     Option: (54) DHCP Server Identifier
         Length: 4
         DHCP Server Identifier: 192.168.100.50
     Option: (51) IP Address Lease Time
         Length: 4
         IP Address Lease Time: (86400s) 1 day
     Option: (1) Subnet Mask
         Length: 4
         Subnet Mask: 255.255.240.0
     Option: (6) Domain Name Server
         Length: 4
         Domain Name Server: 192.168.100.50
     Option: (15) Domain Name
         Length: 12
         Domain Name: hades.gsi.de
     Option: (28) Broadcast Address
         Length: 4
         Broadcast Address: 192.168.111.255
     Option: (3) Router
         Length: 4
         Router: 192.168.100.90
     Option: (255) End
         Option End: 255
     Padding: 000000000000

Frame 2: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
     Interface id: 0 (eno2)
         Interface name: eno2
     Encapsulation type: Ethernet (1)
     Arrival Time: Jun 24, 2024 16:51:10.652701531 CEST
     [Time shift for this packet: 0.000000000 seconds]
     Epoch Time: 1719240670.652701531 seconds
     [Time delta from previous captured frame: 0.000847132 seconds]
     [Time delta from previous displayed frame: 0.000847132 seconds]
     [Time since reference or first frame: 0.000847132 seconds]
     Frame Number: 2
     Frame Length: 342 bytes (2736 bits)
     Capture Length: 342 bytes (2736 bits)
     [Frame is marked: False]
     [Frame is ignored: False]
     [Protocols in frame: eth:ethertype:ip:udp:bootp]
Ethernet II, Src: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b), Dst: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
     Destination: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
         Address: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Source: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         Address: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.100.50, Dst: 192.168.103.123
     0100 .... = Version: 4
     .... 0101 = Header Length: 20 bytes (5)
     Differentiated Services Field: 0x10 (DSCP: Unknown, ECN: Not-ECT)
         0001 00.. = Differentiated Services Codepoint: Unknown (4)
         .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
     Total Length: 328
     Identification: 0x0000 (0)
     Flags: 0x0000
         0... .... .... .... = Reserved bit: Not set
         .0.. .... .... .... = Don't fragment: Not set
         ..0. .... .... .... = More fragments: Not set
     Fragment offset: 0
     Time to live: 128
     Protocol: UDP (17)
     Header checksum: 0xec96 [validation disabled]
     [Header checksum status: Unverified]
     Source: 192.168.100.50
     Destination: 192.168.103.123
User Datagram Protocol, Src Port: 67, Dst Port: 68
     Source Port: 67
     Destination Port: 68
     Length: 308
     Checksum: 0x377f [unverified]
     [Checksum Status: Unverified]
     [Stream index: 0]
Bootstrap Protocol (ACK)
     Message type: Boot Reply (2)
     Hardware type: Ethernet (0x01)
     Hardware address length: 6
     Hops: 0
     Transaction ID: 0xf181a419
     Seconds elapsed: 2
     Bootp flags: 0x0000 (Unicast)
         0... .... .... .... = Broadcast flag: Unicast
         .000 0000 0000 0000 = Reserved flags: 0x0000
     Client IP address: 0.0.0.0
     Your (client) IP address: 192.168.103.123
     Next server IP address: 192.168.100.50
     Relay agent IP address: 0.0.0.0
     Client MAC address: 74:78:27:0d:b5:2d (74:78:27:0d:b5:2d)
     Client hardware address padding: 00000000000000000000
     Server host name: 192.168.100.50
     Boot file name: pxelinux.0
     Magic cookie: DHCP
     Option: (53) DHCP Message Type (ACK)
         Length: 1
         DHCP: ACK (5)
     Option: (54) DHCP Server Identifier
         Length: 4
         DHCP Server Identifier: 192.168.100.50
     Option: (51) IP Address Lease Time
         Length: 4
         IP Address Lease Time: (86400s) 1 day
     Option: (1) Subnet Mask
         Length: 4
         Subnet Mask: 255.255.240.0
     Option: (6) Domain Name Server
         Length: 4
         Domain Name Server: 192.168.100.50
     Option: (15) Domain Name
         Length: 12
         Domain Name: hades.gsi.de
     Option: (28) Broadcast Address
         Length: 4
         Broadcast Address: 192.168.111.255
     Option: (3) Router
         Length: 4
         Router: 192.168.100.90
     Option: (255) End
         Option End: 255
     Padding: 000000000000


===================================================================


And here a dump of renewal of one of the many machines in the network:

Frame 1: 318 bytes on wire (2544 bits), 318 bytes captured (2544 bits) on interface 0
     Interface id: 0 (eno2)
         Interface name: eno2
     Encapsulation type: Ethernet (1)
     Arrival Time: Jun 24, 2024 17:09:38.287059938 CEST
     [Time shift for this packet: 0.000000000 seconds]
     Epoch Time: 1719241778.287059938 seconds
     [Time delta from previous captured frame: 0.000000000 seconds]
     [Time delta from previous displayed frame: 0.000000000 seconds]
     [Time since reference or first frame: 0.000000000 seconds]
     Frame Number: 1
     Frame Length: 318 bytes (2544 bits)
     Capture Length: 318 bytes (2544 bits)
     [Frame is marked: False]
     [Frame is ignored: False]
     [Protocols in frame: eth:ethertype:ip:udp:bootp]
Ethernet II, Src: AsustekC_9c:68:69 (60:45:cb:9c:68:69), Dst: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
     Destination: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         Address: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Source: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
         Address: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.103.10, Dst: 192.168.100.50
     0100 .... = Version: 4
     .... 0101 = Header Length: 20 bytes (5)
     Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)
         1100 00.. = Differentiated Services Codepoint: Class Selector 6 (48)
         .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
     Total Length: 304
     Identification: 0x84b1 (33969)
     Flags: 0x4000, Don't fragment
         0... .... .... .... = Reserved bit: Not set
         .1.. .... .... .... = Don't fragment: Set
         ..0. .... .... .... = More fragments: Not set
     Fragment offset: 0
     Time to live: 64
     Protocol: UDP (17)
     Header checksum: 0x67be [validation disabled]
     [Header checksum status: Unverified]
     Source: 192.168.103.10
     Destination: 192.168.100.50
User Datagram Protocol, Src Port: 68, Dst Port: 67
     Source Port: 68
     Destination Port: 67
     Length: 284
     Checksum: 0x6148 [unverified]
     [Checksum Status: Unverified]
     [Stream index: 0]
Bootstrap Protocol (Request)
     Message type: Boot Request (1)
     Hardware type: Ethernet (0x01)
     Hardware address length: 6
     Hops: 0
     Transaction ID: 0x03a5f95a
     Seconds elapsed: 14144
     Bootp flags: 0x0000 (Unicast)
         0... .... .... .... = Broadcast flag: Unicast
         .000 0000 0000 0000 = Reserved flags: 0x0000
     Client IP address: 192.168.103.10
     Your (client) IP address: 0.0.0.0
     Next server IP address: 0.0.0.0
     Relay agent IP address: 0.0.0.0
     Client MAC address: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
     Client hardware address padding: 00000000000000000000
     Server host name not given
     Boot file name not given
     Magic cookie: DHCP
     Option: (53) DHCP Message Type (Request)
         Length: 1
         DHCP: Request (3)
     Option: (61) Client identifier
         Length: 7
         Hardware type: Ethernet (0x01)
         Client MAC address: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
     Option: (55) Parameter Request List
         Length: 17
         Parameter Request List Item: (1) Subnet Mask
         Parameter Request List Item: (2) Time Offset
         Parameter Request List Item: (6) Domain Name Server
         Parameter Request List Item: (12) Host Name
         Parameter Request List Item: (15) Domain Name
         Parameter Request List Item: (26) Interface MTU
         Parameter Request List Item: (28) Broadcast Address
         Parameter Request List Item: (121) Classless Static Route
         Parameter Request List Item: (3) Router
         Parameter Request List Item: (33) Static Route
         Parameter Request List Item: (40) Network Information Service Domain
         Parameter Request List Item: (41) Network Information Service Servers
         Parameter Request List Item: (42) Network Time Protocol Servers
         Parameter Request List Item: (119) Domain Search
         Parameter Request List Item: (249) Private/Classless Static Route (Microsoft)
         Parameter Request List Item: (252) Private/Proxy autodiscovery
         Parameter Request List Item: (17) Root Path
     Option: (57) Maximum DHCP Message Size
         Length: 2
         Maximum DHCP Message Size: 65535
     Option: (255) End
         Option End: 255

Frame 2: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
     Interface id: 0 (eno2)
         Interface name: eno2
     Encapsulation type: Ethernet (1)
     Arrival Time: Jun 24, 2024 17:09:38.287287131 CEST
     [Time shift for this packet: 0.000000000 seconds]
     Epoch Time: 1719241778.287287131 seconds
     [Time delta from previous captured frame: 0.000227193 seconds]
     [Time delta from previous displayed frame: 0.000227193 seconds]
     [Time since reference or first frame: 0.000227193 seconds]
     Frame Number: 2
     Frame Length: 342 bytes (2736 bits)
     Capture Length: 342 bytes (2736 bits)
     [Frame is marked: False]
     [Frame is ignored: False]
     [Protocols in frame: eth:ethertype:ip:udp:bootp]
Ethernet II, Src: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b), Dst: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
     Destination: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
         Address: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Source: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         Address: SuperMic_ad:03:2b (ac:1f:6b:ad:03:2b)
         .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
         .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
     Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.105.51, Dst: 192.168.103.10
     0100 .... = Version: 4
     .... 0101 = Header Length: 20 bytes (5)
     Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
         0000 00.. = Differentiated Services Codepoint: Default (0)
         .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
     Total Length: 328
     Identification: 0x9a2f (39471)
     Flags: 0x4000, Don't fragment
         0... .... .... .... = Reserved bit: Not set
         .1.. .... .... .... = Don't fragment: Set
         ..0. .... .... .... = More fragments: Not set
     Fragment offset: 0
     Time to live: 64
     Protocol: UDP (17)
     Header checksum: 0x4de7 [validation disabled]
     [Header checksum status: Unverified]
     Source: 192.168.105.51
     Destination: 192.168.103.10
User Datagram Protocol, Src Port: 67, Dst Port: 68
     Source Port: 67
     Destination Port: 68
     Length: 308
     Checksum: 0x52d4 [unverified]
     [Checksum Status: Unverified]
     [Stream index: 1]
Bootstrap Protocol (ACK)
     Message type: Boot Reply (2)
     Hardware type: Ethernet (0x01)
     Hardware address length: 6
     Hops: 0
     Transaction ID: 0x03a5f95a
     Seconds elapsed: 14144
     Bootp flags: 0x0000 (Unicast)
         0... .... .... .... = Broadcast flag: Unicast
         .000 0000 0000 0000 = Reserved flags: 0x0000
     Client IP address: 192.168.103.10
     Your (client) IP address: 192.168.103.10
     Next server IP address: 192.168.100.50
     Relay agent IP address: 0.0.0.0
     Client MAC address: AsustekC_9c:68:69 (60:45:cb:9c:68:69)
     Client hardware address padding: 00000000000000000000
     Server host name: 192.168.100.50
     Boot file name: pxelinux.0
     Magic cookie: DHCP
     Option: (53) DHCP Message Type (ACK)
         Length: 1
         DHCP: ACK (5)
     Option: (54) DHCP Server Identifier
         Length: 4
         DHCP Server Identifier: 192.168.100.50
     Option: (51) IP Address Lease Time
         Length: 4
         IP Address Lease Time: (86400s) 1 day
     Option: (1) Subnet Mask
         Length: 4
         Subnet Mask: 255.255.240.0
     Option: (6) Domain Name Server
         Length: 4
         Domain Name Server: 192.168.100.50
     Option: (15) Domain Name
         Length: 12
         Domain Name: hades.gsi.de
     Option: (28) Broadcast Address
         Length: 4
         Broadcast Address: 192.168.111.255
     Option: (3) Router
         Length: 4
         Router: 192.168.100.90
     Option: (255) End
         Option End: 255
     Padding: 000000000000



===================================================================


Concerning the question, what the dhclient is:
I have modern Tumbleweed machines, and there is not dhclient process, so I
assume that it is hidden now in systemd?
I can not find, who is listening on port 68! Why do they hide it?

ss -uln | ag :68
doesn't deliver anything.

Then I have found very old Tumbleweed, which asks very often, which has a
dhclient listening on port

output of "ss -ulnp"
UNCONN      0      0    0.0.0.0:68 0.0.0.0:* users:(("dhclient",pid=2240,fd=6)) 
this process:
/sbin/dhclient -d -q -sf /usr/lib/nm-dhcp-helper -pf /var/run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-86bcf7a0-e1ca-36f1-bf75-803f64dfcfde-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0

and some of them use wickedd-dhcp4
# ss -ulnp | ag :68
UNCONN 4352   0        0.0.0.0%eth0:68         0.0.0.0:*    users:(("wickedd-dhcp4",pid=1131,fd=10))
UNCONN 4352   0        0.0.0.0%p4p1:68         0.0.0.0:*    users:(("wickedd-dhcp4",pid=1131,fd=8))

So, this is strange...

Everything is fine, the lease time arrives correctly to the clients and is
displayed in network-manager correctly, but still it is not honoured.

Viele Grüße

Michael

---------------------------------------

On Fri, 21 Jun 2024, Andrei Borzenkov wrote:

> Date: Fri, 21 Jun 2024 15:17:45
> From: Andrei Borzenkov <arvidjaar at gmail.com>
> To: Michael Traxler <M.Traxler at gsi.de>, networkmanager at lists.freedesktop.org
> Subject: Re: networkmanager and dhcl_lease_time
> 
> On 21.06.2024 13:19, Michael Traxler wrote:
>>  Hello,
>>
>>  I have the following problem:
>>  My DHCP-server gives all clients a lease time of
>>  86400 seconds.
>>
>>  I can also see on the clients that this was recognized:
>>
>>  ufsd3:~ # nmcli connection show main | ag dhcp_lease
>>  DHCP4.OPTION[3]:                        dhcp_lease_time = 86400
>>
>>  Now my problem is, that I expect after half a day, a new DHCP request to
>>  renew
>>  the DHCP lease.
>>
>>  But what I get is, that the clients (many of them) send every 60 seconds a
>>  new
>>  DHCP request:
>>
>>  # tshark  -i eno2 -f "port 67 or port 68"
>>        6 60.354801706 192.168.103.123 → 192.168.100.50 DHCP 325 DHCP
>>        Request  - Transaction ID 0x4b7f2ef1
>>        7 60.355285370 192.168.105.51 → 192.168.103.123 DHCP 342 DHCP ACK
>>        - Transaction ID 0x4b7f2ef1
>>        9 120.697304414 192.168.103.123 → 192.168.100.50 DHCP 325 DHCP
>>        Request  - Transaction ID 0xd90c71b5
>>       10 120.698068892 192.168.105.51 → 192.168.103.123 DHCP 342 DHCP ACK
>>       - Transaction ID 0xd90c71b5
>>       12 181.602768470 192.168.103.123 → 192.168.100.50 DHCP 325 DHCP
>>       Request  - Transaction ID 0x97391f7f
>>       13 181.603247659 192.168.105.51 → 192.168.103.123 DHCP 342 DHCP ACK
>>       - Transaction ID 0x97391f7f
>>
>>  Why is that so? Is this a networkmanager issue? Or something else?
>>  Is it a bug in the distrbution (mainly OpenSuSE Tumbleweed what I use)?
>>
>>  Any help is appreciated.
>> 
>
>
> DHCP T1 (renewal) timeout can be overridden by server. NetworkManager can use 
> external DHCP client so this behavior is beyond NetworkManager control and 
> scope. What client is used? Show full DHCP server reply for the initial 
> transaction.
>
> I do not observe this behavior on NetworkManager 1.36.6 (Ubuntu 22.04) using 
> internal DHCP client.
>
>


More information about the Networkmanager mailing list