您好,欢迎来到微智科技网。
搜索
您的当前位置:首页实验6报告

实验6报告

来源:微智科技网
实验6 路由器基本配置

【实验目的】

1、根据拓扑图进行网络布线。

2、清除启动配置并将路由器重新加载为默认状态。 3、在路由器上执行基本配置任务。 4、配置并激活以太网接口。 5、测试并检验配置。

6、思考网络实施方案并整理成文档。 【实验预备知识】:

简单复习理论课讲解的相关命令的使用方法。 【实验拓扑图】:

【实验要求】

1、预习相关实验方面的知识

2、熟悉相关工具软件的使用方法

【实验场景】:

在本次实验中,您将创建一个与拓扑图类似的网络。首先请根据拓扑图布线。然后执行网络连通所需的初始路由器配置。使用拓扑图中提供的 IP 地址为网络设备分配地址。网络配置完成后检查路由表,验证网络 是否能够正常工作。本实验是网络布线和基本路由器配置的精简版,开始实验之前,您需要熟练掌握基本布线技能和配置文件管理技能。

【实验内容】

任务 1:网络布线。

构建一个类似拓扑图所示的网络。本实验中使用的输出来自 1841 路由器。您可以在实验中使用任何路由器,只要它具备拓扑图中所要求的接口即可。请确保使用正确类型的以太网电缆连接主机与交换机、交换 机与路由器,以及主机与路由器。请确保将串行 DCE 电缆连接到路由器 R1,并将串行 DTE 电缆连接到路由器 R2。 回答以下问题: 应该使用什么类型的电缆将主机 PC 上的以太网接口连接到交换机上的以太网接口? 直通电缆

应该使用什么类型的电缆将交换机上的以太网接口连接到路由器上的

以太网接口? 直通电缆

应该使用什么类型的电缆将路由器上的以太网接口连接到主机 PC 上的以太网接口? 交叉电缆 任务 2:清除配置并重新加载路由器。 步骤 1:建立与路由器 R1 的终端会话。 步骤 2:进入执行模式。

Router>enable Router#

步骤 3:清除配置。 要清除配置,请使用 erase startup-config 命令。当收到提示 [confirm] 要求您确认是否确实想 要清除 NVRAM 中当前存储的配置时,按下 Enter。

Router#erase startup-config

Erasing the nvram filesystem will remove all files! Continue? [confirm] [OK]

Erase of nvram: complete Router#

步骤 4:重新加载配置。

当返回提示符状态时,使用 reload 命令。如果询问您是否保存更改,回答 no。

如果对问题 “System configuration has been modified. Save?” 回答 yes,会出现什么情况?

结果应该类似如下所示:

Router#reload

System configuration has been modified. Save? [yes/no]: no Proceed with reload? [confirm]

当出现提示 [confirm] 要求您确认确实想要重新加载路由器时,按下 Enter。路由器完成启动过程后, 选择不使用 AutoInstall 功能,如下所示:

Would you like to enter the initial configuration dialog? [yes/no]: no

Would you like to terminate autoinstall? [yes]: [Press Return] Press Enter to accept default. Press RETURN to get started!

步骤 5:在路由器 R2 上重复步骤 1 到 4,清除任何可能存在的启动配置文件。任务 3:对路由器 R1 进行基本配置。 步骤 1:建立与路由器 R1 的 HyperTerminal 会话。 步骤 2:进入执行模式。

Router>enable Router#

步骤 3:进入全局配置模式。

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Router(config)#

步骤 4:将路由器名称配置为 R1。 在提示符下输入命令 hostname R1。

Router(config)#hostname R1 R1(config)#

步骤 5:禁用 DNS 查找。

使用 no ip domain-lookup 命令禁用 DNS 查找。

R1(config)#no ip domain-lookup R1(config)#

在实验环境中禁用 DNS 查找的原因是什么?

cisco的设备默认ip do lo 是开着的,这样在#下如果敲错了命令,设备会认为你输入的是一个hostname于是就要去lookup,这样浪费很多时间,所以默认就把ip do lo 关掉。

如果在生产环境中禁用 DNS 查找会发生什么情况?

步骤 6:配置执行模式口令。

使用 enable secret password 命令配置执行模式口令。使用 class 替换 password。

R1(config)#enable secret class R1(config)#

为什么不一定要使用 enable password password 命令?

答:首先,enable secret命令可提供更强的安全性,因为使用此命令设置的口令会被加密。而enable password命令仅在尚未使用enable secret命令设置口令时才能使用。

步骤 7:配置当天消息标语。

使用 banner motd 命令配置当天消息标语。

R1(config)#banner motd #

Enter TEXT message. End with the character '&'. ********************************

!!!AUTHORIZED

ACCESS ONLY!!!

******************************** #

R1(config)#

何时会显示该标语?

保存当前配置后。再用show running-config命令可以显示

为什么每个路由器都需要设置当天消息标语?

答:要求用户输入口令是防止未经授权的人员进入网络的有效方法,同时必须向视图访问设备的人员声明授权人员才可以访问设备。

步骤 8:在路由器上配置控制台口令。

使用 cisco 作为口令。配置完成后,退出线路配置模式。

R1(config)#line console 0 R1(config-line)#password cisco R1(config-line)#login R1(config-line)#exit R1(config)#

步骤 9:为虚拟终端线路配置口令。

使用 cisco 作为口令。配置完成后,退出线路配置模式。

R1(config)#line vty 0 4

R1(config-line)#password cisco R1(config-line)#login R1(config-line)#exit R1(config)#

步骤 10:配置 FastEthernet0/0 接口。

使用 IP 地址 192.168.1.1/24 配置 FastEthernet0/0 接口。

R1(config)#interface fastethernet 0/0

R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed

state to up R1(config-if)#

步骤 11:配置 Serial0/0/0 接口。

使用 IP 地址 192.168.2.1/24 配置 Serial0/0/0 接口。将时钟频率设置为 000。 注意:clock rate 命令的用途在第 2 章:“静态路由”中介绍。

R1(config-if)#interface serial 0/0/0

R1(config-if)#ip address 192.168.2.1 255.255.255.0 R1(config-if)#clock rate 000 R1(config-if)#no shutdown R1(config-if)#

注意:配置并激活 R2 上的串行接口后,此接口才会激活 步骤 12:返回执行模式。 使用 end 命令返回执行模式。

R1(config-if)#end R1#

步骤 13:保存 R1 配置。

使用 copy running-config startup-config 命令保存 R1 配置。

R1#copy running-config startup-config Building configuration... [OK]

R1#

该命令的简化版本是什么? Co run sta

任务 4:对路由器 R2 进行基本配置。

步骤 1:对 R2 重复任务 3 中的步骤 1 到步骤 9。 步骤 2:配置 Serial 0/0/0 接口。

使用 IP 地址 192.168.2.2/24 配置 Serial 0/0/0 接口。

R2(config)#interface serial 0/0/0

R2(config-if)#ip address 192.168.2.2 255.255.255.0 R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up R2(config-if)#

步骤 3:配置 FastEthernet0/0 接口。

使用 IP 地址 192.168.3.1/24 配置 FastEthernet0/0 接口。

R2(config-if)#interface fastethernet 0/0

R2(config-if)#ip address 192.168.3.1 255.255.255.0 R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)#

步骤 4:返回执行模式。 使用 end 命令返回执行模式。

R2(config-if)#end R2#

步骤 5:保存 R2 配置。

使用 copy running-config startup-config 命令保存 R2 配置。

R2#copy running-config startup-config Building configuration... [OK] R2#

任务 5:配置主机 PC 上的 IP 地址。 步骤 1:配置主机 PC1。

使用 IP 地址 192.168.1.10/24 和默认网关 192.168.1.1 配置连接到 R1 的主机 PC1。 步骤 2:配置主机 PC2。

使用 IP 地址 192.168.3.10/24 和默认网关 192.168.3.1 配置连接到 R2 的主机 PC2。

任务 6:检验并测试配置。

步骤 1:使用 show ip route 命令检验路由表中是否包含以下路由。

我们将在后续章节中深入探讨 show ip route 命令及其输出。目前,您会惊奇地发现 R1 和 R2 中都包 含两条路由。每条路由前都带有 C 标识。这表示它们是直接相连网络,一旦在每台路由器上配置了相关接 口便会激活。如果您在每台路由器的输出中没有发现如下所示的两条路由,那么请继续执行步骤 2。

R1#show Ip route

Codes: C - connected, S - static, R - RIP, M - mobile,

B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C C R1#

192.168.1.0/24 is directly connected, FastEthernet0/0 192.168.2.0/24 is directly connected, Serial0/0/0

R2#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C C R2#

192.168.2.0/24 is directly connected, Serial0/0/0 192.168.3.0/24 is directly connected, FastEthernet0/0

步骤 2:检验接口配置。

另一个常见的问题是没有正确配置或激活路由器接口。使用 show ip interface brief 命令快速检 验每台路由器接口的配置。屏幕上会显示与以下类似的输出:

R1#show ip interface brief

Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.1 YES manual up up FastEthernet0/1 unassigned YES unset administratively down down Serial0/0/0 192.168.2.1 YES manual up up Serial0/0/1 unassigned YES unset administratively down down Vlan1 unassigned YES manual administratively down down R2#show ip interface brief

Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.3.1 YES manual up up

FastEthernet0/1 unassigned YES unset administratively down down Serial0/0/0 192.168.2.2 YES manual up up Serial0/0/1 unassigned YES unset down down Vlan1 unassigned YES manual administratively down down

如果两个接口的状态都是 up 和 up,则路由表中将包含两条路由。使用 show ip route 命令再次进行检验。 步骤 3:测试连通性。

从每台主机 ping 其默认网关,以此来测试连通性。

从连接到 R1 的主机是否能 ping 通其默认网关? 能

从连接到 R2 的主机是否能 ping 通其默认网关? 能 如果上述任一问题的答案为否,则按照以下流程检查配置,找出问题所在:

1. 检查 PC。 它们是否实际连接到了正确的路由器?(应该是直连相连或

通过交换机连接在一起。)是

是否所有相关端口的链路指示灯都在闪烁?

2. 检查 PC 的配置。 其配置是否与拓扑图一致?

3. 使用 show ip interface brief 命令检查路由器接口。 是否所有接口都为 up 和 up? 是 如果上述所有三个环节的答案都为是,那么您应该能成功 ping 通默认网关。

步骤 4:测试路由器 R1 和 R2 之间的连通性。

在路由器 R1 上,是否能够使用 ping 192.168.2.2 命令 ping 通 R2? 在路由器 R2 上,是否能够使用 ping 192.168.2.1 命令 ping 通 R1? 如果上述问题的答案为否,则按照以下流程检查配置,找出问题所在: 1. 检查布线。

路由器是否连接妥当? 是 闪烁? 是 一致? 是

您是否在链路的 DCE 端配置了 clock rate? 是

是否所有相关端口的链路指示灯都在

2. 检查路由器配置。 其配置是否与拓扑图

3. 使用 show ip interface brief 命令检查路由器接口。 是否所有接口都为 \"up\" 和 \"up\"? 是 如果上述所有三个环节的答案都为是,那么您应该能成功从 R2 ping 通 R1,从 R2 ping 通 R3。

任务 7:思考

步骤 1:尝试从连接到 R1 的主机 ping 连接到 R2 的主机。 这次 ping 应该会失败。

步骤 2:尝试从连接到 R1 的主机 ping 路由器 R2。 这次 ping 应该会失败。 步骤 3:尝试从连接到 R2 的主机 ping 路由器 R1。 这次 ping 应该会失败。

这些设备之间无法通信是因为网络中缺少什么? 路由协议。

任务 8:整理文档

在每台路由器上,截取以下命令的输出并保存到文本文件 (.txt),以供将来参考。

• show running-config • show ip route

• show ip interface brief

实验总结:

本实验再次加深了对路由器的一些基本口令的配置,如进入不同接口模式的的配置,标语的配置,控制台口令以及ip地址的配置等。在进行拓扑图的连接的时候,刚开始用了DTE来连接两个路由器,导致了两个路由器之间不能ping通,经过检查,把DTE改为DCE后,两个路由器便能ping通了,再给它们配置了静态路由,整个链路的实物便都能ping通了。

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 7swz.com 版权所有 赣ICP备2024042798号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务