DHCP 服务器的配置
1、安装DHCP服务器软件
# cd /media/cdrom/RedHat/RPMS 进入软件包
# rpm -ivh dhcp-3.0.1-12_EL.i386.rpm 安装软件
2、dhcpd.conf配置文件解析
#vi /etc/dhcpd.conf 编辑配置文件
ddns-update-style interim;
default-leae-time 21600;
max-lease-time 43200;
option domain-name "abc.com"
option domain-name-servers 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;
host server01{
hardware ethernet b0:c0:c3:22:46:81;
fixed-address 192.168.1.11;
}
}
# 缺省租约时间
default-lease-time 21600;
# 最大租约时间
max-lease-time 43200;
# 子网掩码选项
option subnet-mask 255.255.255.0;
# 广播地址
option broadcast-address 192.168.1.255;
# 路由器地址
option routers 192.168.1.1;
# DNS地址
option domain-name-servers 192.168.1.1;
# 域名
option domain-name netreslab.org;
# 以上都是全局参数
# 子网声明和掩码
subnet 192.168.1.0 netmask 255.255.255.0 {
# 范围
3、多网络接口时需要配置的文件
# vi /etc/sysconfig/dhcpd
DHCPDARGS=eth0
4、dhcpd服务的启动与停止
#service dhcpd start
#service dhcpd stop
#service dhcpd restart
#service dhcpd status