第一步:子网划分
需要多少个网段?总共需要14段地址
192.168.1.0/24 借4位地址--划分16段地址 192.168.1.0/28 192.168.1.16/28
骨干链路 /30的地址
192.168.1.0/24 借三位192.168.1.0/27
192.168.1.32/27
192.168.1.64/27
192.168.1.96/27
192.168.1.128/27
192.168.1.160127 ---可以不用
192.168.1.192127
192.168.1.224/27
骨干链路--1段地址 ---划分6段---192.168.1.0/27 192.168.1.0/30
192.168.1.4/30
192.168.1.8/30
192.168.112/30
192.168.1.16/30
182.168.1.20/30
192.168.1.24/30---不用
192.168.1.28/30
R1的环回--1段地址---划分2段---192.168.1.32/27
192.168.1.32/28 192.168.1.48/28
R2的环回--1段地址---划分2段---192.168.1.64/27 192.168.1.64/28 192.168.1.80/28
R3的环回--1段地址---划分2段---192.168.1.96/27
192.168.1.96/28 192.168.1.112/28
R4的环回--1段地址---划分2段---192.168.1.128/27
192.168.1.128/28
192.168.1.144/28
第二步:r1-r5的接口IP
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.21 30
r2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
r3
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.22 30
[r3]interface GigabitEthernet 0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.17 30
r4
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r4]interface GigabitEthernet 0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.18 30
[r4]interface GigabitEthernet 0/0/2
[r4-GigabitEthernet0/0/2]ip address 192.168.1.13 30
[r4]interface GigabitEthernet 4/0/0
[r4-GigabitEthernet4/0/0]ip address 192.168.1.9 30
r5
[r5]interface GigabitEthernet 0/0/1
[r5-GigabitEthernet0/0/1]ip address 192.168.1.10 30
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.14 30
第三步:r1-r5的环回地址
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 192.168.1.33 28
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 192.168.1.49 28
r2环回
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 192.168.1.65 28
[r2]interface LoopBack 1
[r2-LoopBack1]ip address 192.168.1.81 28
r3环回
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 192.168.1.97 28
[r3]interface LoopBack 1
[r3-LoopBack1]ip address 192.168.1.113 28
r4环回
[r4]interface LoopBack 0
[r4-LoopBack0]ip address 192.168.1.129 28
[r4]interface LoopBack 1
[r4-LoopBack1]ip address 192.168.1.145 28
r5环回
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 5.5.5.5 24
排错:
<r1>display ip interface brief 查看配置
<r1>display ip routing-table 查看路由表
第四步:配置静态路由
r1配置静态路由
[r1]ip route-static 192.168.1.4 30 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.22
[r1]ip route-static 192.168.1.16 30 192.168.1.22
[r1]ip route-static 192.168.1.12 30 192.168.1.22
[r1]ip route-static 192.168.1.12 30 192.168.1.2
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.22
[r1]ip route-static 192.168.1.128 27 192.168.1.22
[r1]ip route-static 192.168.1.128 27 192.168.1.2
r2的静态路由
ip route-static 192.168.1.20 255.255.255.252 192.168.1.1
ip route-static 192.168.1.8 255.255.255.252 192.168.1.6
ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
ip route-static 192.168.1.16 255.255.255.252 192.168.1.6
ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
ip route-static 192.168.1.96 255.255.255.224 192.168.1.1
ip route-static 192.168.1.96 255.255.255.224 192.168.1.6
ip route-static 192.168.1.128 255.255.255.224 192.168.1.6
r3的静态路由
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21
ip route-static 192.168.1.8 255.255.255.252 192.168.1.18
ip route-static 192.168.1.12 255.255.255.252 192.168.1.18
ip route-static 192.168.1.4 255.255.255.252 192.168.1.18
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21
ip route-static 192.168.1.64 255.255.255.224 192.168.1.18
ip route-static 192.168.1.128 255.255.255.224 192.168.1.18
r4的静态路由
ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
ip route-static 192.168.1.20 255.255.255.252 192.168.1.17
ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
ip route-static 192.168.1.32 255.255.255.224 192.168.1.17
ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
ip route-static 192.168.1.96 255.255.255.224 192.168.1.17
r5的静态路由
ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
ip route-static 192.168.1.4 255.255.255.252 192.168.1.9
ip route-static 192.168.1.16 255.255.255.252 192.168.1.9
ip route-static 192.168.1.20 255.255.255.252 192.168.1.9
ip route-static 192.168.1.0 255.255.255.252 192.168.1.13
ip route-static 192.168.1.4 255.255.255.252 192.168.1.13
ip route-static 192.168.1.16 255.255.255.252 192.168.1.13
ip route-static 192.168.1.20 255.255.255.252 192.168.1.13
ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
ip route-static 192.168.1.64 255.255.255.224 192.168.1.9
ip route-static 192.168.1.96 255.255.255.224 192.168.1.9
ip route-static 192.168.1.128 255.255.255.224 192.168.1.9
第五步:r1-r4写缺省路由
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.22
[r2]ip route-static 0.0.0.0 0 192.168.1.6
[r3]ip route-static 0.0.0.0 0 192.168.1.18
[r4]ip route-static 0.0.0.0 0 192.168.1.10
[r4]ip route-static 0.0.0.0 0 192.168.1.14
r1访问r5
第六步:空接口防环路由
[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r3]ip route-static 192.168.1.96 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0
第七步:链路通信
修改r4-r5之间的百兆链路的优先级
[r4]ip route-static 0.0.0.0 0 192.168.1.14 preference 80
此时正常通信时走的是1000M链路
故障时走100M链路
关闭G4/0/0接口
[r4]interface GigabitEthernet 4/0/0
[r4-GigabitEthernet4/0/0]shutdown
打开G4/0/0接口
[r4-GigabitEthernet4/0/0]undo shutdown