目录
条件:
1.r3的area0区域为dr没有bdr
2.r4的环回不能宣告全网可达
3.保证更新安全加快收敛速度
4.保证区域安全
5.456的路由上的环回都在area2上
1.搭建简单OSPF拓扑图
2.基本配置
以R2为例
[Huawei]interface g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 23.1.1.1 24
[Huawei]interface LoopBack 0
[Huawei-LoopBack0]ip address 2.2.2.2 32
3.配置OSPF宣告网段
以R2为例
[Huawei]ospf 100 router-id 2.2.2.2
[Huawei-ospf-100]area 1
[Huawei-ospf-100-area-0.0.0.1]network 12.1.1.0 0.0.0.255
[Huawei-ospf-100-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[Huawei-ospf-100-area-0.0.0.1]network 23.1.1.0 0.0.0.255
注释:在raea 2区域中只需要将自身环回地址段在area 2宣告即可 其他宣告方法相同
4.强制下放缺省路由
在R4中强制下放缺省路由,各个路由器之间相互学习
[Huawei]ospf 100
[Huawei-ospf-100]default-route-advertise always
5.更改area0区域老大
[Huawei]display ospf peer
OSPF Process 100 with Router ID 4.4.4.4
Neighbors
Area 0.0.0.0 interface 123.1.1.2(GigabitEthernet0/0/1)'s neighbors
Router ID: 3.3.3.3 Address: 123.1.1.1
State: Full Mode:Nbr is Slave Priority: 1
DR: 123.1.1.1 BDR: 123.1.1.2 MTU: 0
Dead timer due in 39 sec
Retrans timer interval: 5
Neighbor is up for 00:19:29
Authentication Sequence: [ 0 ]
Router ID: 5.5.5.5 Address: 123.1.1.3
State: Full Mode:Nbr is Master Priority: 1
DR: 123.1.1.1 BDR: 123.1.1.2 MTU: 0
Dead timer due in 35 sec
Retrans timer interval: 5
Neighbor is up for 00:17:54
Authentication Sequence: [ 0 ]
Router ID: 6.6.6.6 Address: 123.1.1.4
State: Full Mode:Nbr is Master Priority: 1
DR: 123.1.1.1 BDR: 123.1.1.2 MTU: 0
Dead timer due in 27 sec
Retrans timer interval: 5
Neighbor is up for 00:16:31
Authentication Sequence: [ 0 ]
//更改BDR老大
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]ospf dr-priority 0
6.增强区域安全
区域明文认证
[R2]ospf 100
[R2-ospf-100]area 1
[R2-ospf-100-area-0.0.0.1]authentication-mode simple cipher 123
区域密文认证
[R2]ospf 100
[R2-ospf-100]area 2
[R2-ospf-100-area-0.0.0.2]authentication-mode simple cipher 123
[R2-ospf-100-area-0.0.0.2]authentication-mode md5
7.加快收敛速度
以R2为例:
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ospf timer hello 5//更改hello时间
[R2-GigabitEthernet0/0/0]ospf timer dead 20