实验目的: 1、理解 OSPF虚链路原理及何时需要使用虚链路。 2、掌握 OSPF虚链路配置方法。 3、掌握 OSPF的外部汇总路由类型及计算方法。 4、掌握 OSPF外部路由汇总配置。 5、掌握 OSPF末节(Stub)区域及完全末节区域特点。 6、掌握 OSPF Stub区域及完全末节区域配置方法。 7、掌握 OSPF中 LSA4和 LSA5的作用。 8、掌握在 OSPF 中配置默认路由的方法。 8、掌握配置区域认证的方法 实验拓扑: 1、配置IP地址 R1配置命令: R1#configure t R1(config)#interface f0/0 R1(config-if)#ip address 192.52.1.2 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#interface loopback0 R1(config-if)#ip address 192.51.4.1 255.255.255.0 R1(config-if)#
R2配置命令: R2#conf t R2(config)#interface f0/1 R2(config-if)#ip address 192.52.1.1 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#interface f0/0 R2(config-if)#ip address 192.52.2.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#interface loopback0 R2(config-if)#ip address 192.52.5.1 255.255.255.0
R3配置命令: R3#configure terminal R3(config)#interface f0/1 R3(config-if)#ip address 192.52.2.1 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#interface f0/0 R3(config-if)#ip address 192.52.3.2 255.255.255.0 R3(config-if)#no shutdown
R4配置命令: R4#configure terminal R4(config)#interface f0/1 R4(config-if)#ip address 192.52.3.1 255.255.255.0 R4(config-if)#no shutdown R4(config-if)#interface loopback0 R4(config-if)#ip address 192.52.8.1 255.255.255.0 R4(config-if)#ip address 192.52.9.1 255.255.255.0 seconda R4(config-if)#ip address 192.52.9.1 255.255.255.0 secondary R4(config-if)#interface loopback1 R4(config-if)#ip address 192.52.6.1 255.255.255.0 R4(config-router)#interface loopback2 R4(config-if)#ip address 172.52.1.1 255.255.255.0 R4(config-if)#ip address 172.52.2.1 255.255.255.0 sec R4(config-if)#ip address 172.52.2.1 255.255.255.0 secondary
2、在个路由器上配置ospf R1配置命令: R1(config-if)#router ospf 52 R1(config-router)#network 192.52.4.0 0.0.0.255 area 1 R1(config-router)#network 192.52.1.0 0.0.0.255 area 1 R2配置命令: R2(config)#router ospf 52 R2(config-router)#network 192.52.1.0 0.0.0.255 area 1 R2(config-router)#network 192.52..0 0.0.0.255 area 1 R2(config-router)#network 192.52.5.0 0.0.0.255 area 0 R2(config-router)#network 192.52.2.0 0.0.0.255 area 0 R2(config-router)# R3配置命令: R3(config-if)#router ospf 52 R3(config-router)#network 192.52.2.0 0.0.0.255 area 0 R3(config-router)#network 192.52.3.0 0.0.0.255 area 2 R4配置命令: R4(config-if)#router ospf 52 R4(config-router)#network 192.52.3.0 0.0.0.255 area 2 R4(config-router)#network 192.52.6.0 0.0.0.255 area 2 R4(config-router)#network 192.52.8.0 0.0.0.255 area 3 R4(config-router)#network 192.52.9.0 0.0.0.255 area 3
问题1:配置后在R1上查看路由表,能否看到192.52.8.0和192.52.9.0的路由条目?为什么? 答:不能看到192.52.8.0和192.52.9.0的路由条目 因为在此拓扑中,area 0为骨干区域,而路由器R4并没有直接连接到骨干区域area 0,而是连到了路由器R3上,所以连接到骨干区域area0 的R1上看不到R4上的192.52.8.0和192.52.9.0的路由条目。
问题2:在R3和R4上分别查看路由ID,它们的路由ID分别是什么? 答:路由器R3的路由ID是192.52.3.2 路由器R4的路由ID是192.52.8.1
问题3:在 R3 中查看 OSPF 数据库,看有几条类型 1(即路由链路状态) 答:在R3中查看ospf数据库,此时有两条类型1.
3、在 R3 和 R4 上配置虚拟链路 R3配置命令: R3(config)#router ospf 52 R3(config-router)#area 2 virtual-link 192.52.8.1 R4配置命令: R4(config)#router ospf 52 R4(config-router)#area 2 virtual-link 192.52.3.2 问题 4:此时在 R1 中查看路由表,和原来有什么变化? 答:配置完虚电路之后,area 2和area 3区域的所有路由都出现在了R1的路由表当中。 4、在 R4 上配置 RIP 路由选择协议 R4配置命令: R4(config-router)#router rip R4(config-router)#version 2 R4(config-router)#network 172.52.0.0 R4(config-router)#no auto-summary 5、 在 R4 上对 OSPF 和 RIP 做路由重分发 R4配置命令: R4(config-router)#router ospf 52 R4(config-router)#redis R4(config-router)#redistribute rip metric 200 subnets R4(config-router)#router rip R4(config-router)#redistribute ospf 52 metric 10 问题 5:在路由器 R1 上查看路由表有什么变化?类型 E2 的路由有几条? 答:此时查看R1路由表,多出两条E2类型的路由条目172.52.1.1和172.52.2.1 问题 6:在 R1 上查看 OSPF 数据库,类型 4 的链路有几条?链路 ID 是多少? 答:在R1上查看ospf数据库,此时类型4ASBR链路状态只有一条,链路ID是192.52.5.1 问题 7:在 R1 上查看 OSPF 数据库,类型 5 的链路有几条?链路 ID 是多少? 答:在 R1 上查看 OSPF 数据库,类型 5 ext的链路有两条,链路ID都是192.52.8.1
6、 为了减少路由条目,在 R4 上进行自制系统外部路由汇总 R4配置命令: R4(config-router)#router ospf 52 R4(config-router)#summary-address 172.52.0.0 255.255.0.0
问题 8:此时在 R1 上查看路由表,类型为 E2 的路由还有几条? 答:进行汇总后R1上E2类型的路由只剩下一条。
7、 为了让网络内的主机能够正常浏览 Internet,需要向内部路由器发布默认路由, R4配置静态默认路由命令为: R4(config)#ip route 0.0.0.0 0.0.0.0 172.52.1.0 R4发布默认路由命令为: R4(config)#router ospf 52 R4(config-router)#de R4(config-router)#default-in R4(config-router)#default-information ori R4(config-router)#default-information originate
问题 9:配置后在路由器 R1 上能否看到默认路由,该默认路由的是由哪个类型的链路状态 产生的? 答:在路由器 R1 上能否看到默认路由,该默认路由的是由类型5链路状态产生。 8、 为了减少区域 1 的路由条目,把区域 1 设为存根网络,即不接受类型 4 和类型 5 的路由。 R1配置命令为: R1(config)#router ospf 52 R1(config-router)#area 1 stub R2配置命令为: R2(config)#router ospf 52 R2(config-router)#area 52 stub R2(config-router)#
问题 10:此时在 R1 上查看路由表,还能否看到 172.16.0.0 这条路由,增加了哪条路由?该 路由是有哪个类型的链路状态产生的? 答:此时已经看不到172.52.0.0这条路由 问题 11:此时在 R1 上 ping 172.52.1.1 能否 ping 通? 答:在 R1 上 ping 172.52.1.1 ,能ping 通
问题 12:此时查看 R1 的 OSPF 数据库,能否看到类型 4 和类型 5 的链路状态? 答:此时R1的ospf数据库上不能看到类型4、5的链路状态,只能看到类型1、2、3的链路状态。 9、 为了进一步简化 R1 的路由,将 area1 设为完全存根区域 R2配置命令为: R2(config)#router ospf 52 R2(config-router)#area 1 stub no-summary //此条命令只用在ABR(这里是R2)上配置即可
问题 13:此时在 R1 上查看路由表,除了直连路由外,还剩下几条路由? 答:此时在 R1 上查看路由表,除了直连路由外,只剩下一条默认路由
问题 14:在 R1 上查看 OSPF 数据库,能看到几种链路类型?是否还有类型 3 的链路?如果 有的话还剩下哪条链路? 答:在 R1 上查看 OSPF 数据库,能看到三种链路状态,类型3的链路状态只剩下一条默认路由了。 10、在区域 1 配置明文认证 R1配置命令命令如下: R1(config-router)#router ospf 52 R1(config-router)#area 1 aut R1(config-router)#area 1 authentication R1(config-router)#interface f0/0 R1(config-if)#ip ospf auth R1(config-if)#ip ospf authentication-key ZHJIAB
问题 15:配置后查看 R1 和 R2 的邻居关系是否还存在,R1 的路由有什么变化? 答: 查看邻居表发现R1和R2的邻居关系已经不存在,R1路由表中默认路由条目也不见了 参考 R1 的命令,在 R2 上做同样的配置。 R2配置命令: R2(config-router)#router ospf 52 R2(config-router)#area 1 authentication R2(config)#interface f0/1 R2(config-if)#ip ospf auth R2(config-if)#ip ospf authentication-k R2(config-if)#ip ospf authentication-key ZHJIAB 问题 16:配置后 R1 的路由有什么变化? 答:此时查看路由表R1默认路由又回到了路由表中 11、在区域 1 配置密文认证,参考命令如下: R1配置命令: R1(config-if)#router ospf 52 R1(config-router)#area 1 au R1(config-router)#area 1 authentication me R1(config-router)#area 1 authentication message-digest R1(config-router)#interface f0/0 R1(config-if)#ip ospf me R1(config-if)#ip ospf message-digest-key 1 md5 ZHJIAB 参考 R1 的配置在 R2 上做同样的配置 R2配置命令: R2(config-if)#router ospf 52 R2(config-router)#area 1 au R2(config-router)#area 1 authentication me R2(config-router)#area 1 authentication message-digest R2(config-router)#interface f0/1 R2(config-if)#ip ospf mes R2(config-if)#ip ospf message-digest-key 1 md5 ZHJIAB
|
路由交换与技术 ospf高级配置(6)
猜你喜欢
转载自blog.csdn.net/qq_42103479/article/details/89461817
今日推荐
周排行