Настройка DHCP - option 66
option 66 tftpboot VoIP Phone
yum install dhcp
DHCP использует файл конфигурации /etc/dhcp/dhcpd.conf
option tftp120 code 120 = string;
option tftp66 code 66 = string;
DHCPARGS=eth0;
subnet 192.168.1.0 netmask 255.255.255.0
{
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.3.237;
option tftp120 "192.168.1.253";
option tftp66 "192.168.1.253";
range 192.168.1.50 192.168.1.150;
}
DHCP также использует файл /var/lib/dhcpd/dhcpd.leases для хранения аренды клиентов.
lease 192.168.1.54 {
starts 1 2015/07/06 08:21:57;
ends 1 2015/07/06 20:21:57;
cltt 1 2015/07/06 08:21:57;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:26:8b:04:9b:8c;
uid "\001\000&\213\003\233\214";
}
lease 192.168.1.55 {
starts 1 2015/07/06 08:44:48;
ends 1 2015/07/06 20:22:48;
cltt 1 2015/07/06 08:22:48;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:26:8b:01:97:0b;
uid "\001\000&\213\001\227\013";
cat /var/lib/dhcpd/dhcpd.leases | grep -B 7 -C 1 ac:70
# cat /var/lib/dhcpd/dhcpd.leases | grep -B 7 -C 1 ac:70
lease 192.168.102.142 {
starts 2 2015/07/14 11:09:30;
ends 2 2015/07/14 23:09:30;
cltt 2 2015/07/14 11:09:30;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:26:8b:02:ac:70;
uid "\001\000&\213\002\254p"
<spoiler>
option tftp66 code 66 = string;
subnet 192.168.1.0 netmask 255.255.255.0 {
option tftp66 "192.168.1.11"
option routers 192.168.1.253;
option subnet-mask 255.255.255.0;
option domain-name "example.com";
option domain-name-servers 192.168.1.1;
option time-offset ;
range 192.168.1.10 192.168.1.100;
next-server 192.168.1.11
}
</spoiler>
delete the temporary file dhcpd.leases~:
rm dhcpd.leases~
flush the lease cache dhcpd.leases:
echo "" > dhcpd.leases