实验要求
R1-3为区域0,R3到R4为区域1,其中R3的环回也在区域0
R1-R3 R3为DR设备,没有BDR
R4环回地址已固定,其他所有网段使用192.168.1,0/24进行合理分配
R4环回不能宣告,全网可达,保障更新安全,避免环路,减少路由条目数童
实验分析
- 实验分为两个区域,并且使用链路状态协议OSPF
- 合理进行IP划分,思路是先划分两个IP个两个区域,然后再在这两个IP中划分其他的所需IP,如点到点骨干,MA骨干,用户网段
192.168.1,0/24
192.168.1.0000 0000
192.168.1.0 0000000——192.168.1.0/25——A0
192.168.1.0 00 00000——192.168.1.0/27——点到点骨干(划分到30网段)
192.168.1.0 01 00000——192.168.1.32/27——ma的骨干(划分到29网段)
R1:192.168.1.33/29
R2:192.168.1.34/29
R3:192.168.1.35/29
由于A0中存在3个用户网段所以需要切割
192.168.1.0 10 00000——192.168.1.64/27——用户
R1:192.168.1.0 10 0 0000——192.168.1.64/28
R2:192.168.1.0 10 1 0000——192.168.1.80/28
192.168.1.0 11 00000——192.168.1.96/27——用户
R3:192.168.1.0 11 0 0000——192.168.1.96/28
192.168.1.0 11 1 0000——192.168.1.112/28
192.168.1.1 0000000——192.168.1.128/25——A1
192.168.1.1 00 00000——192.168.1.128/27——点到点骨干
192.168.1.1 01 00000——192.168.1.160/27——MA的骨干
192.168.1.1 10 00000——192.168.1.192/27——用户
192.168.1.1 11 00000——192.168.1.224/27——用户
3,合理配置IP,这就不演示了
4,分别启动ospf协议并且宣告各自的网段,注意反掩码,R3属于边界路由器,所以宣告是要每个网段分开宣告,反掩码为0.0.0.0
R1基本与R2,R4相同,所以展示一个
[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 ——反掩码(可以进行精准的宣告)
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.35 0.0.0.0 ——反掩码(可以进行精准的宣告)
[r3-ospf-1-area-0.0.0.0]network 192.168.1.97 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 ——反掩码(可以进行精准的宣告)
5,不能宣告R4环回,还要求全网可达,则需在R4上配置缺省路由
[r4-ospf-1]default-route-advertise always
6,保障更新安全,两辆之间添加密码
[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/0]ospf authentication-mode md5 1 cipher 654321
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 654321
7,减少路由条目,避免环路
在R3的area0中汇总
[r3-ospf-1-area-0.0.0]abr-summary 192.168.1.0 255.255.255.128
避免环路配置空接口
[r3]ip route-static 192.168.1.0 25 null 0——空接口