一.实验要求二、实验思路及步骤
1.先数广播域个数然后再将192.168.1.0/24 进行合理的子网划分
192.168.1.00000000/24
192.168.1.00 0 00000/26 --- 骨干
192.168.1.00 0 00000/27 --- 192.168.1.0/27
192.168.1.00 1 00000/27 --- 192.168.1.32/27
192.168.1.01 000000/26 --- R1
192.168.1.01 0 00000/27 -- 192.168.1.64/27
192.168.1.01 1 00000/27 -- 192.168.1.96/27
192.168.1.10 000000/26 --- R2
192.168.1.10 0 00000/27 --- 192.168.1.128/27
192.168.1.10 1 00000/27 --- 192.168.1.160/27
192.168.1.11 000000/26 --- R3
192.168.1.11 0 00000/27 --- 192.168.1.192/27
192.168.1.11 1 00000/27 --- 192.168.1.224/27
2.设备配置
1) 对R1-R4进行IP配置
<Huawei>sys
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 27
[R1-GigabitEthernet0/0/1]interface loopback 0
[R1-LoopBack0]ip address 192.168.1.65 27
以R1为例 其余同理
R2
R3
R4
2)进行OSPF基本配置
R1
[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.1 0.0.0.255 --- 反掩码
[r1-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0 ---精准宣告
随后使R1 R2 R4接口优先级为零放弃DR/BDR选举 使R3成为BR设备
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
[r4-GigabitEthernet0/0/0]ospf dr-priority 0
[r1]display ospf peer --- 查看OSPF的邻居表
以R1为例 其余同理
R2
R3
R4
[ r4-ospf-1]default-route-advertise always ---强制下发 使全网可达
3)设置空接口避免发生闭环
[R1]ip route-static 192.168.1.64 26 NULL 0
[R2]ip route-static 192.168.1.128 26 NULL 0
[R3]ip route-static 192.168.1.192 26 NULL 0
4)保障更新安全
手工认证
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 2 cipher 123456
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 2 cipher 123456
注意:两边的认证类型,KEY ID,口令必须相
测试全网可达