wendang/index.html'>服务器端:Red Hat Enterprise Linux AS4,定制安装,未安装任何网络服务,主机名:DRL IP:192.168.1.44
客户端:Windows XP SP2 主机名:DreamLand
1.安装文件在RHEL4的第四张安装光盘中
rpm -ivh dhcp-3.0.1-12_EL.i386.rpm
2.配置开始
dhcpd的服务器主配置文件是
/etc/dhcpd.conf
默认不存在,但是有模版,嘿嘿,大家就知道怎么做了吧
cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
关于配置文件的详细配置信息,可以
man dhcpd.conf
配置前的好习惯,备份配置文件,虽然这个有模版,但是也要备份,好习惯就是这么养成的。
cp /etc/dhcpd.conf /etc/dhcpd.conf_bak
开始配置,直接贴配置好的文件了
ddns-update-style interim;
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,202.96.209.6;
option time-offset 28800; # 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.128 192.168.1.254;
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;
}
}
[注意]如果主机拥有多个网络接口,需要在配置文件中指定提供服务的网络接口
vi /etc/sysconfig/dhcpd
DHCPDARGS=eth0
3.启动服务
DHCP服务的启动脚文是/etc/init.d/dhcpd
启动DHCP服务
service dhcpd start
至于windows下DHCP客户端的配置我就不说了,自己来吧
4.查看DHCP服务器的租约文件
[root@DRL ~]# tail -9 /var/lib/dhcp/dhcpd.leases
lease 192.168.1.254 {
starts 0 2007/01/28 02:58:40;
ends 0 2007/01/28 08:58:40;
binding state active;
next binding state free;
hardware ethernet 00:0d:9d:8c:6e:a7;
uid "\001\000\015\235\214n\247";
client-hostname "DreamLand";}
阅读(1166) | 评论(0) | 转发(0) |