华为路由器配置OSPF的Stub区域实例Word格式文档下载.docx
《华为路由器配置OSPF的Stub区域实例Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《华为路由器配置OSPF的Stub区域实例Word格式文档下载.docx(9页珍藏版)》请在冰豆网上搜索。
![华为路由器配置OSPF的Stub区域实例Word格式文档下载.docx](https://file1.bdocx.com/fileroot1/2022-12/1/6c0ef023-aeb7-4c18-a173-6b20563cf613/6c0ef023-aeb7-4c18-a173-6b20563cf6131.gif)
192.168.1.1/24
S-switch-B
192.168.0.2/24
VLANIF30
192.168.2.1/24
S-switch-C
192.168.1.2/24
VLANIF40
172.16.1.1/24
S-switch-D
192.168.2.2/24
VLANIF50
172.17.1.1/24
S-switch-E
172.16.1.2/24
S-switch-F
172.17.1.2/24
配置思路
采用如下的思路配置OSPF的Stub区域:
1.在各S-switch上使能OSPF,配置OSPF基本功能。
2.在S-switch-D上配置静态路由,并在OSPF中引入。
3.配置Area1为Stub区域(需要在Area1内所有的S-switch上配置Stub命令)。
4.在S-switch-A上配置禁止向Stub区域通告Type3LSA。
数据准备
为完成此配置例,需准备如下的数据:
∙各接口所属的VLANID,具体数据如图1所示。
∙各VLANIF接口的IP地址,具体数据如图1所示。
∙各S-switch设备的RouterID,OSPF进程号以及各接口所属的区域。
▪S-switch-A的RouterID1.1.1.1,运行的OSPF进程号1,区域0的网段192.168.0.0/24,区域1的网段192.168.1.0/24。
▪S-switch-B的RouterID2.2.2.2,运行的OSPF进程号1,区域0的网段192.168.0.0/24,区域2的网段192.168.2.0/24。
▪S-switch-C的RouterID3.3.3.3,运行的OSPF进程号1,区域1的网段192.168.1.0/24,172.16.1.0/24。
▪S-switch-D的RouterID4.4.4.4,运行的OSPF进程号1,区域2的网段192.168.2.0/24,172.17.1.0/24。
▪S-switch-E的RouterID5.5.5.5,运行的OSPF进程号1,区域1的网段172.16.1.0/24。
▪S-switch-F的RouterID6.6.6.6,运行的OSPF进程号1,区域2的网段172.17.1.0/24。
配置步骤
1.配置OSPF基本功能(请参见举例配置OSPF基本功能)
2.配置S-switch-D引入静态路由
#在S-switch-D引入静态路由,例如。
[S-switch-D]iproute-static200.0.0.08null0
[S-switch-D]ospf
[S-switch-D-ospf-1]import-routestatictype1
[S-switch-D-ospf-1]quit
#查看S-switch-C的ABR/ASBR信息。
[S-switch-C]displayospfabr-asbr
OSPFProcess1withRouterID3.3.3.3
RoutingTabletoABRandASBR
TypeDestinationAreaCostNexthopRtType
Intra-area1.1.1.10.0.0.11192.168.1.1ABR
Inter-area4.4.4.40.0.0.13192.168.1.1ASBR
#查看S-switch-C的OSPF路由表。
[S-switch-C]displayospfrouting
RoutingTables
RoutingforNetwork
DestinationCostTypeNextHopAdvRouterArea
172.16.1.0/241Transit172.16.1.13.3.3.30.0.0.1
172.17.1.0/244Inter-area192.168.1.11.1.1.10.0.0.1
192.168.0.0/242Inter-area192.168.1.11.1.1.10.0.0.1
192.168.1.0/241Transit192.168.1.23.3.3.30.0.0.1
192.168.2.0/243Inter-area192.168.1.11.1.1.10.0.0.1
RoutingforASEs
DestinationCostTypeTagNextHopAdvRouter
200.0.0.0/84Type11192.168.1.14.4.4.4
TotalNets:
6
IntraArea:
2InterArea:
3ASE:
1NSSA:
0
当S-switch-C所在区域为普通区域时,可以看到路由表中存在AS外部的路由。
3.配置Area1为Stub区域
#配置S-switch-A。
[S-switch-A]ospf
[S-switch-A-ospf-1]area1
[S-switch-A-ospf-1-area-0.0.0.1]stub
[S-switch-A-ospf-1-area-0.0.0.1]quit
[S-switch-A-ospf-1]quit
#配置S-switch-C。
[S-switch-C]ospf
[S-switch-C-ospf-1]area1
[S-switch-C-ospf-1-area-0.0.0.1]stub
[S-switch-C-ospf-1-area-0.0.0.1]quit
[S-switch-C-ospf-1]quit
#配置S-switch-E。
[S-switch-E]ospf
[S-switch-E-ospf-1]area1
[S-switch-E-ospf-1-area-0.0.0.1]stub
[S-switch-E-ospf-1-area-0.0.0.1]quit
[S-switch-E-ospf-1]quit
#查看S-switch-C的路由表。
0.0.0.0/02Inter-area192.168.1.11.1.1.10.0.0.1
192.168.1.0/241Transit192.168.1.23.3.3.30.0.0.1
4ASE:
0NSSA:
当把S-switch-C所在区域配置为Stub区域时,已经看不到AS外部的路由,取而代之的是一条通往区域外部的缺省路由。
#配置禁止向Stub区域通告Type3LSA。
[S-switch-A-ospf-1-area-0.0.0.1]stubno-summary
4.验证配置结果
3
IntraArea:
1ASE:
禁止向Stub区域通告Summary-LSA后,Stub区域设备的路由表项进一步减少。
路由表中已经看不到区域外部的路由,取而代之的是一条通往区域外部的缺省路由。
配置文件
∙S-switch-A的配置文件
#
sysnameS-switch-A
routerid1.1.1.1
vlanbatch1020
interfaceVlanif10
ipaddress192.168.0.1255.255.255.0
interfaceVlanif20
ipaddress192.168.1.1255.255.255.0
interfaceGigabitEthernet0/0/1
porttrunkallow-passvlan10
interfaceGigabitEthernet0/0/2
porttrunkallow-passvlan20
ospf1
area0.0.0.0
network192.168.0.00.0.0.255
area0.0.0.1
network192.168.1.00.0.0.255
stubno-summary
return
说明:
S-switch-B和S-switch-F的配置文件与前例相同,此处省略。
∙S-switch-C的配置文件
sysnameS-switch-C
routerid3.3.3.3
vlanbatch2040
ipaddress192.168.1.2255.255.255.0
interfaceVlanif40
ipaddress172.16.1.1255.255.255.0
porttrunkallow-passvlan40
area0.0.0.1
network172.16.1.00.0.0.255
stub
∙S-switch-D的配置文件
sysnameS-switch-D
vlanbatch3050
routerid4.4.4.4
interfaceVlanif30
ipaddress192.168.2.2255.255.255.0
interfaceVlanif50
ipaddress172.17.1.1255.255.255.0
porttrunkallow-passvlan30
porttrunkallow-passvlan50
import-routestatictype1
area0.0.0.2
network192.168.2.00.0.0.255
network172.17.1.00.0.0.255
iproute-static200.0.0.0255.0.0.0NULL0
∙S-switch-E的配置文件
sysnameS-switch-E
routerid5.5.5.5
vlanbatch40
ipaddress172.16.1.2255.255.255.0