一、实验拓补二、实验需求
三、实验步骤
1、配置IP地址
R1R2
R3
R4
配置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.7
[R1-ospf-1-area-0.0.0.0]network 192.168.1.33 0.0.0.0
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.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
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.3 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
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.130 0.0.0.0
R4环回口不宣告
查看链路状态数据库表(lsdb)邻居表
[R1]display ospf peer briefR2
R3
R4
死亡时间是‘hello’时间的四倍
此时已全网通若要ping通4.4.4.4,则需要配置缺省路由,但过于繁杂,选择在R4下发静态路由
[R4]ospf 1
[R4-ospf-1]default-route-advertise always(默认 路由 通告 ——)强制的下发给每一个路由)
此时其它路由都有一条缺省路由(ASE:域外)
此时全部路由可ping通4.4.4.4
改变DR和BDR
方法一:重启设备
方法二:改变优先级
[R1]
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf dr-priority ?
INTEGER<0-255> Router priority value
[R1-GigabitEthernet0/0/0]ospf dr-priority 0
此时DR和BDR已改变
下一步,保证更新安全
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5?
md5 Use MD5 algorithm
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 ?
STRING<1-255>/<20-392> The password (key)
cipher Encryption type (Cryptogram)
plain Encryption type (Plain text)
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345
其它路由同理,且不影响全网通
最后,减少路由条目,避免环路
在ABR上做汇总
[R3-ospf-1-area-0.0.0.1]abr-summary 192.168.1.0 255.255.255.128
防环
[R3]ip route-static 192.168.1.0 25 NULL 0