|
option domain-name "example.org";:域名,自己的搜索域
option domain-name-servers ns1.example.org, ns2.example.org;:
名称服务器地址 多个服务器地址需要, 逗号隔开
default-lease-time 600;:默认租约期限
max-lease-time 7200;:最大租约期限
# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;:日志设施是什么,存放日志文件在哪里
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
重要:subnet服务器工作在哪个网络中,这个网络中配置是什么
subnet 10.254.239.0(工作与哪个网络) netmask 255.255.255.224(子网掩码) {
range 10.254.239.10 10.254.239.20;:地址池,被分配的IP都存在于此
option routers(网关)10.254.239.1;
option domain-name-servers 61.153.177.196;:dns服务器地址
}
-------------------------------------------------------------------------------------------
配置完成之后:
service dhcpd configtest
使用以上命令对配置文件进行语法测试,通过就可以启动服务了
由于在/etc/rc.d/init.d/下有dhcpd的服务脚本所以可以直接使用service dhcpd start启动服务
启动服务完成之后使用另一台主机测试即可。
/etc/dhcpd.conf ........DHCP服务器的主配置文件
/etc/rc.d/init.d/dhcpd ........DHCP服务启动脚本
/etc/rc.d/init.d/dhcrelay ........DHCP中继服务启动脚本
/etc/sysconfig/dhcpd ........DHCP命令参数配置文件
/etc/sysconfig/dhcrelay ........DHCP中继服务配置文件
/usr/sbin/dhcpd ........DHCP服务器执行程序
/usr/sbin/dhcrelay ........DHCP中继服务器的执行程序
/var/lib/dhcpd/dhcpd.leases ........DHCP服务器租约文件
|
|