Hello, I want a script that warned me by email that a user has been added to my DHCP server. Not as a wireless user but as an intruder on my network.
I have a fixed number of devices on the router board.
If there is still a device, I want this script to warn me.
Does anyone have experience with that?
thanks in advance
Hi plisken,
This shoud get you started, just insert it in your DHCP server script window.
Make sure you have the email configured in Tools->Email first.
:local recipient "you@mail.com"
/ip dhcp-server lease
:if ($leaseBound = 1) do={
:do {
:tool e-mail send to=$recipient subject="DHCP Address Alert [MAC: $leaseActMAC]" body="The following MAC address [$leaseActMAC] received an IP address [$leaseActIP] from the DHCP Server [$leaseServerName]"
:log info "Sent DHCP alert for MAC $leaseActMAC"
} on-error={:log error "Failed to send alert email to $recipient"}
}
Icosa.