Hi folks,
I’m solving a dhcp-lease script where a message is sent via whatsapp in case a dhcp rogue server appears on one of the VLAN branches. Where can be the error? The script is not running in this form
Please help…
I need in case of a rogue dhcp server the interface to detect the dhcp server and send the rights to the external service (in this case whatsapp).
The MAC address of the DHCP Server is important in this case to identify the port on the internal network and disable it.
:if ($bound=1) do={
:local tel "+420728XXXXXX"
:local apikey "XXXXXXXX"
:local iface $interface
:local gw [ /ip dhcp-client get [ find interface=$"iface" ] gateway ]
:local MAC [/ip arp get [/ip arp find address=$IP] mac-address]
/tool fetch http-method=get mode=https url="https://api.callmebot.com/whatsapp.php?phone=\$tel apikey=\$apikey text=\"Na rozhrani \$interface se objevil Rougue DHCP-SERVER s IP:\$IP a MAC:\$MAC";
/log warning "https://api.callmebot.com/whatsapp.php?phone=\$tel apikey=\$apikey text=\"Na rozhrani \$interface se objevil Rougue DHCP-SERVER s IP:\$IP a MAC:\$MAC";
}