实验五 路由协议.docx
- 文档编号:8173030
- 上传时间:2023-01-29
- 格式:DOCX
- 页数:29
- 大小:75.91KB
实验五 路由协议.docx
《实验五 路由协议.docx》由会员分享,可在线阅读,更多相关《实验五 路由协议.docx(29页珍藏版)》请在冰豆网上搜索。
实验五路由协议
实验五路由协议
5.1实验目的
(1)了解路由协议的功能与原理;
(2)掌握静态路由协议配置;
(3)掌握RIP协议的基本配置;
(4)掌握OSPF协议的基本配置。
5.2实验内容
(1)静态路由协议配置;
(2)RIP协议的配置;
(3)OSPF协议的配置。
5.3实验环境与分组
(1)QuidwayS3026C交换机2台,QuidwayR2611路由器2台,PC机4台,配置电缆2条,网线6条,V.35电缆一对;
(2)每4人一组,每2人配置一台路由器。
5.4实验组网图
图5-1路由协议实验组网图
5.5实验步骤
实际组网中路由器是用来连接两个物理网络的,为了模拟实际环境,我们在实验室中采
用背靠背直接相连来模拟广域网连接。
模拟实验环境组网如图4-1。
为了不受路由器原来配
置的影响,在实验之前请先将所有路由器的配置数据擦除后重新启动。
交换机在此只用作连
接主机和路由器用,以便全采用标准网线连接,不需配置。
5.5.1静态路由协议配置
第一步:
清空路由器的原有配置,重新启动路由器后,查看初始配置并显示路由表如下:
[RouterA]displaycurrent-configuration
Nowcreateconfiguration...
Currentconfiguration
!
version1.74
sysnameRouterA
firewallenable
aaa-enable
aaaaccounting-schemeoptional
!
interfaceAux0
asyncmodeflow
link-protocolppp
!
interfaceEthernet0
!
interfaceEthernet1
!
interfaceSerial0
clockDTECLK1
link-protocolppp
!
interfaceAsync0
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync1
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync2
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync3
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync4
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync5
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync6
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync7
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
return
[RouterA]displayiprouting-table
RoutingTables:
Destination/MaskProto
127.0.0.0/8Direct
127.0.0.1/32Direct
Pref
0
0
Metric
0
0
Nexthop
Interface
127.0.0.1LoopBack0
127.0.0.1LoopBack0
第二步:
按图5-1所示配置各路由器接口和各PC的IP地址和缺省网关。
为了标识路由器,我们修改路由器名称分别为RouterA、RouterB并完成IP地址的配置,
其中RouterA的参考配置命令如下:
[RouterA]interfacee0
[RouterA-Ethernet0]ipaddress202.0.0.8255.255.255.0
[RouterA-Ethernet0]interfaces0
[RouterA-Serial0]ipaddress192.0.0.1255.255.255.0
RouterB可以参照RouterA进行设置。
第三步:
查看完成配置命令后的RouterA的配置信息和路由表信息如下:
[RouterA]displaycurrent-configuration
Nowcreateconfiguration...
Currentconfiguration
!
version1.74
sysnameRouterA
firewallenable
aaa-enable
aaaaccounting-schemeoptional
!
interfaceAux0
asyncmodeflow
link-protocolppp
!
interfaceEthernet0
ipaddress202.0.0.8255.255.255.0
!
interfaceEthernet1
!
interfaceSerial0
clockDTECLK1
link-protocolppp
ipaddress192.0.0.1255.255.255.0
!
interfaceAsync0
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync1
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync2
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync3
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync4
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync5
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync6
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync7
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
return
[RouterA]displayiprouting-table
RoutingTables:
Destination/MaskProto
127.0.0.0/8Direct
127.0.0.1/32Direct
192.0.0.0/24Direct
192.0.0.1/32Direct
202.0.0.0/24Direct
202.0.0.8/32Direct
Pref
0
0
0
0
0
0
Metric
0
0
0
0
0
0
Nexthop
Interface
127.0.0.1LoopBack0
127.0.0.1LoopBack0
192.0.0.1Serial0
127.0.0.1LoopBack0
202.0.0.8Ethernet0
127.0.0.1LoopBack0
与第一步骤显示的配置信息和路由信息进行比较,注意它们之间的不同。
RouterB的相关信息类似RouterA,可以自己在实验中显示比较。
注意:
串口的配置需要在接口配置模式下完成shutdown和undoshutdown命令之后才生效。
第四步:
完成上述配置之后,用ping命令测试网络互通性,会出现两个以太网段不能互通。
仔细看看路由表就可以明白,路由器还没有相关的路由。
第五步:
在这里我们采用配置静态路由的办法来添加路由。
分别在RouterA和RouterB上配置到对端以太网段的静态路由,在此只列出RouterA的参考配置命令(RouterB的配置命令可参考RouterA):
[RouterA]iproute-static202.0.1.0255.255.255.0192.0.0.2preference60
第六步:
显示RouterA的配置信息和路由表信息如下:
[RouterA]displaycurrent-configuration
Nowcreateconfiguration...
Currentconfiguration
!
version1.74
sysnameRouterA
firewallenable
aaa-enable
aaaaccounting-schemeoptional
interfaceAux0
!
asyncmodeflow
link-protocolppp
interfaceEthernet0
!
ipaddress202.0.0.8255.255.255.0
interfaceEthernet1
!
!
interfaceSerial0
clockDTECLK1
link-protocolppp
ipaddress192.0.0.1255.255.255.0
!
interfaceAsync0
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync1
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync2
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync3
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync4
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync5
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync6
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync7
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
quit
iproute-static202.0.1.0255.255.255.0192.0.0.2preference60
!
return
[RouterA]displayiprouting-table
RoutingTables:
Destination/MaskProto
127.0.0.0/8Direct
127.0.0.1/32Direct
192.0.0.0/24Direct
192.0.0.1/32Direct
192.0.0.2/32Direct
202.0.0.0/24Direct
202.0.0.8/32Direct
202.0.1.0/24Static
Pref
0
0
0
0
0
0
0
60
Metric
0
0
0
0
0
0
0
0
Nexthop
127.0.0.1LoopBack0
127.0.0.1LoopBack0
192.0.0.2Serial0
127.0.0.1LoopBack0
192.0.0.2Serial0
202.0.0.8Ethernet0
127.0.0.1LoopBack0
192.0.0.2Serial0
Interface
RouterB的相关信息类似RouterA。
比较前后路由表现在新增了一项静态路由。
第七步:
此时再测试网络互通性,可以ping通了吗?
5.5.2RIP协议的配置
第一步:
在上面的实验基础上,删除静态路由的配置之后再启动RIP协议。
参考配置
命令如下:
[RouterA]undoiproute-static202.0.1.024192.0.0.2
[RouterA]rip
waiting...
RIPisrunning
[RouterA-rip]networkall
在RouterB上进行相同的配置,配置命令请参考RouterA。
第二步:
显示RouterA的配置信息如下:
[RouterA]displaycurrent-configuration
Nowcreateconfiguration...
Currentconfiguration
!
version1.74
sysnameRouterA
firewallenable
aaa-enable
aaaaccounting-schemeoptional
!
interfaceAux0
asyncmodeflow
link-protocolppp
!
interfaceEthernet0
ipaddress202.0.0.8255.255.255.0
!
interfaceEthernet1
!
interfaceSerial0
clockDTECLK1
link-protocolppp
ipaddress192.0.0.1255.255.255.0
!
interfaceAsync0
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync1
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync2
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync3
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync4
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync5
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync6
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
interfaceAsync7
physical-modeasync
asyncmodeprotocol
link-protocolppp
!
quit
rip
networkall
!
quit
!
return
第三步:
显示RouterA的路由表信息如下:
[RouterA]displayiprouting-table
RoutingTables:
Destination/MaskProto
127.0.0.0/8Direct
127.0.0.1/32Direct
192.0.0.0/24Direct
192.0.0.1/32Direct
192.0.0.2/32Direct
202.0.0.0/24Direct
202.0.0.8/32Direct
202.0.1.0/24
Pref
0
0
0
0
0
0
0
RIP100
Metric
0
0
0
0
0
0
0
1
Nexthop
Interface
127.0.0.1LoopBack0
127.0.0.1LoopBack0
192.0.0.2Serial0
127.0.0.1LoopBack0
192.0.0.2Serial0
202.0.0.8Ethernet0
127.0.0.1LoopBack0
192.0.0.2Serial0
RouterB的配置信息和路由表与RouterA类似,学生们实验时可以自己查看,并注意和
RouterA之间的区别
第四步:
测试网络互通性,应该是全网互通的。
如果不是,请检查您的配置是否与上面
的一致。
5.5.3OSPF协议的配置
第一步:
清空路由器的原有配置,并重新启动路由器。
第二步:
按照图4-1配置RouterA和RouterB的各端口信息,并配置OSPF参数后启动
OSPF协议。
参考配置命令如下:
[RouterA]routerid1.1.1.1
[RouterA]interfacee0
[RouterA-Ethernet0]ipaddress202.0.0.8255.255.255.0
[RouterA-Ethernet0]interfaces0
[RouterA-Serial0]ipaddress192.0.0.1255.255.255.0
[RouterA-Serial0]ospfenablearea0.0.0.2
[RouterA-Serial0]interfacee0
[RouterA-Ethernet0]ospfenablearea0.0.0.2
[RouterA-Ethernet0]quit
[RouterA]ospfenable
StartOSPFtask...
OSPFenabled
[RouterA]interfaces0
[RouterA-Serial0]shutdown
[RouterA-Serial0]undoshutdown
路由器RouterB的配置命令与RouterA类似,(routerid不同于RouterA,同时,ospfarea同于RouterA)请参照进行配置。
第三步:
显示RouterA的配置信息和路由表信息如下:
[RouterA]displaycurrent-configuration
Nowcreateconfiguration...
Currentconfiguration
!
version1.74
sysnameRouterA
routerid1.1.1.1
firewallenable
aaa-enable
aaaaccounting-schemeoptional
!
interfaceAux0
asyncmodeflow
link-protocolppp
!
interfaceEthernet0
ipaddress202.0.0.8255.255.255.0
ospfenablearea0.0.0.2
!
interfaceEthernet1
!
interfaceSerial0
clockDTECLK1
link-protocolppp
ipaddress192.0.0.1255.255.255.0
ospfenablearea0.0.0.2
interfaceAsync0
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync1
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync2
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync3
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync4
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
interfaceAsync5
!
physical-modeasync
asyncmodeprotocol
link-protocolppp
in
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 实验五 路由协议 实验 路由 协议
![提示](https://static.bdocx.com/images/bang_tan.gif)