Convenience hack: add description to DHCP clients
-
I have some devices on my network that I don't easily recognize from the MAC and the host doesn't set client-hostname. Normally I'd have to add a static IP mapping to keep track of these. It's allowed to not specify an IP, but that doesn't map to the live devices..
Anyway, I added a patch below to system.inc to show the description next to live lease info.
It's kinda hacky but works for me :)--- /etc/inc/system.inc 2021-02-08 04:44:12.000000000 -0800 +++ /etc/inc/system.inc 2021-07-09 22:11:17.158591000 -0700 @@ -844,6 +844,14 @@ continue; } + // Add static description to leases + foreach($leases['lease'] as &$ksl) { + if ($ksl['mac'] == $static['mac']) { + $ksl['descr'] = $static['descr']; + break; + } + } + $slease = array(); $slease['ip'] = $static['ipaddr']; $slease['type'] = $static_string;
Note: both the static entry & live lease info will show up in the leases table
Hope this helps someone