1、查看环境
#rpm -qa|grep dhcp
得知系统默认没有安装dhcp服务端
2.安装程序:
插入光盘2
#mount /dev/cdrom
#cd /media/cdrom/RedHat/RPMS
#rpm -ivh dhcp-3.0.1-12_EL.i386.rpm
4、查看DHCP安装位置
#rpm -qpl dhcp-3.0.1-12_EL.i386.rpm
5、配置
#cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
#vi /etc/dhcpd.conf
具体语法可查看:
#man dhcpd.conf
因没有DNS服务器,故涉及DNS地方均注销了,最后配置文件如下:
ddns-update-style none;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
# option nis-domain "domain.org";
# option domain-name "domain.org";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.1.1 192.168.1.254;
default-lease-time 21600;
max-lease-time 43200;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}
配置完毕后可运行下面命令测试语法:
#service dhcpd configtest
6、运行
#service dhcpd start
此时客户端即可获取IP地址。
注意,其IP分配顺序是从大到小,即从254开始分配,然后253、252……
|
文件: |
dhcp.rar |
大小: |
1KB |
下载: |
下载 | |
阅读(1251) | 评论(0) | 转发(0) |