Page MenuHomeVyOS Platform

Hide DHCP leases from interfaces without active DHCP client
Not ApplicablePublicFEATURE REQUEST

Description

The command show dhcp client leases displays all the leases by parsing the ^dhclient_.*.lease$ files in /var/lib/dhcp/.
When the DHCP client is removed from an interface, a lease file stays there and the command continues to show leases from it.

Would be better to hide such leases by default. For example, we can filter lease files and show only those of them for which exists corresponding .pid files.

The code that handles this located in: https://github.com/vyos/vyatta-op/blob/bfec3bce801b15fda969a1bd97e51b9e19dfef93/scripts/vyatta-show-dhclient.pl

Details

Version
-
Is it a breaking change?
Perfectly compatible

Event Timeline

Viacheslav subscribed.

Fixed for both VyOS 1.5-rolling-202401140026 and VyOS 1.4.0-rc2

vyos@r4# run show dh
dhcp    dhcpv6  
[edit]
vyos@r4# run show dhcp client leases 
Interface    eth2
IP address   192.168.100.197               [Active]
Subnet Mask  255.255.255.0
Domain Name  net-v6
Router       192.168.100.1
Name Server  192.168.100.1
DHCP Server  192.168.100.1
DHCP Server  3600
VRF          default
Last Update  Wed Jan 17 14:26:46 EET 2024
Expiry       Wed Jan 17 15:26:46 EET 2024

[edit]
vyos@r4# delete interfaces ethernet eth2 address 
[edit]
vyos@r4# commit
[edit]
vyos@r4# run show dhcp client leases 
[edit]
vyos@r4# 
[edit]
vyos@r4#