划分(192.168.1.0/24):
骨干:
192.168.1.00 000000/26
192.168.1.00 00 0000/28 192.168.1.0/28
192.168.1.00 01 0000/28 192.168.1.16/28
192.168.1.00 10 0000/28 192.168.1.32 28
192.168.1.00 11 0000/28 192.168.1.48/28
192.168.1.01 000000/26 192.168.1.64/26
192.168.1.10 000000/26 192.168.1.128/26
192.168.1.11 000000 /26 192.168.1.192/26
r1:
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 28
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip add 192.168.1.65 26
r2:
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.17 28
[r2-GigabitEthernet0/0/0]int l0
[r2-LoopBack0]ip add 192.168.1.129 26
r3:
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.33 28
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.49 28
[r3-GigabitEthernet0/0/0]int l0
[r3-LoopBack0]ip add 192.168.1.193 26
r4:
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.50 28
r1书写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:
[r2]ospf 1 router-id 1.1.1.1
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
r3书写ospf:
[r3]ospf 1 router-id 1.1.1.1
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
r4书写ospf:
[r4]ospf 1 router-id 1.1.1.1
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
r4书写缺省:
[r4-ospf-1]default-route-advertise
手工认证:
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
避免环路(空接口):
[r3]Ip route-static 192.168.1.0 28 null 0