eNSP V100R003C00SPC100版本
红色区域为rip协议,蓝黄绿为ospf协议的3个区域,通过路由协议重分发实现全网互通。
设置图中绿色区域area2为末梢区域,观察路由表信息。
设置图中绿色区域area2为完全末梢区域,观察路由表信息。
设置图中蓝色区域area1为nssa区域,观察路由表信息。
配置R1-R6----验证需求1-----》》设置末梢区域-----验证需求2----》》设置完全末梢区域-----验证需求3------》》设置nssa区域-----验证需求4
[R1] undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[R1]int g0/0/0 ##配置接口ip地址
[R1-GigabitEthernet0/0/0]ip add 11.0.0.2 24
[R1-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R1-GigabitEthernet0/0/1]int loo 0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]ospf 1 router-id 1.1.1.1 ##配置OSPF,配置路由ID
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.1]network 12.0.0.0 0.255.255.255 ##宣告直连网段
[R1-ospf-1-area-0.0.0.1]rip 1 ##配置rip
[R1-rip-1]ver 2
[R1-rip-1]un summary
[R1-rip-1]network 11.0.0.0
[R1-rip-1]import-route ospf 1 ###ospf协议注入
[R1-rip-1]ospf 1
[R1-ospf-1]import-route rip 1 type 1 cost 1 ###外部rip协议注入
[R2] undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[R2]int g0/0/0 ##配置接口ip地址
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 13.0.0.1 24
[R2-GigabitEthernet0/0/1]int loo 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]ospf 1 router-id 2.2.2.2 ##配置ospf,配置路由ID
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0 ##宣告直连网段
[R2-ospf-1-area-0.0.0.1]network 13.0.0.0 0.255.255.255
[R2-ospf-1-area-0.0.0.1]network 12.0.0.0 0.255.255.255
[R3]undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[R3]int g0/0/0 ##配置接口ip地址
[R3-GigabitEthernet0/0/0]ip add 13.0.0.2 24
[R3-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 14.0.0.1 24
[R3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R3-GigabitEthernet0/0/1]int loo 0
[R3-LoopBack0]ip add 3.3.3.3 32
[R3-LoopBack0]ospf 1 router-id 3.3.3.3 ##配置ospf,配置路由ID
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 13.0.0.0 0.255.255.255 ##宣告直连网段
[R3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]area 0
[R3-ospf-1-area-0.0.0.0]network 14.0.0.0 0.255.255.255
[R4]undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[R4]int g0/0/0 ##配置接口ip地址
[R4-GigabitEthernet0/0/0]ip add 14.0.0.2 24
[R4-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 15.0.0.1 24
[R4-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R4-GigabitEthernet0/0/1]int loo 0
[R4-LoopBack0]ip add 4.4.4.4 32
[R4-LoopBack0]ospf 1 router-id 4.4.4.4 ##配置ospf,配置路由ID
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0 ##宣告直连网段
[R4-ospf-1-area-0.0.0.0]network 14.0.0.0 0.255.255.255
[R4-ospf-1-area-0.0.0.0]area 2
[R4-ospf-1-area-0.0.0.2]network 15.0.0.0 0.255.255.255
[R5]undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[R5]int g0/0/0 ##配置接口ip地址
[R5-GigabitEthernet0/0/0]ip add 15.0.0.2 24
[R5-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R5]int loo 0
[R5-LoopBack0]ip add 5.5.5.5 32
[R5-LoopBack0]ospf 1 router-id 5.5.5.5 ##配置ospf,配置路由ID
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]network 5.5.5.5 0.0.0.0 ##宣告直连网段
[R5-ospf-1-area-0.0.0.2]network 15.0.0.0 0.255.255.255
[R6]undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 11.0.0.1 24 ##配置接口ip地址
[R6-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R6]int loo 0
[R6-LoopBack0]ip add 6.6.6.6 32
[R6-LoopBack0]rip 1 ##配置rip
[R6-rip-1]ver 2 ##版本2
[R6-rip-1]network 11.0.0.0 ##宣告直连网段
[R6-rip-1]network 6.0.0.0
[R6-rip-1]undo summary
分别查看rip协议区域的路由表信息和ospf区域的路由表信息,已经全部学习。
将上图绿色区域area2设置为末梢区域,此时末梢区域中的路由会显示一条默认路由到外部区域。
[R4]ospf 1
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]stub
[R5]ospf 1
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]stub
将上图绿色区域area2设置为完全末梢区域,此时完全末梢区域中的路由会显示一条默认路由到除本区域外的其他区域。
[R4]ospf 1
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]stub no
[R4-ospf-1-area-0.0.0.2]stub no-summary
将图中蓝色区域area1设为nssa区域,优化5类变为7类;向nssa区域通告rip区域路由。
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]nssa
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]nssa
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]nssa