Detect rogue DHCP server with Mikrotik router

NC

In this article I will show you how to detect Rogue DHCP server in a LAN with mikrotik router. It will then send an alert to your Gmail and also send an alert to your phone with telegram.

How to detect rogue DHCP server with Mikrotik router

In RouterOS there is a handy tool in the IP DHCP-Server menu for just this purpose. 

Configure DHCP server alerts on interface BridgeLAN

How to detect rogue DHCP server with Mikrotik router

How to detect rogue DHCP server with Mikrotik router

Get Mac addresses of trusted DHCP servers on the BridgeLAN interface.

How to detect rogue DHCP server with Mikrotik router

Add the trusted MAC addresses to the DHCP server alert instance.

How to detect rogue DHCP server with Mikrotik router

You can copy the sample file here:

:log info "Found rogue DHCP server at $[/system clock get date] $[/system clock get time] on interface bridgeLAN]"

#Email

/tool e-mail send to="[email protected]" subject="Found rogue DHCP server at $[/system clock get date] $[/system clock get time] on interface bridgeLAN"

#Telegram

/tool fetch url="https://api.telegram.org/bot1997621392:AAEAr1ScLkKELdyouwEmAb6NAiuRXxZf69k/sendMessage?chat_id=-487913599&text=Found rogue DHCP server at $[/system clock get date] $[/system clock get time] on interface bridgeLAN"

The above code helps you to send alerts to your email as well as your phone with telegram.

How to detect rogue DHCP server with Mikrotik router

I will introduce in more detail how to send email from Mikrotik, and send message to Telegram from mikrotik router in the other article.

After completing the configuration. Let's try the results. You check your Telegram, if there is a warning message, you are successful.

How to detect rogue DHCP server with Mikrotik router

Check your Gmail inbox if you get a warning email you have succeeded.

How to detect rogue DHCP server with Mikrotik router

If this helps don't forget to leave a like and share it.

Facebook: https://www.facebook.com/routerbest

Twitter: https://twitter.com/routerbestcom

Tags: Telegram DHCP Mikrotik Gmail