拓扑信息:
需求分析:
1.整个网络要求使用192.168.1.0/24进行IP分配,且该网络中共有6个广播域,故网段划分为:
192.168.1.0/27
192.168.1.32/27
192.168.1.64/27
192.168.1.96/27
192.168.1.128/27
192.168.1.160/27
192.168.1.192/27
192.168.1.224/27
2.如果要求R1为DR、R2为BDR则根据非抢占原则先配置R1、再配置R2即可
3.R3~R5间使用密文传输,即认证方式为md5,则R3与R4之间、R4与R5之间的接口两端均需要配置。
4.注意到R5上的环回接口不能以OSPF直接宣告,但是要求全网可达。则考虑在R4上配置静态缺省路由指向R5,再通过R4下发给其它的路由器。
配置:
R1:
[r1-ospf-1-0.0.0.0]network 192.168.1.33 0.0.0.0
[r1-ospf-1-0.0.0.0]network 192.168.1.65 0.0.0.0
R2:
[r2-ospf-1-0.0.0.0]network 192.168.1.34 0.0.0.0
[r2-ospf-1-0.0.0.0]network 192.168.1.97 0.0.0.0
R3:
[r3-ospf-1-0.0.0.0]network 192.168.1.35 0.0.0.0
[r3-ospf-1-0.0.0.1]network 192.168.1.129 0.0.0.0
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
R4:
[r4-ospf-1-0.0.0.1]network 192.168.1.130 0.0.0.0
[r4-ospf-1-0.0.0.1]network 192.168.1.162 0.0.0.0
[r4]ip route-static 0.0.0.0 0 192.168.1.161
[r4-ospf-1]default-route-advertise
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r4-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
R5:
[r5-ospf-1-0.0.0.1]network 192.168.1.161 0.0.0.0
[r5-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
在下发缺省路由时,除了在R4上使用非强制性下发,还可以在R5上使用强制性下发:
在r5上强制性下发缺省路由:
测试:
DR与BDR:
R1:
R2:
R3:
R4:
R5: