实验拓扑图:
实验要求:
1、R1-3为区域0,R3到R4为区域1;其中R3的环回也在区域0;
2、R1-R3,R3为DR设备,没有BDR;
3、R4环回地址已固定,其他所有网段使用192.168.1.0/24进行合理分配;
4、R4环回不能宣告,全网可达,保障更新安全,避免环路,减少路由条目数量;
实验分析:
1、子网划分:
192.168.1.0/25 -- area 0、192.168.1.128/25 -- area 1
area 0:1个骨干,3个用户网段
192.168.1.0/27 骨干 -- 192.168.1.0/29 192.168.1.8/29 192.168.1.16/29 192.168.1.24/29
192.168.1.32/27 R1
192.168.1.64/27 R2
192.168.1.96/27 R32、R3为DR设备,没有BDR; 则修改R1、R2接口优先级;
3、R4环回不能宣告,全网可达; 则在R4上配置缺省路由;
实验配置:
1、配置各个路由器接口IP地址以及环回地址:
① R1
[R1]int lo 0
[R1-LoopBack0]ip add 192.168.1.33 27
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 29
② R2
[R2]int lo 0
[R2-LoopBack0]ip add 192.168.1.65 27
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.2 29
③ R3
[R4]int lo 0
[R4-LoopBack0]ip add 4.4.4.4 24
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.3 29
[R3-GigabitEthernet0/0/0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.129 25
④R4
[R3]int lo 0
[R3-LoopBack0]ip add 192.168.1.97 27
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.130 25
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.0 0.0.0.255
② R2
[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
[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.97 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 192.168.1.129 0.0.0.0
④R4
[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.130 0.0.0.0
3、干涉选举,R3为DR设备,没有BDR:
① R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ospf dr-priority 0
② R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ospf dr-priority 0
4、配置缺省路由,不宣告R4环回,全网可达:
[R4]ospf 1
[R4-ospf-1]default-route-advertise always
5、接口认证,保障更新安全:
① R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 970119
② R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 970119
③ R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 970119
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 970602
④R4
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 970602
6、区域汇总,减少路由条目数量:
[R3]ospf 1
[R3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128
7、 配置空接口,避免环路:
[R3]ip route-static 192.168.1.0 25 NULL 0