一.实验拓扑
二.实验需求
1.除了R5的环回地址固定5.5.5.0/24,其他网段基于192.168.1.0/24进行合理划分;
2.R1-R4每个路由器存在两个环回接口,模拟PC,地址也在192.168.1.0/24网络内;
3.R1-R4不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问;
4.全网可达,尽量减少每台路由器路由条目数量,避免环路;
5.R3与R5间,正常1000M链路通信,故障时自动改为100M;
三.实验分析、思路及步骤
1.先配置IP地址,为了节省IP地址,所以在划分网段时,用在划分第一个的网段下继续划分第二个网段的方法
划分6条骨干线路192.168.1.0000 0000——192.168.1.0/27
192.168.1.0000 0000---192.168.1.0/30(R1与R2间的网段)
192.168.1.0000 0100---192.168.1.4/30(R2与R3间的网段)
192.168.1.0000 1000---192.168.1.8/30(R3与R4间的网段)
192.168.1.0000 1100---192.168.1.12/30(R4与R1间的网段)
192.168.1.0001 0000---192.168.1.16/30(R4与R5间1000M的网段)
192.168.1.0001 0100---192.168.1.20/30(R4与R5间100M的网段)
(多余的网段留着备用)
192.168.1.0001 1000---192.168.1.24/30
192.168.1.0001 1100---192.168.1.28/3
2.配置环回ip
(1)划分R1环回
192.168.1.0010 0000-----192.168.1.32/27
192.168.1.0010 0000---192.168.1.32/28----L0
192.168.1.0011 0000---192.168.1.48/28---L1
(2)划分R2环回
192.168.1.0100 0000-----192.168.1.64/27
192.168.1.0100 0000----192.168.1.64/28----L0
192.168.1.0101 0000---192.168.1.80/28-----L1
(3)划分R3环回
192.168.1.0110 0000-----192.168.1.96/27
192.168.1.0110 0000----192.168.1.96/28----L0
192.168.1.0111 0000----192.168.1.112/28----L1
(4)划分R4环回
192.168.1.1000 0000-----192.168.1.128/27
192.168.1.1000 0000----192.168.1.128/28---L0
192.168.1.1001 0000----192.168.1.144/28---L1
3.配置静态路由,保证全网可通。为了减少路由条目数量,配置静态路由的环回时,目标网段是路由环回的汇总
R1环回汇总:192.168.1.32/27
R2环回汇总:192.168.1.64/27
R3环回汇总:192.168.1.96/27
R4环回汇总:192.168.1.128/27
4.因为不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问,所以需要配置缺省路由,保证全网可达
5.因为在路由器中做了网段汇总,可能会出现黑洞或环路,所以要配置防环机制
6.R3与R5间,正常1000M链路通信,故障时自动改为100M,所以要配置浮动路由
四.实验步骤操作
1.接口IP配置
[R1]interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]ip address192.168.1.13 30
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[R3]interface GigabitEthernet0/0/01
[R3-GigabitEthnet0/0/1]ip address 192.168.1.6 30
[R3-GigabitEthernet0/0/1]interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.9 30
[R3-GigabitEthernet0/0/0]interface GigabitEthernet0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R3-GigabitEthernet0/0/2]interface GigabitEthernet4/0/0
[R3-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[R5]interface GigabitEthernet0/0/0
[R2Rint5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.22
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/1]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.14 30
2.环回ip配置
[R1]interface LoopBack0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]interface LoopBack1
[R1-LoopBack]ip address 192.168.1.49 28
[R2]interface LoopBack0
[R2-LoopBack0]ip address 192.168.1.64 28
[R2-LoopBack0]interface LoopBack1
[R2-LoopBack1]ip address 192.168.1.81 28
[R3]interface LoopBack0
[R3-LoopBack0]ip address 192.168.1.97 28
[R3-LoopBack0]interface LoopBack1
[R3-LoopBack1]ip address 192.168.1.113 28
[R4]interface LoopBack0
[R4-LoopBack0]ip address 192.168.1.129 28
[R4-LoopBack0]interface LoopBack1
[R4-LoopBack1]ip address 192.168.1.145 28
[R5]interface LoopBack0
[R5-LoopBack0]ip address 5.5.5.5 24
3.配置静态路由,实现全网可通,并减少路由条目数量
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.4 30 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.14
[R1]ip route-static 192.168.1.16 30 192.168.1.2
[R1]ip route-static 192.168.1.16 30 192.168.1.14
[R1]ip route-static 192.168.1.20 30 192.168.1.2
[R1]ip route-static 192.168.1.20 30 192.168.1.14
[R1]ip route-static 192.168.1.8 30 192.168.1.14
[R1]ip route-static 192.168.1.128 27 192.168.1.14
[R2]ip route-static 192.168.1.96 27 192.168.1.6
[R2]ip route-static 192.168.1.16 30 192.168.1.6
[R2]ip route-static 192.168.1.20 30 192.168.1.6
[R2]ip route-static 192.168.1.8 30 192.168.1.6
[R2]ip route-static 192.168.1.128 27 192.168.1.6
[R2]ip route-static 192.168.1.128 27 192.168.1.1
[R2]ip route-static 192.168.1.12 30 192.168.1.1
[R2]ip route-static 192.168.1.32 27 192.168.1.1
[R3]ip route-static 192.168.1.128 27 192.168.1.10
[R3]ip route-static 192.168.1.12 30 192.168.1.10
[R3]ip route-static 192.168.1.32 27 192.168.1.10
[R3]ip route-static 192.168.1.32 27 192.168.1.5
[R3]ip route-static 192.168.1.0 30 192.168.1.5
[R3]ip route-static 192.168.1.64 27 192.168.1.5
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.0 30 192.168.1.13
[R4]ip route-static 192.168.1.64 27 192.168.1.13
[R4]ip route-static 192.168.1.64 27 192.168.1.9
[R4]ip route-static 192.168.1.4 30 192.168.1.9
[R4]ip route-static 192.168.1.96 27 192.168.1.9
[R4]ip route-static 192.168.1.16 30 192.168.1.9
[R4]ip route-static 192.168.1.20 30 192.168.1.9
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.21
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.21
[R5]ip route-static 192.168.1.128 27 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.21
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.21
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.21
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.21
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.21
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.21
4.因为不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问,所以需要配置缺省路由
[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.14
[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
[R3]ip route-static 0.0.0.0 0 192.168.1.22
[R4]ip route-static 0.0.0.0 0 192.168.1.9
5.配置防环机制
[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
6.配置浮动路由,更改路由优先级
[R3]ip route-static 0.0.0.0 0 192.168.1.22 preference 66(>60)
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 66 (>60)
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 66 (>60)
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 66 (>60)
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 66 (>60)
[R5]ip route-static 192.168.1.32 27 192.168.1.21 preference 66 (>60)
[R5]ip route-static 192.168.1.64 27 192.168.1.21 preference 66 (>60)
[R5]ip route-static 192.168.1.96 27 192.168.1.21 preference 66 (>60)
[R5]ip route-static 192.168.1.128 27 192.168.1.21 preference 66 (>60)
五.测试
1.测试全网通
[R1]ping 5.5.5.5
[R1]tracert 5.5.5.5
2.测试当1000M链路故障时,能否全网通
[R3-GigabitEthernet0/0/2]shutdown //关闭1000M链路
[R1]ping 5.5.5.5
[R1]tracert 5.5.5.5