192.168.1.0/24
192.168.1.0/25 area0
MA骨干 192.168.1.0/27
192.168.1.0/29
192.138.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.168.1.128/25 area1
192.168.1.128/27 —P2P 192.168.1.128/30
192.168.1.192/27—R4
区域0的环回地址
[r1-LoopBack0]ip address 192.168.1.34 27
[r2-LoopBack0]ip address 192.168.1.65 27
[r3-LoopBack0]ip add 192.168.1.98 27
给骨干配上IP地址
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 29
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 29
[r3-GigabitEthernet0/0/0]ip address 192.168.1.3 29
区域1:
[r4-LoopBack1]IP address 4.4.4.4 24
骨干:
[r4-GigabitEthernet0/0/1]ip address 192.168.1.130 27
[r3-GigabitEthernet0/0/1]ip address 192.168.1.129 27
再使用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.0 0.0.0.255
[R3]ospf 1 router-id 3.3.3.3
[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]ip route-static 192.168.1.0 25 NULL 0
[r3]ip route-static 192.168.1.128 25 NULL 0