i have 2 routerboard to be used as failover dhcp servers, is there any option/menu/script for this?
if there isn’t any facility for this,can i request for the next version?
Deleted because not related.
You could use authoritative and delay threshold to make the backup answer if the primary doesn’t. But that won’t help if the board has failed and has other functions.
can i use ip->dhcp-server->alert option mixed with netwatch?
note:this routers for dhcp-server purpose only, not the backbone router running VRRP
On Russian http://www.bubnovd.net/2017/07/dhcp-failover-with-routeros.html
Main DHCP server:
if ([:len [/file find name=leases.rsc]]>0) do={/file remove leases.rsc}
/ip dhcp-server lease export file=leases.rsc
Backup DHCP server:
if ([:len [/file find name=leases.rsc]]>0) do={/file remove leases.rsc}
/tool fetch mode=ftp address=192.168.1.1 src-path=leases.rsc user=FTP password=http://bubnovd.net
if ([:len [/file find name=leases.rsc]]>0) do={
foreach i in=[/ip dhcp-server lease find ] do={
/ip dhcp-server lease remove $i
};
import leases.rsc;
}
Instead of using methods to transfer the lease data, you can also allocate a subnet sufficiently large to hold
two times the number of hosts, and then just install 2 DHCP servers each with half of the usable space in the pool.
Of course the address of a system will change when it tries to renew its lease and the DHCP server that issued
the original lease is down.
Great little script for that… appreciate it!
pe1chl, it’s necessary because many of us make the leases static for IP assignment, rate limiting, or address-list assignments. Probably other reasons too…
@cbrown
I am not clear on this
-
“You could use authoritative and delay threshold to make the backup answer if the primary doesn’t”
Do you mean 2xDHCP Server+delay threshold won’t work as Active-Active meaning only Active-Standby.
if yes that mean I prefer not to use that solution -
“But that won’t help if the board has failed and has other functions”
Do you mean if whole host and not just DHCP1 service down, DHCP2 won’t activate?
What will happen with DHCP2 if DHCP1+SSH service in HOST1 down
UPDATE1:
- after reading this
https://maulanashio23.blogspot.com/2017/08/pengertian-delay-threshold-dengan.html
clearly that delay-threshold is Active-Passive - so I think not too large subnet. just enough to handle total user, should be good
https://community.spiceworks.com/topic/1850079-dhcp-for-large-subnet