Page 1 of 1

Notification for new DHCP leases

Posted: Thu Jul 25, 2019 12:53 pm
by ros44
Hello guys, I found only one similar question in the forum, but without any replies of it.

All my devices in the network have statically assigned DHCP leases. Still, there is a pool of 5 addresses available if new devices connect to the network accidentally.

Is there any mechanism I can configure so that when a DHCP lease from that 5-address pool is given to e new device I will get a notification? May be an email or something similar?

Thank you!

Re: Notification for new DHCP leases  [SOLVED]

Posted: Thu Jul 25, 2019 12:58 pm
by cdiedrich
Sure.
Take a look at "lease-script" in the dhcp-server manual.
Add your matchers against the leaseActIP variable and then trigger an email.

-Chris

Re: Notification for new DHCP leases

Posted: Thu Jul 25, 2019 1:05 pm
by ros44
Thank you! It seems so clear and obvious.
Best of luck!

Edit: a simple script for anyone reading this post.

:if ($leaseActIP = "192.168.1.130") do={
:log info "IP: $leaseActIP, MAC: $leaseActMAC, Host: $"lease-hostname""
:tool e-mail send to=email@example.com subject="Violation alert!!! New DHCP client in the network" body="MAC: $leaseActMAC,
IP: $leaseActIP,
Host: $"lease-hostname",
$leaseBound"
}