Отказоустойчивый сервис DHCP
[root@server1 ~]# yum install -y dhcp && ssh server2 yum install -y dhcp
[root@server1 /]# chkconfig --level 345 dhcpd on && ssh server2 chkconfig --level 345 dhcpd on
Если нужно указать на каком интерфейсе будет раздавать адреса DHCP серверер
vi /etc/sysconfig/dhcpd
DHCPDARGS=eth0
[root@server1 dhcp]# cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.orig && ssh server2 cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.orig
[root@server1 dhcp]# vi /etc/dhcp/dhcpd.general
ddns-update-style none;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
pool {
failover peer "dhcp";
range 192.168.1.128 192.168.1.228;
}
option routers 192.168.1.254;
option domain-name "corpX.un";
option domain-name-servers 192.168.1.1, 192.168.1.2;
default-lease-time 600;
max-lease-time 7200;
}
[root@server1 dhcp]# scp /etc/dhcp/dhcpd.general server2:/etc/dhcp/dhcpd.general
[root@server1 dhcp]# vi /etc/dhcp/dhcpd.conf
failover peer "dhcp" {
primary;
address 192.168.1.21;
port 519;
peer address 192.168.1.22;
peer port 520;
max-response-delay 60;
max-unacked-updates 10;
mclt 600;
split 128;
load balance max seconds 3;
}
include "/etc/dhcp/dhcpd.general";
[root@server1 dhcp]# ssh server2
[root@server2 /]# vi /etc/dhcp/dhcpd.conf
failover peer "dhcp" {
secondary;
address 192.168.1.22;
port 520;
peer address 192.168.1.21;
peer port 519;
max-response-delay 60;
max-unacked-updates 10;
}
include "/etc/dhcp/dhcpd.general";
ctrl + D
[root@server1 /]# service dhcpd restart && ssh server2 service dhcpd restart
# less /var/log/messages
# less /var/lib/dhcpd/dhcpd.leases
Подавление посторонних DHCP серверов
http://wiki.val.bmstu.ru/doku.php?id=%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81_dhcp#%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0_%D0%BA%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B0%D1%86%D0%B8%D0%B8_%D0%B8_%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D0%BA