该租期数据库文件经常被重建,但是不应该手工修改。
另外如果主机上安装了两个网卡,但是只想让DHCP服务在其中的一个网卡上监听,则需要配置DHCP服务器只在那个设备上启动。在/etc/sysconfig/dhcpd中,把网卡接口的名称添加到DHCPDARGS列表中。
#Command line options here
最后在客户端上使用netconfig命令设置客户端自动获取地址,完成后重启服务即可。
[root@localhost RPMS]# cat /var/lib/dhcp/dhcpd.leases 在服务器上查看已经分配出去的IP
# All times in this file are in UTC (GMT), not your local timezone. This is
# not a bug, so please don't ask about it. There is no portable way to
# store leases in the local timezone, so please don't request this as a
# feature. If this is inconvenient or confusing to you, we sincerely
# apologize. Seriously, though - don't ask.
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.0.1
lease 192.168.1.200 {
starts 6 2007/03/17 04:36:31;
ends 6 2007/03/17 10:36:31;
binding state active;
next binding state free;
hardware ethernet 00:0c:29:67:57:c1;
}
lease 192.168.1.199 {
starts 6 2007/03/17 04:37:13;
ends 6 2007/03/17 10:37:13;
binding state active;
next binding state free;
hardware ethernet 00:0c:29:ef:cc:aa;
uid "\001\000\014)\357\314\252";
client-hostname "cheshi-eeb7e489";
}