拓扑如下:
【1】RTA的配置:
<Huawei>system-view
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 10.0.0.1 24
[Huawei-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]quit
[Huawei]int g0/0/1.1
[Huawei-GigabitEthernet0/0/1.1]ip add 192.168.0.1 24
[Huawei-GigabitEthernet0/0/1.1]undo shut
Info: Interface GigabitEthernet0/0/1.1 is not shutdown.
[Huawei-GigabitEthernet0/0/1.1]quit
[Huawei]int g0/0/1.2
[Huawei-GigabitEthernet0/0/1.2]ip add 192.168.1.1 24
[Huawei-GigabitEthernet0/0/1.2]undo shut
Info: Interface GigabitEthernet0/0/1.2 is not shutdown.
[Huawei-GigabitEthernet0/0/1.2]quit
[Huawei]int g0/0/1.3
[Huawei-GigabitEthernet0/0/1.3]ip add 192.168.2.1 24
[Huawei-GigabitEthernet0/0/1.3]und shut
Info: Interface GigabitEthernet0/0/1.3 is not shutdown.
[Huawei-GigabitEthernet0/0/1.3]quit
[Huawei]int g0/0/1.4
[Huawei-GigabitEthernet0/0/1.4]ip add 192.168.3.1 24
[Huawei-GigabitEthernet0/0/1.4]undo shut
Info: Interface GigabitEthernet0/0/1.4 is not shutdown.
[Huawei-GigabitEthernet0/0/1.4]quit
[Huawei]int g0/0/1.1
[Huawei-GigabitEthernet0/0/1.1]vlan-type dot1q 10
[Huawei-GigabitEthernet0/0/1.1]quit
[Huawei]int g0/0/1.2
[Huawei-GigabitEthernet0/0/1.2]vlan-type dot1q 20
[Huawei-GigabitEthernet0/0/1.2]quit
[Huawei]int g0/0/1.3
[Huawei-GigabitEthernet0/0/1.3]vlan-type dot1q 30
[Huawei-GigabitEthernet0/0/1.3]quit
[Huawei]int g0/0/1.4
[Huawei-GigabitEthernet0/0/1.4]vlan-type dot1q 40
[Huawei-GigabitEthernet0/0/1.4]quit
【2】RTB的配置:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 10.0.0.2 24
[Huawei-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 20.0.0.1 24
[Huawei-GigabitEthernet0/0/1]undo shut
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 2.2.2.2 32
【3】RTC的配置:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 20.0.0.2 24
[Huawei-GigabitEthernet0/0/1]undo shut
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 30.0.0.1 24
[Huawei-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 3.3.3.3 32
【4】RTD的配置:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 30.0.0.2 24
[Huawei-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]int loo
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 4.4.4.4 32
[Huawei-LoopBack0]
【5】OSPF配置
RTA的OSPF配置:
[Huawei]ospf 100
[Huawei-ospf-100]area 1
[Huawei-ospf-100-area-0.0.0.1]net 10.0.0.0 0.0.0.255
[Huawei-ospf-100-area-0.0.0.1]net 1.1.1.1 0.0.0.0
[Huawei-ospf-100-area-0.0.0.1]quit
[Huawei-ospf-100]import-route direct
[Huawei-ospf-100]
RTB的OSPF配置:
[Huawei]ospf 100
[Huawei-ospf-100]area 1
[Huawei-ospf-100-area-0.0.0.1]net 10.0.0.0 0.0.0.255
[Huawei-ospf-100-area-0.0.0.1]area 0
[Huawei-ospf-100-area-0.0.0.0]net 20.0.0.0 0.0.0.255
[Huawei-ospf-100-area-0.0.0.0]net 2.2.2.2 0.0.0.0
[Huawei-ospf-100-area-0.0.0.0]
RTC的OSPF配置:
[Huawei]ospf 100
[Huawei-ospf-100]area 0
[Huawei-ospf-100-area-0.0.0.0]net 20.0.0.0 0.0.0.255
[Huawei-ospf-100-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[Huawei-ospf-100-area-0.0.0.0]area 2
[Huawei-ospf-100-area-0.0.0.2]net 30.0.0.0 0.0.0.255
RTD的OSPF配置:
[Huawei]ospf 100
[Huawei-ospf-100]area 2
[Huawei-ospf-100-area-0.0.0.2]net 30.0.0.0 0.0.0.255
[Huawei-ospf-100-area-0.0.0.2]net 4.4.4.4 0.0.0.0
[Huawei-ospf-100-area-0.0.0.2]
【6】RTD的路由表如下:
【7】RTC、RTD的area 2配置成 stub区域
RTC的配置:
[Huawei]ospf 100
[Huawei-ospf-100]area 2
[Huawei-ospf-100-area-0.0.0.2]stub
[Huawei-ospf-100-area-0.0.0.2]
RTD的配置:
[Huawei]ospf 100
[Huawei-ospf-100]area 2
[Huawei-ospf-100-area-0.0.0.2]stub
[Huawei-ospf-100-area-0.0.0.2]
【8】RTD的路由表如下:Stub区域允许出现1/2/3类型的LSA,不允许出现4/5类的LSA,会生成一条默认的3类LSA。
【9】RTC area 2配置成Totally stub 区域:
[Huawei-ospf-100-area-0.0.0.2]stub no-summary
【10】查看RTD的路由表,Totally stub 区域只允许出现1/2类型的LSA和一条3类缺省路由,不允许出现3/4/5类型的LSA。