1、192.168.1.1/24S-switch-B192.168.0.2/24VLANIF 30192.168.2.1/24S-switch-C192.168.1.2/24VLANIF 40172.16.1.1/24S-switch-D192.168.2.2/24VLANIF 50172.17.1.1/24S-switch-E172.16.1.2/24S-switch-F172.17.1.2/24配置思路采用如下的思路配置OSPF的Stub区域:1.在各S-switch上使能OSPF,配置OSPF基本功能。2.在S-switch-D上配置静态路由,并在OSPF中引入。3.配置Area1为Stub
2、区域(需要在Area1内所有的S-switch上配置Stub命令)。4.在S-switch-A上配置禁止向Stub区域通告Type3 LSA。数据准备为完成此配置例,需准备如下的数据:各接口所属的VLAN ID,具体数据如图1所示。各VLANIF接口的IP地址,具体数据如图1所示。各S-switch设备的Router ID,OSPF进程号以及各接口所属的区域。S-switch-A的Router ID 1.1.1.1,运行的OSPF进程号1,区域0的网段192.168.0.0/24,区域1的网段192.168.1.0/24。S-switch-B的Router ID 2.2.2.2,运行的OSPF
3、进程号1,区域0的网段192.168.0.0/24,区域2的网段192.168.2.0/24。S-switch-C的Router ID 3.3.3.3,运行的OSPF进程号1,区域1的网段192.168.1.0/24,172.16.1.0/24。S-switch-D的Router ID 4.4.4.4,运行的OSPF进程号1,区域2的网段192.168.2.0/24,172.17.1.0/24。S-switch-E的Router ID 5.5.5.5,运行的OSPF进程号1,区域1的网段172.16.1.0/24。S-switch-F的Router ID 6.6.6.6,运行的OSPF进程号1
4、,区域2的网段172.17.1.0/24。配置步骤1.配置OSPF基本功能(请参见举例配置OSPF基本功能)2.配置S-switch-D引入静态路由# 在S-switch-D引入静态路由,例如。S-switch-D ip route-static 200.0.0.0 8 null 0S-switch-D ospfS-switch-D-ospf-1 import-route static type 1S-switch-D-ospf-1 quit# 查看S-switch-C的ABR/ASBR信息。S-switch-C display ospf abr-asbr OSPF Process 1 wit
5、h Router ID 3.3.3.3 Routing Table to ABR and ASBR Type Destination Area Cost Nexthop RtType Intra-area 1.1.1.1 0.0.0.1 1 192.168.1.1 ABR Inter-area 4.4.4.4 0.0.0.1 3 192.168.1.1 ASBR# 查看S-switch-C的OSPF路由表。S-switch-C display ospf routing Routing Tables Routing for Network Destination Cost Type NextHo
6、p AdvRouter Area 172.16.1.0/24 1 Transit 172.16.1.1 3.3.3.3 0.0.0.1 172.17.1.0/24 4 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1 192.168.0.0/24 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1 192.168.1.0/24 1 Transit 192.168.1.2 3.3.3.3 0.0.0.1 192.168.2.0/24 3 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1 Routing for
7、ASEs Destination Cost Type Tag NextHop AdvRouter 200.0.0.0/8 4 Type1 1 192.168.1.1 4.4.4.4 Total Nets: 6 Intra Area: 2 Inter Area: 3 ASE: 1 NSSA: 0当S-switch-C所在区域为普通区域时,可以看到路由表中存在AS外部的路由。3.配置Area1为Stub区域# 配置S-switch-A。S-switch-A ospfS-switch-A-ospf-1 area 1S-switch-A-ospf-1-area-0.0.0.1 stubS-switch
8、-A-ospf-1-area-0.0.0.1 quitS-switch-A-ospf-1 quit# 配置S-switch-C。S-switch-C ospfS-switch-C-ospf-1 area 1S-switch-C-ospf-1-area-0.0.0.1 stubS-switch-C-ospf-1-area-0.0.0.1 quitS-switch-C-ospf-1 quit# 配置S-switch-E。S-switch-E ospfS-switch-E-ospf-1 area 1S-switch-E-ospf-1-area-0.0.0.1 stubS-switch-E-ospf-
9、1-area-0.0.0.1 quitS-switch-E-ospf-1 quit# 查看S-switch-C的路由表。 0.0.0.0/0 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1 192.168.1.0/24 1 Transit 192.168.1.2 3.3.3.3 0.0.0.1 4 ASE: 0 NSSA:当把S-switch-C所在区域配置为Stub区域时,已经看不到AS外部的路由,取而代之的是一条通往区域外部的缺省路由。# 配置禁止向Stub区域通告Type3 LSA。S-switch-A-ospf-1-area-0.0.0.1 stub
10、no-summary4.验证配置结果 3Intra Area: 1 ASE:禁止向Stub区域通告Summary-LSA后,Stub区域设备的路由表项进一步减少。路由表中已经看不到区域外部的路由,取而代之的是一条通往区域外部的缺省路由。配置文件S-switch-A的配置文件# sysname S-switch-Arouter id 1.1.1.1 vlan batch 10 20interface Vlanif10 ip address 192.168.0.1 255.255.255.0interface Vlanif20 ip address 192.168.1.1 255.255.255.
11、0interface GigabitEthernet0/0/1 port trunk allow-pass vlan 10interface GigabitEthernet0/0/2 port trunk allow-pass vlan 20ospf 1 area 0.0.0.0 network 192.168.0.0 0.0.0.255 area 0.0.0.1 network 192.168.1.0 0.0.0.255 stub no-summaryreturn说明:S-switch-B和S-switch-F的配置文件与前例相同,此处省略。S-switch-C的配置文件 sysname S
12、-switch-Crouter id 3.3.3.3 vlan batch 20 40 ip address 192.168.1.2 255.255.255.0interface Vlanif40 ip address 172.16.1.1 255.255.255.0 port trunk allow-pass vlan 40area 0.0.0.1 network 172.16.1.0 0.0.0.255 stubS-switch-D的配置文件 sysname S-switch-D vlan batch 30 50router id 4.4.4.4interface Vlanif30 ip
13、address 192.168.2.2 255.255.255.0interface Vlanif50 ip address 172.17.1.1 255.255.255.0 port trunk allow-pass vlan 30 port trunk allow-pass vlan 50 import-route static type 1 area 0.0.0.2 network 192.168.2.0 0.0.0.255 network 172.17.1.0 0.0.0.255ip route-static 200.0.0.0 255.0.0.0 NULL0S-switch-E的配置文件 sysname S-switch-Erouter id 5.5.5.5 vlan batch 40 ip address 172.16.1.2 255.255.255.0
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1