Ospf实验
R1-3为区域0,R3到R4为区域1,其中R3的环回也在区域0
R1,2也有环回,R1-3 R3为DR设备,没有BDR
R4环回地址已固定,其他所有网段使用192.168.1.0/24进行合理分配
R4环回不能宣告,全网可达,保障更新安全,避免环路,减少路由条目数量
192.168.1.0/24
192.168.1.0/25 area0
MA骨干 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 R3
192.16.1.128/25 area1
192.168.1.128/27 ---P2P 192.168.1.128/30.。。。
192.168.1.160/27 ---MA 192.168.1.160/29…
192.168.1.192/27---R4
192.168.1.224/27
一、区域0环回
[r1]int LoopBack 0
[r1-LoopBack0]ip add 192.168.1.33 27
[r2]int LoopBack 0
[r2-LoopBack0]ip add 192.168.1.65 27
[r3]int LoopBack 0
[r3-LoopBack0]ip add 192.168.1.97 27
区域0骨干
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 29
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 29
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.3 29
Area1环回
[r4]int LoopBack 0
[r4-LoopBack0]ip add 192.168.1.193 27
[r4-LoopBack0]int LoopBack 1
[r4-LoopBack1]ip add 4.4.4.4 24
骨干
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.130 30
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.129 30
检验直连连通性
二、起ospf
[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]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]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-0.0.0.0]q
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 192.168.1.129 0.0.0.0
[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.0 0.0.0.255
验证;
三、该优先级
R1-3 R3为DR设备,没有BDR
让R3当DR R1R2放弃选举
[r1-GigabitEthernet0/0/0]ospf dr
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ospf dr
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
上面这个拓扑直接改一下优先级,即可实现,简单方便地干涉方案
四、边界路由器 下发缺省
[r4]ospf 1
[r4-ospf-1]default-route-advertise always
五、做认证
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher cisco123
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher cisco123
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher cisco123
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher cisco123
六、汇总
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr
[r3-ospf-1-area-0.0.0.1]abr-summary 192.168.1.128 255.255.255.128
[r3-ospf-1-area-0.0.0.1]q
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128
七、空接口防环
[r3]ip route-static 192.168.1.0 25 NULL 0
[r3]ip route-static 192.168.1.128 25 NULL 0