Zrealizowałem w domowej sieci mechanizm failover dla DHCP.
Rozwiązanie skonfigurowane na 2 x rpi4, docker, image: microscotch/dhcpd-alpine:latest
Primary
default-lease-time 3600;
max-lease-time 86400;
authoritative;
log-facility local7;
failover peer „dhcpfailover” {
primary;
address 192.168.0.30;
port 648;
peer address 192.168.0.32;
peer port 648;
mclt 1800;
split 128;
max-response-delay 30;
max-unacked-updates 10;
load balance max seconds 3;
}
subnet 192.168.0.0 netmask 255.255.255.0 {
pool {
failover peer „dhcpfailover”;
max-lease-time 1800;
range 192.168.0.200 192.168.0.249;
}
option routers 192.168.0.1;
option domain-name-servers 192.168.0.31, 192.168.0.30;
}
Secondary
default-lease-time 3600;
max-lease-time 86400;
authoritative;
log-facility local7;
failover peer "dhcpfailover" {
secondary;
address 192.168.0.32;
port 648;
peer address 192.168.0.30;
peer port 648;
mclt 1800;
max-response-delay 30;
max-unacked-updates 10;
load balance max seconds 3;
}
subnet 192.168.0.0 netmask 255.255.255.0 {
pool {
failover peer "dhcpfailover";
max-lease-time 1800;
range 192.168.0.200 192.168.0.249;
}
option routers 192.168.0.1;
option domain-name-servers 192.168.0.31, 192.168.0.30;
}
docker run -d --net host --name dhcpd-primary -v "$(pwd)/dhcpd":/data microscotch/dhcpd-alpine eth0
docker run -d --net host --name dhcpd-secondary -v "$(pwd)/dhcpd":/data microscotch/dhcpd-alpine eth0