一、全局规划
二、接口IP及环回配置
AR1:
AR1:
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 29
[r1-GigabitEthernet0/0/0]interface loopback0
[r1-LoopBack0]ip address 192.168.1.33 27
AR2:
AR2:
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 29
[r2-GigabitEthernet0/0/0]interface loopback0
[r2-LoopBack0]ip address 192.168.1.65 27
AR3:
AR3:
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.3 29
[r3]interface g0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.129 25
[r3-GigabitEthernet0/0/1]interface loopback0
[r3-LoopBack0]ip address 192.168.1.97 27
AR4:
[r4]interface g0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.130 25
[r4-GigabitEthernet0/0/0]interface loopback0
[r4-LoopBack0]ip address 4.4.4.4 24
三、OSPF宣告
AR1:
AR1:
[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
AR2:
AR2:
[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
AR3:
[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.97 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.3 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
AR4:
AR4:
[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
四、修改优先级(满足条件2)
AR2(优先级为0:放弃选举)
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
AR1:
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
五、添加缺省(全网可达)
AR4:
[r4]ospf 1
[r4-ospf-1]default-route-advertise always
六、接口认证(保障更新安全)
A0区域认证:
AR1:
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
AR2:
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
AR3:
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
A1区域认证:
AR3:
[r3]interface g0/0/1
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
AR4:
[r4]interface g0/0/0
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
七、汇总
AR3:
[r3]ospf 1
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128
八、添加空接口(防环)
做路由汇总的的设备AR3:
[r3]ip route-static 192.168.1.0 25 null 0
至此,实验结束,全网可达。