一,前言
给定拓扑
要求
1. R1-3为区域o,R3到R4为区域1;其中R3的环回也在区域a.
2. R1-R3 R3为DR设备,没有BDR.R4环回地址已固定,其他所有网段使用192.168.1.0/24进行合理分配.
3. R4环回不能宣告,全网可达,保障更新安全,避免环路,减少路由条目数量.
二,规划IP
分析
由给定拓扑可知骨干网段可看成1个,R1--R3各有两个环回,也可以看成3个,所以共需要4个IP段,因此划分如下:
三,配置
配置IP
配置R1
Huawei>sy
<Huawei>system-view
[Huawei]sysname r1
[r1-LoopBack0]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 27
[r1-GigabitEthernet0/0/0]int lo0
[r1-LoopBack0]ip add 192.168.1.65 27
[r1-LoopBack0]int lo1
[r1-LoopBack1]ip add 192.168.1.97 27
配置R2
<Huawei>system-view
[Huawei]sysname r2
[r2]int lo0
[r2-LoopBack0]ip add 192.168.1.129 27
[r2-LoopBack0]int lo1
[r2-LoopBack1]ip add 192.168.1.161 27
[r2-LoopBack1]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 27
配置R3
<Huawei>sy
<Huawei>system-view
[Huawei]sysname r3
[r3]int lo0
[r3-LoopBack0]ip add 192.168.1.193 27
[r3-LoopBack0]int lo1
[r3-LoopBack1]ip add 192.168.1.225 27
[r3-LoopBack1]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.3 27
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.33 27
配置R4
<Huawei>sy
<Huawei>system-view
[Huawei]sysname r4
[r4]int lo0
[r4-LoopBack0]ip add 4.4.4.8 24
[r4-LoopBack0]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.34 30
OSPF基础配置
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 192.168.1.33 0.0.0.0
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
实现全网可达
给边界路由器R4添加
[r4-ospf-1]default-route-advertise always
设置R3为DR设备,没有BDR
除R3设备外,每个设备参选接口添加
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
[r4]interface g0/0/0
[r4-GigabitEthernet0/0/0]ospf dr-priority 0
此时,R3设备为DR 设备
保障更新安全
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r1-GigabitEthernet0/0/0]q
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r2-GigabitEthernet0/0/0]q
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 654321
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 654321
四,测试
全网可达