DHCP配置(以实例说明)
要求:配置企业内部DHCP服务器
提供DHCP服务的网络接口eth0:192.168.1.2/255.255.255.0
动态分配IP范围:192.168.1.100~192.168.1.200
网关和DNS:192.168.1.1
绑定经理IP:192.168.1.100
经理主机MAC地址:b0:c0:c3:22:46
在同网段DHCP客户机上验证
配置--DHCP服务端
1.安装DHCP服务器软件 在EHEL4第4张光盘
#rpm -ivh dhcp*
2.创建dhcpd.conf配置文件,可复制样本文件
#cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
3.修改配置文件/etc/dhcpd.conf
#vi /etc/dhcpd.conf
domain-name-servers:192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.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.100;
}
}
4.修改dhcpd配置文件:/etc/sysconfig/dhcpd
#vi /etc/sysconfig/dhcpd
DHCPDARGS=eth0
5.dhcp服务的启动与停止
#service dhcpd start
6.设置DHCP自动启动的运行级别
#chkconfig --level 35 dhcpd on
--客户端配置
1.修改网络接口配置文件ifcfig-eth0,也可通过netconfig命令修改
#vi /etc/sysconfig/network-scripts/ifcfig-eth0
DEVICE=eth0
NBOOT=yes
BOOTPROTO=dhcp
2.重启网络接口
#ifdown eth0 ; ifup eth0
或者#network restart
提供DHCP服务的网络接口eth0:192.168.1.2/255.255.255.0
动态分配IP范围:192.168.1.100~192.168.1.200
网关和DNS:192.168.1.1
绑定经理IP:192.168.1.100
经理主机MAC地址:b0:c0:c3:22:46
在同网段DHCP客户机上验证
配置--DHCP服务端
1.安装DHCP服务器软件 在EHEL4第4张光盘
#rpm -ivh dhcp*
2.创建dhcpd.conf配置文件,可复制样本文件
#cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
3.修改配置文件/etc/dhcpd.conf
#vi /etc/dhcpd.conf
domain-name-servers:192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.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.100;
}
}
4.修改dhcpd配置文件:/etc/sysconfig/dhcpd
#vi /etc/sysconfig/dhcpd
DHCPDARGS=eth0
5.dhcp服务的启动与停止
#service dhcpd start
6.设置DHCP自动启动的运行级别
#chkconfig --level 35 dhcpd on
--客户端配置
1.修改网络接口配置文件ifcfig-eth0,也可通过netconfig命令修改
#vi /etc/sysconfig/network-scripts/ifcfig-eth0
DEVICE=eth0
NBOOT=yes
BOOTPROTO=dhcp
2.重启网络接口
#ifdown eth0 ; ifup eth0
或者#network restart
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21845741/viewspace-609942/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21845741/viewspace-609942/