OSPF综合实验
1.实验拓扑:
文章图片
文章图片
文章图片
文章图片
2.实验需求:
a)按照图示配置好IP地址,PC9网关指向为R8
b)OSPF划分为4个区域,其中10.0.0.0/24,10.0.1.0/24,10.0.2.0/24属于area0,10.0.3.0/24属于area1,10.0.4.0/24,100.0.0.0/24属于area2,10.0.5.0,100.1.1.0/24属于area3
c)为了防止链路中断引起的骨干区域隔离,在R3和R4上配置虚链接
d)在R5上配置到达172.16.0.0/24和172.16.1.0/24网段的静态路由,并引入到OSPF内部
e)在R7和R8上配置默认路由,下一跳指向R5和R6
f)在ASBR上对172.16.0.0/24和172.16.1.0/24网段进行路由聚合
g)在R3和R4上分别对area0的网段进行路由聚合
h)把area1配置为totally stub区域
i)把area3配置为NSSA区域
j)在R6上配置到达192.168.0.0/24网段的静态路由,并以7类LSA引入到OSPF内部
3.解法
a)略 |
b)略 |
c)在R3和R4的area 1视图下:vlink-peer 对端RID地址 [R4-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3 [R4]dis ospf vlink OSPF Process 1 with Router ID 4.4.4.4 Virtual Links Virtual-link Neighbor-ID-> 3.3.3.3, Neighbor-State: Full Interface: 10.0.3.43 (GigabitEthernet0/0) Cost: 1State: P-2-PType: Virtual Transit Area: 0.0.0.1 Timers: Hello 10, Dead 40, Retransmit 5, Transmit Delay 1 MTIDCostDisabledTopology name 01Nobase [R4]dis ospf peer OSPF Process 1 with Router ID 4.4.4.4 Neighbor Brief Information Area: 0.0.0.0 Router IDAddressPri Dead-TimeStateInterface 2.2.2.210.0.2.24130Full/ -Ser1/0 Area: 0.0.0.1 Router IDAddressPri Dead-TimeStateInterface 3.3.3.310.0.3.34139Full/DRGE0/0 Area: 0.0.0.3 Router IDAddressPri Dead-TimeStateInterface 6.6.6.610.0.5.64132Full/BDRGE0/1 Virtual link: Router IDAddressPri Dead-TimeStateInterface 3.3.3.310.0.3.34139FullGE0/0 [R4] |
d)R5上配置静态路由 【OSPF综合实验--多区域、Stub、NSSA、路由聚合与路由引入】[R5]ip route-static 172.16.0.1 24 100.0.0.75 [R5]ip route-static 172.16.1.1 24 100.0.0.75 此时从R3上查看路由:dis ip r 172.16.0.0/24O_ASE2150 110.0.4.53GE0/1 172.16.1.0/24O_ASE2150 110.0.4.53GE0/1 224.0.0.0/4Direct000.0.0.0NULL0 224.0.0.0/24Direct000.0.0.0NULL0 255.255.255.255/32 Direct00127.0.0.1InLoop0 |
e) R7配置到R5的默认路由,R8配置到R6的默认路由 [R7]ip route-static 0.0.0.0 0 100.0.1.57 [R8]ip route-static 0.0.0.0 0 100.0.1.68 |
f)在ASBR对引入的静态路由做聚合 [R5-ospf-1]asbr-summary 172.16.0.0 23 然后我们在R3上查看: 172.16.0.0/23O_ASE2150 110.0.4.53GE0/1 224.0.0.0/4Direct000.0.0.0NULL0 224.0.0.0/24Direct000.0.0.0NULL0 255.255.255.255/32 Direct00127.0.0.1InLoop0 |
g) 在R3和R4上分别对area0的网段进行路由聚合----ABR聚合,区域视图下 先在R3上聚合:[R3-ospf-1-area-0.0.0.0]abr-summary 10.0.0.0 23 可以观察到R5上已经显示的是聚合路由,但是R7 R8上不是; 此时我们在R5上对AREA0的路由做聚合:[R4-ospf-1-area-0.0.0.0]abr-summary 10.0.0.0 23 我们再观察R7 R8上,显示的是聚合后的路由 |
h)在area1上配置stub区域: [R3-ospf-1-area-0.0.0.1]stub OSPF Area is used as a transit area by a virtual link. Remove the virtual link first 故此题有问题; 猜测是在Area 2做stub区域:stub命令在区域视图下配置,只允许1,2,3类LSA经过 [R3-ospf-1-area-0.0.0.2]%Feb6 16:29:39:350 2018 R3 OSPF/5/OSPF_NBR_CHG: OSPF 1 Neighbor 10.0.4.53(GigabitEthernet0/1) changed from FULL to DOWN. [R5-ospf-1-area-0.0.0.2]stub [R5-ospf-1-area-0.0.0.2]%Feb6 16:33:24:275 2018 R5 OSPF/5/OSPF_NBR_CHG: OSPF 1 Neighbor 10.0.4.35(GigabitEthernet0/1) changed from FULL to DOWN. %Feb6 16:33:24:276 2018 R5 OSPF/5/OSPF_NBR_CHG: OSPF 1 Neighbor 100.0.0.75(GigabitEthernet0/2) changed from FULL to DOWN. 约2倍hello时间后,R3和R5重新变成full状态 [R3-ospf-1-area-0.0.0.2]%Feb6 16:30:30:935 2018 R3 OSPF/5/OSPF_NBR_CHG: OSPF 1 Neighbor 10.0.4.53(GigabitEthernet0/1) changed from LOADING to FULL. [R5]%Feb6 16:34:04:289 2018 R5 OSPF/5/OSPF_NBR_CHG: OSPF 1 Neighbor 10.0.4.35(GigabitEthernet0/1) changed from LOADING to FULL. 实际效果: 配成stbu之前,R3的LSDB: Area: 0.0.0.2 TypeLinkState IDAdvRouterAgeLenSequenceMetric Router7.7.7.77.7.7.746488000000C0 Router5.5.5.55.5.5.55608000000F0 Router3.3.3.33.3.3.34368000000A0 Network100.0.0.757.7.7.73332800000020 Network10.0.4.535.5.5.5132800000020 Sum-Net100.0.1.03.3.3.31338 28800000053127 Sum-Net8.8.8.83.3.3.31338 28800000053127 Sum-Net6.6.6.63.3.3.31338 28800000073126 Sum-Net3.3.3.33.3.3.371528800000060 Sum-Net10.0.3.03.3.3.371528800000061 Sum-Net10.0.2.03.3.3.31336 28800000073125 Sum-Net4.4.4.43.3.3.31336 28800000073125 Sum-Net2.2.2.23.3.3.371728800000061563 Sum-Net10.0.0.03.3.3.3428800000071563 Sum-Net10.0.5.03.3.3.31336 28800000073126 Sum-Net1.1.1.13.3.3.371728800000061562 AS External Database TypeLinkState IDAdvRouterAgeLenSequenceMetric External172.16.0.05.5.5.579336800000051 [R3-ospf-1-area-0.0.0.2] dis ip r: 配置stub后: [R3-ospf-1]dis ip r Destinations : 34Routes : 34 Destination/MaskProtoPre CostNextHopInterface 0.0.0.0/32Direct00127.0.0.1InLoop0 1.1.1.1/32O_INTRA 10156210.0.1.13Ser1/0 2.2.2.2/32O_INTRA 10156310.0.1.13Ser1/0 3.3.3.3/32Direct00127.0.0.1InLoop0 4.4.4.4/32O_INTRA 10312510.0.1.13Ser1/0 5.5.5.5/32O_INTRA 10110.0.4.53GE0/1 6.6.6.6/32O_INTER 10312610.0.1.13Ser1/0 8.8.8.8/32O_INTER 10312710.0.1.13Ser1/0 10.0.0.0/23O_SUM255 00.0.0.0NULL0 10.0.0.0/24O_INTRA 10156310.0.1.13Ser1/0 10.0.1.0/24Direct0010.0.1.31Ser1/0 10.0.1.0/32Direct0010.0.1.31Ser1/0 10.0.1.13/32Direct0010.0.1.13Ser1/0 10.0.1.31/32Direct00127.0.0.1InLoop0 10.0.1.255/32Direct0010.0.1.31Ser1/0 10.0.2.0/24O_INTRA 10312510.0.1.13Ser1/0 10.0.3.0/24Direct0010.0.3.34GE0/0 10.0.3.0/32Direct0010.0.3.34GE0/0 10.0.3.34/32Direct00127.0.0.1InLoop0 10.0.3.255/32Direct0010.0.3.34GE0/0 10.0.4.0/24Direct0010.0.4.35GE0/1 10.0.4.0/32Direct0010.0.4.35GE0/1 10.0.4.35/32Direct00127.0.0.1InLoop0 10.0.4.255/32Direct0010.0.4.35GE0/1 10.0.5.0/24O_INTER 10312610.0.1.13Ser1/0 100.0.0.0/24O_INTRA 10210.0.4.53GE0/1 100.0.1.0/24O_INTER 10312710.0.1.13Ser1/0 127.0.0.0/8Direct00127.0.0.1InLoop0 127.0.0.0/32Direct00127.0.0.1InLoop0 127.0.0.1/32Direct00127.0.0.1InLoop0 127.255.255.255/32 Direct00127.0.0.1InLoop0 224.0.0.0/4Direct000.0.0.0NULL0 224.0.0.0/24Direct000.0.0.0NULL0 255.255.255.255/32 Direct00127.0.0.1InLoop0 但是为什么R3访问不了R7上的172.16.0.1 172.16.1.1?因为做了STUB后没有路由了。。。。为什么没路由? 因为stub区域过滤了4、5类LSA,所以stub特殊区域不允许ASBR存在,换言之区域类的外部路由出不去; |
j)R6配置静态路由:ip route-static 192.168.0.0. 24 100.0.1.86 并引入OSPF:import-route static 查看lsdb如下: Area: 0.0.0.3 TypeLinkState IDAdvRouterAgeLenSequenceMetric Router8.8.8.88.8.8.881148800000040 Router6.6.6.66.6.6.69460800000060 Router4.4.4.44.4.4.481936800000050 Network10.0.5.646.6.6.681532800000020 Network100.0.1.868.8.8.880932800000020 Sum-Net100.0.0.04.4.4.486928800000013127 Sum-Net5.5.5.54.4.4.486928800000013126 Sum-Net3.3.3.34.4.4.486928800000013125 Sum-Net10.0.3.04.4.4.486928800000011 Sum-Net10.0.2.04.4.4.486928800000011562 Sum-Net4.4.4.44.4.4.486928800000010 Sum-Net2.2.2.24.4.4.486928800000011562 Sum-Net10.0.0.04.4.4.486928800000013125 Sum-Net1.1.1.14.4.4.486928800000011563 Sum-Net10.0.4.04.4.4.486928800000013126 Sum-Net7.7.7.74.4.4.486928800000013127 NSSA192.168.0.06.6.6.69436800000011 AS External Database TypeLinkState IDAdvRouterAgeLenSequenceMetric External192.168.0.04.4.4.49336800000011 [R4] R3也学习到了该外部路由: AS External Database TypeLinkState IDAdvRouterAgeLenSequenceMetric External192.168.0.04.4.4.449836800000011 |