要实现ospf多区域通信,我们必须要知道ospf的两个特性:
1、骨干区域必须保持畅通 2、非骨干区域必须与骨干区域连接
组网方式:
配置命令:
AR1:
[AR1]int loop 0
[AR1-LoopBack0]ip ad 1.1.1.1 32
[AR1-LoopBack0]int g0/0/0
[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]area 1
[AR1-ospf-1-area-0.0.0.1]network 10.0.0.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
AR2:
[AR2]int loop0
[AR2-LoopBack0]ip ad 2.2.2.2 32
[AR2-LoopBack0]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip ad 10.0.0.2 24
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip ad 20.0.0.1 24
[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]network 20.0.0.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]
[AR2-ospf-1-area-0.0.0.0]area 1
[AR2-ospf-1-area-0.0.0.1]network 10.0.0.0 0.0.0.255
AR3:
[AR3]int loop 0
[AR3-LoopBack0]ip ad 3.3.3.3 32
[AR3-LoopBack0]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip ad 20.0.0.2 24
[AR3-GigabitEthernet0/0/0]int g0/0/1
[AR3-GigabitEthernet0/0/1]ip ad 30.0.0.1 24
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]network 20.0.0.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]area 2
[AR3-ospf-1-area-0.0.0.2]network 30.0.0.0 0.0.0.255
AR4:
[AR4-LoopBack0]ip ad 4.4.4.4 32
[AR4-LoopBack0]int g0/0/0
[AR4-GigabitEthernet0/0/0]ip ad 30.0.0.2 24
[AR4]ospf 1 router-id 4.4.4.4
[AR4-ospf-1]area 2
[AR4-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[AR4-ospf-1-area-0.0.0.2]network 30.0.0.0 0.0.0.255
如果你查看路由表存在全网的路由,那么我们的ospf就配置成功了,这个时候我们就可实现ospf全网通信了