用实验快速配置DHCP[原创]

由 nobody_am 在 07-16-2003 06:25 发表:

用实验快速配置DHCP[原创]

前言: DHCP,Dynamic Host Configuration Protocal,它方便了计算机网络管理。本文用

实验的方式快速学会配置DHCP

[实验目的]

1.配置一个DHCP服务器。

2.用客户端检验DHCP服务器。

[实验要求]

1.两台RH9.0的机器。

2.机器1,IP:192.168.0.1

3.机器1是1个DNS服务器,网络名:andsky.com,192.168.0.1的host叫server1,

192.168.0.2的host叫station2.

[实验步骤]

1.机器1上,检查并安装dhcp包。

2.机器1上,到dhcpd的文档复制一分配置例子。

cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample /etc/dhcpd.conf

3.机器1上,编辑/etc/dhcpd.conf内容如下:

ddns-update-style interim;

ignore client-updates;

subnet 192.168.0.0 netmask 255.255.255.0 {

--- default gateway

option routers 192.168.0.1;

option subnet-mask 255.255.255.0;

option nis-domain "domain.org";

option domain-name "andsky.com";

option domain-name-servers 192.168.0.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 192.168.0.1 192.168.0.2;

default-lease-time 21600;

max-lease-time 43200;

we want the nameserver to appear at a fixed address

host station2 {

hardware ethernet 00:E0:4E:E8:9B:BC;

fixed-address 192.168.0.2;

}

}

注意:这里假设机器2的网卡Mac地址为: 00:E0:4E:E8:9B:BC,你可以用ifconfig查看机

器2的Mac地址,作相应修改。

4.机器1上,用ifconfig观察结果,是否子网卡的广播地址设置正确:如:192.168.0.255。

若不正确,请修改网络配置。

5.机器1上,启动dhcpd服务。

service dhcpd restart

注意:若不能启动,观察/var/log/message.

6.机器2上,修改/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=dhcp

onBOOT=yes

7.机器2上,删除/et

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus