实验环境 VM 6.0 RHEL AS 5.0 DVD版
一、安装DHCP
[root@loaclhost ~]# mount /dev/cdrom /mnt/
[root@loaclhost ~]# rpm -ivh /mnt/Server/dhcp-3.0.5-33.e15
[root@loaclhost ~]# umount /dev/cdrom
二、编辑DHCP的配置文件,添加下列内容:
[root@loaclhost ~]#vim /etc/dhcpd.conf
ddns-update-style interim;
ddns-updates on;
deny client-updates;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0{
option routers 192.168.1.1; #定义网关
option subnet-mask 255.255.255.0; #定义掩码
option domain-name "mygroup"; #定义域名
option domain-name-servers 63.233.206.100,202.103.24.68; #DNS
range 192.168.1.10 192.168.1.100; #定义分配的IP地址段
range 192.168.1.110 192.168.1.189;
default-lease-time 21600; #定义租期时间
max-lease-time 43200; #最大租期时间
host pc1 { #定义不分配的IP
hardware ethernet 00:0C:29:B3:72:E5;
fixed-address 192.168.1.2;
}
host pc2 {
hardware ethernet 00:1E:68:23:FB:2F;
fixed-address 192.168.1.102;
}
}
注意:DHCP分配的IP地址段一定要与你本机的IP在同一网段
启动DHCP 服务
[root@loaclhost ~]# service dhcpd restart [ok]
三、客户端将网卡设置
[root@loaclhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
[root@loaclhost ~]# ifconnfig #查看IP
DHCP服务器已经搭建成功!! 感谢群里的兄弟姐妹!!~~~
阅读(1012) | 评论(0) | 转发(0) |