OSPF骨干区域和非骨干区域通信

时间:2024-03-20 22:43:41

OSPF骨干区域和非骨干区域通信
第一步:配置IP地址

R1
undo terminal monitor
system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.1.2.1 24
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.1.1.2 24
[R1]int LoopBack 0
[R1-LoopBack0]ip address 2.2.2.2 32

R2
undo terminal monitor
system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei]sysname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/1]ip address 10.1.3.2 24
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.1.3.2 24
[R2]int LoopBack 0
[R2-LoopBack0]ip address 3.3.3.3 32

R3
undo terminal monitor
system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei]sysname R3
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 10.1.1.1 24
[R3]int LoopBack 0
[R3-LoopBack0]ip address 1.1.1.1 32

R4
undo terminal monitor
system-view
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei]sysname R4
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 10.1.3.1 24
[R4]int LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 32

第二步:OSPF多区域配置

R1
[R1]ospf 1 router-id 2.2.2.2
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255

R2
[R2]ospf 1 router-id 3.3.3.3
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]network 10.1.3.0 0.0.0.255

R3
[R3]ospf 1 router-id 1.1.1.1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[R3-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255

R4
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 10.1.3.0 0.0.0.255
[R4-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0