您的位置:首页 > 运维架构 > Linux

Linux DHCP服务实验报告

2011-10-16 17:56 417 查看
DHCP实验报告[/b][/b]
--杨冬[/b][/b]
1. 实验环境[/b][/b]
服务器:Red Hat Enterprise Linux 5.3(ip:192.168.0.20)
服务器:Red Hat Enterprise Linux 5.3(ip:192.168.0.10、192.168.1.10)
客户端:windows xp

[/b]

01.安装好软件包
[root@yang ~]# rpm -ihv /media/Server/dhcp-3.0.5-18.el5.i386.rpm



3. 实验目标一:配置一台[/b]DHCP[/b]服务器为局域网用户分配[/b]ip[/b]地址。[/b]

[/b]
01.修改配置文件.
[root@yang ~]# cp -rf /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
cp:是否覆盖“/etc/dhcpd.conf”? y
[root@yang ~]# vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option nis-domain "yangdong.com";
option domain-name "yangdong.com";
option domain-name-servers 61.147.37.1;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.0.128 192.168.0.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;
}
}

02.重启服务器.

[root@yang ~]# service dhcpd restart

关闭 dhcpd: [确定]
启动 dhcpd: [确定]
[/b]
03.客户端测试




测试成功

4. 实验目标二:配置实现[/b]DHCP[/b]中继代理服务.[/b]

[/b]
01.实验环境:
主服务器安装: [root@yang ~]# rpm -ihv /media/Server/dhcp-3.0.5-18.el5.i386.rpm
中继服务器安装:[root@yang ~]# rpm -ihv /media/Server/dhcp-3.0.5-18.el5.i386.rpm

02.主服务器配置:

①.[root@yang ~]# vim /etc/dhcpd.conf

ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option nis-domain "yangdong.com";
option domain-name "yangdong.com";
option domain-name-servers 61.147.37.1;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option nis-domain "yangdong.com";
option domain-name "yangdong.com";
option domain-name-servers 61.147.37.1;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.1.128 192.168.1.254;
default-lease-time 21600;
max-lease-time 43200;
}

②.重启服务器.

[root@yang ~]# service dhcpd restart

关闭 dhcpd: [确定]
启动 dhcpd: [确定]

03. 中继服务器配置

①.[root@hello ~]# rpm -ihv /media/Server/dhcp-3.0.5-18.el5.i386.rpm

warning: /media/Server/dhcp-3.0.5-18.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:dhcp ########################################### [100%]
[root@hello ~]# service dhcpd start
启动 dhcpd: [失败]




②.[root@hello ~]# vim /etc/sysctl.con

修改:net.ipv4.ip_forward = 1 //开启路由功能
[root@hello ~]# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456

③.[root@hello ~]# vim /etc/sysconfig/dhcrelay

# Command line options here
INTERFACES="eth0 eth1"
DHCPSERVERS="192.168.0.20"
[root@hello ~]# service dhcrelay start
启动 dhcrelay:
[确定]
④.客户端测试



测试成功

2. 实验前的准备[/b]本文出自 “杨冬的博客” 博客,请务必保留此出处http://yangdong.blog.51cto.com/2959198/689394
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: