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: 1 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10, Dead 40, Retransmit 5, Transmit Delay 1
MTID Cost Disabled Topology name 0 1 No base [R4]dis ospf peer
OSPF Process 1 with Router ID 4.4.4.4 Neighbor Brief Information
Area: 0.0.0.0 Router ID Address Pri Dead-Time State Interface 2.2.2.2 10.0.2.24 1 30 Full/ - Ser1/0
Area: 0.0.0.1 Router ID Address Pri Dead-Time State Interface 3.3.3.3 10.0.3.34 1 39 Full/DR GE0/0
Area: 0.0.0.3 Router ID Address Pri Dead-Time State Interface 6.6.6.6 10.0.5.64 1 32 Full/BDR GE0/1
Virtual link: Router ID Address Pri Dead-Time State Interface 3.3.3.3 10.0.3.34 1 39 Full GE0/0 [R4] |
d)R5上配置静态路由 [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/24 O_ASE2 150 1 10.0.4.53 GE0/1 172.16.1.0/24 O_ASE2 150 1 10.0.4.53 GE0/1 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 |
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/23 O_ASE2 150 1 10.0.4.53 GE0/1 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 |
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]%Feb 6 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]%Feb 6 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. %Feb 6 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]%Feb 6 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]%Feb 6 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 Type LinkState ID AdvRouter Age Len Sequence Metric Router 7.7.7.7 7.7.7.7 46 48 8000000C 0 Router 5.5.5.5 5.5.5.5 5 60 8000000F 0 Router 3.3.3.3 3.3.3.3 4 36 8000000A 0 Network 100.0.0.75 7.7.7.7 33 32 80000002 0 Network 10.0.4.53 5.5.5.5 1 32 80000002 0 Sum-Net 100.0.1.0 3.3.3.3 1338 28 80000005 3127 Sum-Net 8.8.8.8 3.3.3.3 1338 28 80000005 3127 Sum-Net 6.6.6.6 3.3.3.3 1338 28 80000007 3126 Sum-Net 3.3.3.3 3.3.3.3 715 28 80000006 0 Sum-Net 10.0.3.0 3.3.3.3 715 28 80000006 1 Sum-Net 10.0.2.0 3.3.3.3 1336 28 80000007 3125 Sum-Net 4.4.4.4 3.3.3.3 1336 28 80000007 3125 Sum-Net 2.2.2.2 3.3.3.3 717 28 80000006 1563 Sum-Net 10.0.0.0 3.3.3.3 4 28 80000007 1563 Sum-Net 10.0.5.0 3.3.3.3 1336 28 80000007 3126 Sum-Net 1.1.1.1 3.3.3.3 717 28 80000006 1562
AS External Database Type LinkState ID AdvRouter Age Len Sequence Metric External 172.16.0.0 5.5.5.5 793 36 80000005 1 [R3-ospf-1-area-0.0.0.2]
dis ip r: 配置stub后: [R3-ospf-1]dis ip r
Destinations : 34 Routes : 34
Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 1.1.1.1/32 O_INTRA 10 1562 10.0.1.13 Ser1/0 2.2.2.2/32 O_INTRA 10 1563 10.0.1.13 Ser1/0 3.3.3.3/32 Direct 0 0 127.0.0.1 InLoop0 4.4.4.4/32 O_INTRA 10 3125 10.0.1.13 Ser1/0 5.5.5.5/32 O_INTRA 10 1 10.0.4.53 GE0/1 6.6.6.6/32 O_INTER 10 3126 10.0.1.13 Ser1/0 8.8.8.8/32 O_INTER 10 3127 10.0.1.13 Ser1/0 10.0.0.0/23 O_SUM 255 0 0.0.0.0 NULL0 10.0.0.0/24 O_INTRA 10 1563 10.0.1.13 Ser1/0 10.0.1.0/24 Direct 0 0 10.0.1.31 Ser1/0 10.0.1.0/32 Direct 0 0 10.0.1.31 Ser1/0 10.0.1.13/32 Direct 0 0 10.0.1.13 Ser1/0 10.0.1.31/32 Direct 0 0 127.0.0.1 InLoop0 10.0.1.255/32 Direct 0 0 10.0.1.31 Ser1/0 10.0.2.0/24 O_INTRA 10 3125 10.0.1.13 Ser1/0 10.0.3.0/24 Direct 0 0 10.0.3.34 GE0/0 10.0.3.0/32 Direct 0 0 10.0.3.34 GE0/0 10.0.3.34/32 Direct 0 0 127.0.0.1 InLoop0 10.0.3.255/32 Direct 0 0 10.0.3.34 GE0/0 10.0.4.0/24 Direct 0 0 10.0.4.35 GE0/1 10.0.4.0/32 Direct 0 0 10.0.4.35 GE0/1 10.0.4.35/32 Direct 0 0 127.0.0.1 InLoop0 10.0.4.255/32 Direct 0 0 10.0.4.35 GE0/1 10.0.5.0/24 O_INTER 10 3126 10.0.1.13 Ser1/0 100.0.0.0/24 O_INTRA 10 2 10.0.4.53 GE0/1 100.0.1.0/24 O_INTER 10 3127 10.0.1.13 Ser1/0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
但是为什么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 Type LinkState ID AdvRouter Age Len Sequence Metric Router 8.8.8.8 8.8.8.8 811 48 80000004 0 Router 6.6.6.6 6.6.6.6 94 60 80000006 0 Router 4.4.4.4 4.4.4.4 819 36 80000005 0 Network 10.0.5.64 6.6.6.6 815 32 80000002 0 Network 100.0.1.86 8.8.8.8 809 32 80000002 0 Sum-Net 100.0.0.0 4.4.4.4 869 28 80000001 3127 Sum-Net 5.5.5.5 4.4.4.4 869 28 80000001 3126 Sum-Net 3.3.3.3 4.4.4.4 869 28 80000001 3125 Sum-Net 10.0.3.0 4.4.4.4 869 28 80000001 1 Sum-Net 10.0.2.0 4.4.4.4 869 28 80000001 1562 Sum-Net 4.4.4.4 4.4.4.4 869 28 80000001 0 Sum-Net 2.2.2.2 4.4.4.4 869 28 80000001 1562 Sum-Net 10.0.0.0 4.4.4.4 869 28 80000001 3125 Sum-Net 1.1.1.1 4.4.4.4 869 28 80000001 1563 Sum-Net 10.0.4.0 4.4.4.4 869 28 80000001 3126 Sum-Net 7.7.7.7 4.4.4.4 869 28 80000001 3127 NSSA 192.168.0.0 6.6.6.6 94 36 80000001 1
AS External Database Type LinkState ID AdvRouter Age Len Sequence Metric External 192.168.0.0 4.4.4.4 93 36 80000001 1 [R4]
R3也学习到了该外部路由: AS External Database Type LinkState ID AdvRouter Age Len Sequence Metric External 192.168.0.0 4.4.4.4 498 36 80000001 1 |