一.实验要求
二、实验步骤
- 划分ip192.168.1.0/24
思路:由于OSPF区域划分的特性,每个区域划分为一个网段,这样做有利于手工汇总
先将192.168.1.0/24借1位划分两个网段:
area0 :192.168.1.0/25 ;area1:192.168.1.128/25
area0的网段借2位划分为4个网段 :
广播域1:192.168.1.0/27 ;r1的环回:192.168.1.32/27;r2的环回:192.168.1.64/27 r3的环回:192.168.1.96/27
area1网段不需要子网划分 - 配置端口ip地址和每个路由器的环回地址
r1
r2
r3
r4
- 选择DR,OSPF选举DR的特性,会优先比较优先级,根据要求,只需要DR,不需要BDR,所以需要将r1、r2和r4的优先级设置为0,让他们放弃DR和BDR选举,这样就能让r3成为DR,并且不会出现BDR
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
[r4-GigabitEthernet0/0/0]ospf dr-priority 0
- 宣告,根据要求,不能宣告4.4.4.0/24
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255 - 由于没有宣告r4的环回,所以需要添加缺省,以r3为ABR
[r3-ospf-1]default-route-advertise always
用r1去ping r4的环回地址
至此全网可达
- 保障更新安全----手工认证
[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 1 cipher 123456
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456 - 手工汇总
<r1>display ip routing-table protocol ospf
上图的前两个地址为r1自己所属的区域(area0)通过OSPF获得的路由信息,最后一个地址
为area1所获得路由信息
同样处在area1的r4的路由表中
该路由条目是通过OSPF协议从area0获得来的
至此,完成所有要求。