HCNA-20.OSPF多区域配置
20.OSPF多区域配置
拓扑图如下:
==========================================================
1.设备初始化配置
==========================================================
#根据拓扑图,配置路由器的各个接口
R1:
sys
sysname R1
undo info-cen en
int g0/0/0
ip add 10.0.12.1 24
int g0/0/1
ip add 10.0.13.1 24
int g0/0/2
ip add 10.0.15.1 24
q
------------------------------------------
R2:
sys
sysname R2
undo info-cen en
int g0/0/0
ip add 10.0.12.2 24
int g0/0/1
ip add 10.0.24.2 24
int g0/0/2
ip add 10.0.26.2 24
q
------------------------------------------
R3:
sys
sysname R3
undo info-cen en
int g0/0/0
ip add 10.0.34.3 24
int g0/0/1
ip add 10.0.13.3 24
int g0/0/2
ip add 10.0.35.3 24
int e4/0/0
ip add 10.0.3.254 24
q
------------------------------------------
R4:
sys
sysname R4
undo info-cen en
int g0/0/0
ip add 10.0.34.4 24
int g0/0/1
ip add 10.0.24.4 24
int g0/0/2
ip add 10.0.46.4 24
int e4/0/0
ip add 10.0.4.254 24
q
------------------------------------------
R5:
sys
sysname R5
undo info-cen en
int g0/0/0
ip add 10.0.15.5 24
int g0/0/1
ip add 10.0.1.254 24
int g0/0/2
ip add 10.0.35.5 24
q
------------------------------------------
R6:
sys
sysname R6
undo info-cen en
int g0/0/0
ip add 10.0.26.6 24
int g0/0/1
ip add 10.0.46.6 24
int g0/0/2
ip add 10.0.2.254 24
q
------------------------------------------
#配置总部区域为OSPF的骨干区域Area 0
------------------------------------------
R1:
ospf 1
area 0
network 10.0.12.0 0.0.0.255
network 10.0.13.0 0.0.0.255
return
--------------------
R2:
ospf 1
area 0
network 10.0.12.0 0.0.0.255
network 10.0.24.0 0.0.0.255
return
--------------------
R3:
ospf 1
area 0
network 10.0.13.0 0.0.0.255
network 10.0.34.0 0.0.0.255
network 10.0.3.0 0.0.0.255
return
--------------------
R4:
ospf 1
area 0
network 10.0.24.0 0.0.0.255
network 10.0.34.0 0.0.0.255
network 10.0.4.0 0.0.0.255
return
------------------------------------------
测试总部内2台PC连通性
10.0.3.1 ping 10.0.4.1
------------------------------------------
==========================================================
2.配置非骨干区域路由器
==========================================================
-------------------
2.1配置非骨干区域area 1
-------------------
R5:
ospf 1
area 1
network 10.0.1.0 0.0.0.255
network 10.0.15.0 0.0.0.255
network 10.0.35.0 0.0.0.255
return
------------------------------------------
R1:
ospf 1
area 1
network 10.0.15.0 0.0.0.255
return
------------------------------------------
R3:
ospf 1
area 1
network 10.0.35.0 0.0.0.255
return
------------------------------------------
R5:
dis ospf peer
dis ip routing-table protocol ospf
dis ospf lsdb
-------------------------------------------------------------
2.2配置非骨干区域area 2
-------------------
R6:
ospf 1
area 2
network 10.0.2.0 0.0.0.255
network 10.0.26.0 0.0.0.255
network 10.0.46.0 0.0.0.255
return
------------------------------------------
R2:
ospf 1
area 2
network 10.0.26.0 0.0.0.255
return
------------------------------------------
R4:
ospf 1
area 2
network 10.0.46.0 0.0.0.255
return
------------------------------------------
R6
dis ip routing-table protocol ospf
dis ospf peer
dis ospf lsdb
------------------------------------------
10.0.1.1 ping 10.0.2.1