三.实验步骤
1.配置ip地址
[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
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.130 30
2.环回口
[r1]int l0
[r1-LoopBack0]ip add 192.168.1.33 27
[r2]int l0
[r2-LoopBack0]ip add 192.168.1.65 27
[r3]int l0
[r3-LoopBack0]ip add 192.168.1.97 27
[r4]int l0
[r4-LoopBack1]ip add 4.4.4.4 24
3.配置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.7
[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.65 0.0.0.0
[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.130 0.0.0.0
4.该优先级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
5.边界路由器 下发缺省
[r4]ospf 1
[r4-ospf-1]default-route-advertise always
6.做认证
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher admin123
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher admin123
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher admin123
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher admin123
7.汇总
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher admin123
[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
8.空接口防环
[r3]ip route-static 192.168.1.0 25 NULL 0