dhcp 

# less /etc/servie   //各个服务使用的端口

DHCPServer   192.168.30.1

# mkdir /mnt/cdrom
[root@teacher ~]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@teacher ~]# df -h
# vim /etc/yum.repos.d/local.repo
[base]
name=base
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=0

# yum clean all
# yum list

[root@teacher ~]# cd /mnt/cdrom/Server
# cd /mnt/cdrom/Server
[root@teacher Server]# rpm -ivh  dhcp-3.0.5-23.el5.i386.rpm 
[root@teacher Server]# rpm -ql dhcp|less

编辑配置文件
# vim /etc/dhcpd.conf 

ddns-update-style interim;
ignore client-updates;

subnet 192.168.30.0 netmask 255.255.255.0 {
        option routers                  192.168.30.1;
        option subnet-mask              255.255.255.0;
        option time-offset              -18000; # Eastern Standard Time

        range dynamic-bootp 192.168.30.128 192.168.30.254;
        default-lease-time 21600;
        max-lease-time 43200;

        host ns {
                next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;
        }
}

启动服务
# /etc/init.d/dhcpd restart

在客户端
#dhclient -r
#dchclient

# ifconfig |grep eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:39:98:11    //复制 MAC地址


在服务器端
# vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;

subnet 192.168.30.0 netmask 255.255.255.0 {
        option routers                  192.168.30.1;
        option subnet-mask              255.255.255.0;
        option time-offset              -18000; # Eastern Standard Time

        range dynamic-bootp 192.168.30.128   192.168.30.254;
        default-lease-time 21600;
        max-lease-time 43200;

        host ns {
                next-server marvin.redhat.com;
                hardware ethernet 00:0C:29:39:98:11;   //这里写需要绑定的机器的mac地址
                fixed-address 192.168.30.200;          //写要绑定的IP地址
        }
}
服务重启
# /etc/init.d/dhcpd restart

客户端
# dhclient -r
# dhclient