一.实验要求
![](https://i-blog.csdnimg.cn/blog_migrate/c4402c3cf596926b2841853e797f5cb1.jpeg)
二.ip规划
![](https://i-blog.csdnimg.cn/blog_migrate/9cb138663aeed772f4ebae50f3647cbe.png)
三.配置骨干ip和还回ip
r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 27
[r1]int l0
[r1-LoopBack0]ip add 192.168.1.33 27
r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 27
[r2]int L0
[r2-LoopBack0]ip add 192.168.1.65 27
r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.3 27
[r3]int l0
[r3-LoopBack0]ip add 192.168.1.97 27
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.129 30
r4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.130 30
[r4]int l0
[r4-LoopBack0]ip add 4.4.4.1 24
四.配置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.255
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.0 0.0.0.255
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.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.1]network 4.4.4.1 0.0.0.0
五.扩展配置
1.修改dr,干涉选举
r1
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
r2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
2.r4做缺省
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]undo network 4.4.4.1 0.0.0.0
[r4-ospf-1-area-0.0.0.1]q
[r4-ospf-1]default-route-advertise always
3.对接口做手工认证
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 12345
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345
4.写空接口
[r3]ip route-static 192.168.1.0 25 NULL 0
[r3]ip route-static 192.168.1.128 25 NULL 0
5.进行手工汇总
[r3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128
[r3-ospf-1-area-0.0.0.1]abr-summary 192.168.1.128 255.255.255.128