1.组网需求

·     Area 2与Area 0没有直接相连。Area 1被用作传输区域(Transit Area)来连接Area 2和Area 0。Switch B和Switch C之间配置一条虚连接。

·     配置完成后,Switch B能够学到Area 2中的路由。

   

2.配置

  1)各交换机的OSPF基本功能配置  

SW A:
[SwitchA] ospf 1 router-id 1.1.1.1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

SW B:
[SwitchB] ospf 1 router-id 2.2.2.2
[SwitchB-ospf-1] area 0
[SwitchB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] area 1
[SwitchB–ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255

SW C:
[SwitchC] ospf 1 router-id 3.3.3.3
[SwitchC-ospf-1] area 1
[SwitchC-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.1] quit
[SwitchC-ospf-1] area 2
[SwitchC–ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255

SW D:
[SwitchD] ospf 1 router-id 4.4.4.4
[SwitchD-ospf-1] area 2
[SwitchD-ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255

  此时由于Area 0没有与Area 2直接相连,所以Switch B的路由表中没有Area 2的路由。

  2)配置虚连接  

SW B
[SwitchB] ospf
[SwitchB-ospf-1] area 1
[SwitchB-ospf-1-area-0.0.0.1] vlink-peer 3.3.3.3

SW C
[SwitchC] ospf 1
[SwitchC-ospf-1] area 1
[SwitchC-ospf-1-area-0.0.0.1] vlink-peer 2.2.2.2

  此时查看路由表,可以看到Switch B已经学到了Area 2的路由10.3.1.0/24。

 

posted on 2021-12-09 11:32  星痕1216  阅读(257)  评论(0编辑  收藏  举报