I have 2x DHCP Server in each Mikrotik
Let say DHCP1 and DHCP2
DHCP1 will always up and serving full subnet, DHCP2 always down or vice versa
GOAL:
-I want DHCP2 script will detect if DHCP1 service is down and vice versa
If down then bring up DHCP2, disable DHCP1 service someting like"# /etc/init.d/dhcp stop"
QUESTIONS:
how DHCP2 detect status of DHCP1 because I can’t use netwatch.
netwatch only check host is up but not dhcp
if no script to check DHCP1 down from DHCP2 then any possibility for DHCP2 to check status of itself
tq
UPDATE1:
to enable/disable local dhcp are these
/ip dhcp-server enable 0
/ip dhcp-server disable 0
Check this. For your purpose, it is sufficient to just revert the usage logic. Instead of taking an action when the “rogue” (=other) DHCP server is detected, take an action (activate the local dhcp server) when the other one disappears from the unknown-server list (i.e. when the list becomes empty). To do that, you need to schedule a test script every minute or so to check for the contents of the list, and if it is empty, activate your own server.
The rest of the setup depends on whether you prefer the last server active to stay up or whether you prefer that one of the two would be active whenever it is fit.
But DHCP server settings allow to set one of them a secondary one which only offers/assigns addresses if the primary one doesn’t, so you should not need the above DIY setup.
I got your point
OPTION1
no need script to enable local dhcp if remote dhcp down by using primary/secondary dhcp server
I think this what you mean https://www.youtube.com/watch?v=Cpu_76WidAo
Need to test again whether same subnet 2x DHCP Server with delay threshold will causing ip conflict or not
OPTION2:
make each DHCP1 and DHCP2 subnet large enough to handle my host
pros, I can make both DHCP active/active
cons, do you think too much broadcast for /23?