Community discussions

 
ros44
newbie
Topic Author
Posts: 37
Joined: Sun Feb 25, 2018 2:05 am
Location: Sofia, Bulgaria

Notification for new DHCP leases

Thu Jul 25, 2019 12:53 pm

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!
Last edited by ros44 on Thu Jul 25, 2019 10:54 pm, edited 2 times in total.
Every moment something magical is happening!
 
User avatar
cdiedrich
Forum Veteran
Forum Veteran
Posts: 899
Joined: Thu Feb 13, 2014 2:03 pm
Location: Basel, Switzerland // Bremen, Germany
Contact:

Re: Notification for new DHCP leases  [SOLVED]

Thu Jul 25, 2019 12:58 pm

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
Christopher Diedrich
MTCNA, MTCUME, MTCWE
Basel, Switzerland
Bremen, Germany

There are 10 types of people: Those who understand binary and those who don't.
There are two types of people: Those who can extrapolate from incomplete data
 
ros44
newbie
Topic Author
Posts: 37
Joined: Sun Feb 25, 2018 2:05 am
Location: Sofia, Bulgaria

Re: Notification for new DHCP leases

Thu Jul 25, 2019 1:05 pm

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"
}
Every moment something magical is happening!

Who is online

Users browsing this forum: No registered users and 6 guests