双区域:
实验拓扑:
1.配置好四个PCIP、掩码、网关。
2.R1配置:
[R1]int g0/0
[R1-GigabitEthernet0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0]int s1/0
[R1-Serial1/0]ip add 10.0.1.1 24
[R1-Serial1/0]int g0/1
[R1-GigabitEthernet0/1]ip add 192.168.2.254 24
[R1-GigabitEthernet0/1]
[R1-GigabitEthernet0/1]ospf 10
[R1-ospf-10]area 0
[R1-ospf-10-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-10-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R1-ospf-10-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[R1-ospf-10-area-0.0.0.0]qu
[R1-ospf-10]%Jan 4 09:09:43:345 2021 R1 OSPF/5/OSPF_NBR_CHG: OSPF 10 Neighbor 10.0.1.2(Serial1/0) changed from LOADING to FULL.
[R1-ospf-10]ospf 10
[R1-ospf-10]dis this
#
ospf 10
area 0.0.0.0
network 10.0.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
3.R2配置:
[R2]int s1/0
[R2-Serial1/0]ip add 10.0.1.2 24
[R2-Serial1/0]int s2/0
[R2-Serial2/0]ip add 10.0.2.1 24
[R2-Serial2/0]ospf 10
[R2-ospf-10]area 0
[R2-ospf-10-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[R2-ospf-10]area 1
[R2-ospf-10-area-0.0.0.1]network 10.0.2.0 0.0.0.255
[R2-ospf-10-area-0.0.0.1]ospf 10
[R2-ospf-10]dis this
#
ospf 10
area 0.0.0.0
network 10.0.1.0 0.0.0.255
area 0.0.0.1
network 10.0.2.0 0.0.0.255
#
return
4.R3配置:
[H3C]sysname R3
[R3]int s0/0
[R3]int g0/0
[R3-GigabitEthernet0/0]ip add 192.168.3.254 24
[R3-GigabitEthernet0/0]int s1/0
[R3-Serial1/0]ip add 10.0.2.2 24
[R3-Serial1/0]int g0/1
[R3-GigabitEthernet0/1]ip add 192.168.4.254 24
[R3-GigabitEthernet0/1]ospf 10
[R3-ospf-10]area 1
[R3-ospf-10-area-0.0.0.1]network 192.168.3.0 0.0.0.255
[R3-ospf-10-area-0.0.0.1]network 192.168.4.0 0.0.0.255
[R3-ospf-10-area-0.0.0.1]network 10.0.2.0 0.0.0.255
[R3-fospf-10-area-0.0.0.1]dis this
#
area 0.0.0.1
network 10.0.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
#
return
5.测试:
单区域:
实验拓扑:
1.配置好四个PCIP、网关、掩码。
2.R1:
<R1>sys
System View: return to User View with Ctrl+Z.
[R1]sysname R1
[R1]int g0/1
[R1-GigabitEthernet0/1]ip add 192.168.2.254 24
[R1-GigabitEthernet0/1]int s1/0
[R1-Serial1/0]ip add 10.0.1.1 24
[R1-Serial1/0]int g0/0
[R1-GigabitEthernet0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0]ospf 10
[R1-ospf-10]area 0
[R1-ospf-10-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-10-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R1-ospf-10-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[R1-ospf-10-area-0.0.0.0]%Jan 4 10:23:38:280 2021 R1 OSPF/5/OSPF_NBR_CHG: OSPF 10 Neighbor 10.0.1.2(Serial1/0) changed from LOADING to FULL.
3.R2:
[H3C]sysname R2
[R2]int s1/0
[R2-Serial1/0]ip add 10.0.1.2 24
[R2-Serial1/0]int s2/0
[R2-Serial2/0]ip add 10.0.2.1 24
[R2-Serial2/0]ospf 10
[R2-ospf-10]area 0
[R2-ospf-10-area-0.0.0.0]network 10.0.1.0 0.0.0.255
[R2-ospf-10-area-0.0.0.0]%Jan 4 10:23:38:736 2021 R2 OSPF/5/OSPF_NBR_CHG: OSPF 10 Neighbor 10.0.1.1(Serial1/0) changed from LOADING to FULL.
[R2-ospf-10-area-0.0.0.0]network 10.0.2.0 0.0.0.255
4.R3:
[H3C]sysname R3
[R3]int s1/0
[R3-Serial1/0]ip add 10.0.2.2 24
[R3-Serial1/0]int g0/0
[R3-GigabitEthernet0/0]ip add 192.168.3.254 24
[R3-GigabitEthernet0/0]int g0/1
[R3-GigabitEthernet0/1]ip add 192.168.4.254 24
[R3-GigabitEthernet0/1]
[R3-GigabitEthernet0/1]
[R3-GigabitEthernet0/1]
[R3-GigabitEthernet0/1]ospf 10
[R3-ospf-10]area 0
[R3-ospf-10-area-0.0.0.0]
[R3-ospf-10-area-0.0.0.0]
[R3-ospf-10-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[R3-ospf-10-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[R3-ospf-10-area-0.0.0.0]network 10.0.2.0 0.0.0.255
5:测试:
此文章若有错误请大佬指正