1、局域网技术实验指导局域网技术实验指导实验一路由器基本配置2基本验证实验二路由器口令恢复2综合设计实验三路由协议配置2综合设计实验四综合实验 路由器NAT2基本验证实验五综合实验 访问控制列表2创新实验六交换机基本配置2综合设计实验七综合实验 VLAN间路由2创新实验八综合实验 三层交换实验2创新实验一 路由器基本配置【实验目的】 掌握路由器在网络中的作用、组成以及路由器设备选型; 掌握PacketTrace 仿真软件的使用方法; 练掌握路由器的基本配置命令,包括路由器名称设定、保护口令设定、口令封装、接口描述、查看命令等。【实验环境】 Cisco2621 Router、PacketTrace仿
2、真软件、具备Windows操作系统的PC机【实验重点及难点】重点:掌握PacketTrace路由仿真软件的使用、路由器基本配置难点:路由接口的配置【实验拓扑】【实验内容】一、PacketTrace仿真软件介绍路由、交换仿真软件就是对真实的路由器、交换机等网络设备进行软件模拟,可以在安装仿真软件的普通PC上进行网络设备的配置、管理以及网络规划、网络验证等工作,而不需要真实的网络设备。目前,市场上路由、交换等网络设备模拟软件有很多种,比较优秀的有Boson、RouterSim、CIM等。其中PacketTrace是目前最流行的,最接近真实环境的模拟软件。可以说,PacketTrace软件是真实设备
3、的缩影。二、PacketTrace 使用打开PacketTrace软件,选择“Custom Made Devices”中的2621XM系列路由器。再选择“Connections”连接线中的“Serial DCE” 连接线,按照如图路由器的方式连接好路由器。 然后,按照图示连接好交换机和主机。三、路由器配置1.路由器配置模式及其转换 用户模式(user mode) router用户模式(user mode):该模式下只能查看路由器基本状态和普通命令,不能更改路由器配置。此时路由器名字后跟一个“”符号,表明是在用户模式下。如:router 特权模式(privileged mode) router#
4、特权模式(privileged mode):该模式下可查看各种路由器信息及修改路由器配置。在用户模式下以enable命令登陆,此时“”将变成“#”,表明是在privileged mode .如:router# 全局配置模式(golbal configuration mode): router(config)#全局配置模式(golbal configuration mode):该模式下可进行更高级的配置,并可由此模式进入各种配置子模式。其提示符如:router(config)# 从各模式下返回,只要不断输入exit即可2.按照地址表配置路由器各接口的地址信息 配置路由器ARouteren /进入
5、特权模式Router#config t /进入全局模式Router(config)#hostname LabA /设置主机名Lab_A(config)#enable secret todd /设置加密口令,由用户模式进入特权模式起作用。Lab_A(config)#interface fa0/0 /进入Fastethernet 0/0子接口模式Lab_A(config-if)#ip address 192.168.10.1 255.255.255.0 /配置Fa0/0接口的IP地址Lab_A(config-if)#description Lab_A LAN Connection /配置Fa0/0
6、接口的描述字符Lab_A(config-if)#no shut /激活Fa0/0接口Lab_A(config-if)#interface serial 0/0 /进入serial 0/0子接口模式Lab_A(config-if)#ip address 192.168.20.1 255.255.255.0 /配置serial 0/0接口的IP地址Lab_A(config-if)#description WAN Connection to Lab_B /配置serial 0/0接口的描述字符Lab_A(config-if)#no shut /激活serial 0/0接口Lab_A(config-i
7、f)#exit /退出子接口模式,返回全局模式Lab_A(config)#line console 0 /进入Console子接口模式Lab_A(config-line)#password todd /配置Console登陆密码Lab_A(config-line)#loginLab_A(config-line)#line vty 0 4 /进入Vty子接口模式Lab_A(config-line)#password todd /配置Vty登陆密码,可以有五个TelnetLab_A(config-line)#loginLab_A(config-line)#exit /退出子接口模式,返回全局模式L
8、ab_A(config)#banner motd # /设置Banner信息,以字符“#”结束输入This is the Lab_A router#Lab_A(config)#z /即Ctrl+Z的组合键,可直接返回特权模式Lab_A#copy running-config startup-config /保存上面所做的所有配置Destination filename startup-config? EnterLab_A# /特权模式查看当前路由器配置Lab_A#show running-config 配置路由器BRouterenRouter#config tRouter(config)#ho
9、stname LabBLab_B(config)#enable secret toddLab_B(config)#interface fa0/0Lab_B(config-if)#ip address 192.168.30.1 255.255.255.0Lab_B(config-if)#description Lab_B LAN ConnectionLab_B(config-if)#no shutLab_B(config-if)#interface serial 0/0Lab_B(config-if)#ip address 192.168.20.2 255.255.255.0Lab_B(conf
10、ig-if)#description WAN Connection to Lab_ALab_B(config-if)#clock rate 64000Lab_B(config-if)#no shutLab_B(config-if)#interface serial 0/1Lab_B(config-if)#ip address 192.168.40.1 255.255.255.0Lab_B(config-if)#description WAN Connection to Lab_CLab_B(config-if)#clock rate 64000Lab_B(config-if)#no shutL
11、ab_B(config-if)#exitLab_B(config)#line console 0Lab_B(config-line)#password toddLab_B(config-line)#loginLab_B(config-line)#line vty 0 4Lab_B(config-line)#password toddLab_B(config-line)#loginLab_B(config-line)#exitLab_B(config)#banner motd #This is the Lab_B router#Lab_B(config)#zLab_B#copy running-
12、config startup-configDestination filename startup-config? Enter查看当前路由器配置Lab_B#show running-config 配置路由器C RouterenRouter#config tRouter(config)#hostname LabCLab_C(config)#enable secret toddLab_C(config)#interface fa0/0Lab_C(config-if)#ip address 192.168.50.1 255.255.255.0Lab_C(config-if)#description
13、Lab_C LAN ConnectionLab_C(config-if)#no shutLab_C(config-if)#interface serial 0/0Lab_C(config-if)#ip address 192.168.40.2 255.255.255.0Lab_C(config-if)#description WAN Connection to Lab_BLab_C(config-if)#no shutLab_C(config-if)#exitLab_C(config)#line console 0Lab_C(config-line)#password toddLab_C(co
14、nfig-line)#loginLab_C(config-line)#line vty 0 4Lab_C(config-line)#password toddLab_C(config-line)#loginLab_C(config-line)#exitLab_C(config)#banner motd #This is the Lab_C router#Lab_C(config)# zLab_C#copy running-config startup-configDestination filename startup-config? Enter查看当前路由器配置Lab_C#show runn
15、ing-config四、配置主机的IP地址每台主机的IP地址信息配置:网关:连接为PC机的路由器F0/0接口的IP地址,如PC0的网关为192.168.10.1IP地址:与网关在同一个子网,PC0的IP地址可为192.168.10.2测试: 在主机上ping各自网关,查看结果然后主机间相互测试,查看结果。五、常用路由器状态查询命令(在特权模式下输入命令)show version /查看IOS版本号,已启动时间,flash中的IOS的文件名,router里面共有什么的端口,寄存器的值等等。show flash /查看flash中的内容,IOS的长度,文件名,剩余空间,总空间。show runni
16、ng-config /查看路由器当前的配置信息。show startup-config /查看nvram 中的路由器配置信息。show interface /查看路由器上的各个端口的状态信息。(很多重要信息)show controller s0 /查看s0是DCE口还是DTE口show ip route /查看路由器的路由配置情况五、思考题 配置实验图中每台主机的IP地址信息,包括IP地址取值、子网掩码、网关等;考虑实验中配置的4个密码之间的关系和各自的用途;路由器串行接口连接的DCE端口的作用;图中各设备连接的连接线缆的型号和连接规律。实验二 路由器口令恢复【实验目的】 掌握路由器监控模式下
17、的基本命令; 掌握路由器口令恢复的基本原理; 掌握路由器口令恢复的基本方法和操作步骤。【实验环境】Cisco2621 Router、PacketTrace仿真软件、具备Windows操作系统的PC机【实验重点及难点】重点:路由器口令恢复的基本原理难点:路由器口令恢复的基本原理【实验拓扑】【实验内容】一、路由器设置口令1. 如图,通过PC0 RS-232端口连接路由器Console端口,并在PC0上启用超级终端,从PC0登陆到路由器(注:不是直接点击路由器进入)。2. 在路由器上配置各类口令,口令为随机,开启路由器各以太网端口,保存配置。RouterenRouter#conf tEnter co
18、nfiguration commands, one per line. End with CNTL/Z.Router(config)#enable secret sfjjlkdkjsfRouter(config)#line vty 0 4Router(config-line)#password slfjthhrtRouter(config-line)#line console 0Router(config-line)#password slfhthtrrtRouter(config-line)#int f0/0Router(config-if)#no shutRouter(config-if)
19、#int f0/1Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to upRouter(config-if)#ZRouter#copy run startup-config /产生并保存配置文件Destination filename startup-config? Building configuration.OKRouter#3. 在路由器“physical”界面,点击路由器开关按钮,重新启动路由器。二、口令恢复1. 当路由器启动时,在PC0超级终端界面HyperTerm
20、inal(超级终端)同时按下Ctrl和Break 组合键来执行一个中断。系统出现rommon提示,rommon 1 在此模式下使用?,查看监控模式下可用的哪些命令。也可使用查看Flash:中的内容。rommon 1 dir flash:2. 修改配置寄存器的值不同的路由器修改的方法不同,Cisco 2600系列方法如下:rommon 2 confreg 0x2142 /下次引导时不要配置文件,考虑通常配置寄存器的值是什么,为什么现在是这样的值。3. 使用命令reset重新启动路由器rommon 2 reset4. 由于进行的是不带配置文件的启动,所以系统进入“setup”模式,选择“no”。-
21、 System Configuration Dialog -Continue with configuration dialog? yes/no: no5. 将NVRAM中的配置文件导入到running-config文件中Router#copy startup-config running-config在这一步中,分别是用show run和show star命令查看配置文件,你会发现在Start中的F0/0以及F0/1端口是no shutdown的。而虽然已经将Start 内容不知道run中,并没有改变run中的F0/0以及F0/1的状态。这就是这条命令的局限。6. 修改各类口令Router(
22、config)#enable secret toddRouter(config)#line vty 0 4Router(config-line)#password ciscoRouter(config-line)#line console 0Router(config-line)#password cisco7. 保存修改后的口令Router#copy running-config startup-config8. 重新启动路由器,使用新的密码登陆Router#reload五、思考题 路由器口令恢复的基本原理; 配置寄存器值的修改; copy startup-config running-co
23、nfig的局限。实验三 RIP路由协议配置【实验目的】 掌握RIP协议分类、基本工作原理; 掌握RIP协议配置方法。 OSPF路由协议配置【实验环境】 Cisco2621 Router、PacketTrace仿真软件、具备Windows操作系统的PC机【实验重点及难点】重点:RIP协议配置方法【实验拓扑】【实验内容】一、RIP协议路由选择信息协议)是距离矢量选择协议的一种,它具有如下特点: 选用跳数做为唯一的路由选择度量; 跳数允许的最大值是15,如果路由器收到了一个跳数值为16 的路由更新信息,则其目标网络是不可达的; 缺省情况下,每30s 广播一次路由更新数据;RIP 协议包含有两个版本,
24、RIP 第一版和RIP 第二版.1.RIPv1 的特点包括:1)使用跳数(hop count)作为度量值来决定最佳路径2)允许最大跳数是15 跳3)默认是每30 秒广播路由更新(实际环境中并不是设定的固定为30 秒,而是25秒到30 秒之间的随机时间,防止两个路由器发送同时更新产生冲突)4)最多支持6 条等价链路的负载均衡,默认是4 条5)是基于类的路由协议,不支持VLSM6)不支持验证(authentication)2.RIPv2 比RIPv1 增强的特点包括:1)基于无类概念的路由协议2)支持VLSM3)可以人工设定是否进行路由汇总4)使用多播来代替RIPv1 中的广播5)支持明文或MD5
25、 加密验证6)RIPv2 使用多播地址224.0.0.9 来更新路由信息二、路由信息配置1. 路由器路由信息配置 配置之前路由器A的路由信息Lab_A#sh ip route /特权模式下,查看路由表命令Codes: C - connected, S - static, I - IGRP, R - RIP,M - mobile, B BGP D - EIGRP, EX - EIGRP external, O -OSPF, IA - OSPF inter area N1 - OSPF NSS external type1, N2 - OSPF NSSA external type 2 E1 -
26、OSPF externaltype 1, E2 - OSPF external type 2, E EGP i - IS-IS,L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidatedefault, U - per-user static route, o - ODR, P -periodic downloaded static route, T - trafficengineered routeGateway of last resort is not setC 192.168.10.0/24 is directly connected,
27、FastEthernet0/0C 192.168.20.0/24 is directly connected, Serial 0/0 配置之前路由器B的路由信息Lab_B#sh ip routeoutput cutGateway of last resort is not setC 192.168.20.0/24 is directly connected, Serial0/0C 192.168.40.0/24 is directly connected, Serial0/1C 192.168.30.0 is directly connected FastEthernet 0/0 配置之前路由
28、器C的路由信息Lab_C#sh ip routeoutput cutGateway of last resort is not setC 192.168.50.0/24 is directly connected, FastEthernet0/0C 192.168.40.0/24 is directly connected, Serial0/02. 配置路由器路由 配置路由器A路由Lab_A(config)#router ripLab_A(config-router)#network 192.168.10.0Lab_A(config-router)#network 192.168.20.0La
29、b_A(config-router)#Z/ip route 目的网络 子网掩码 下一跳地址 配置路由器B路由Lab_B(config)#router ripLab_B(config-router)#network 192.168.20.0Lab_B(config-router)#network 192.168.30.0Lab_B(config-router)#network 192.168.40.0Lab_B(config-router)#Z 配置路由器C路由Lab_C(config)#router ripLab_C(config-router)#network 192.168.40.0Lab
30、_C(config-router)#network 192.168.50.0Lab_C(config-router)#Z 配置之后路由器A的路由信息Lab_A#sh ip routeoutput cutR 192.168.50.0 120/2 via 192.168.20.2, 00:00:23, Serial0/0R 192.168.40.0 120/1 via 192.168.20.2, 00:00:23, Serial0/0R 192.168.30.0 120/1 via 192.168.20.2, 00:00:23, Serial0/0C 192.168.20.0 is directly connected, Serial0/0C 192.168.10.0 is directly connected, FastEthernet0/0
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1