目录
操作命令
apt-get install -y isc-dhcp-server
vi /etc/default/isc-dhcp-server
我的修改内容为
INTERFACES="ens192"
vi /etc/dhcp/dhcpd.conf
root@localhost:~# egrep "^[^#]" /etc/dhcp/dhcpd.conf
ddns-update-style none;
option domain-name "example.org";
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 1.1.1.0 netmask 255.255.255.0 {
range 1.1.1.10 1.1.1.30;
option domain-name-servers 1.1.1.1;
option subnet-mask 255.255.255.0;
option routers 1.1.1.1;
option broadcast-address 1.1.1.255;
default-lease-time 600;
max-lease-time 7200;
}
保存退出,然后重启dhcp服务service isc-dhcp-server restart
netstat -uap
可查看dhcp服务是否正常
/var/lib/dhcp/dhcpd.leases
记录了所有isc-dhcp-server分配的IP地址信息
可参考http://blog.topspeedsnail.com/archives/5924