目录
一、实验目的
二、需求分析
三、实验步骤
1. 更改设备名称
2. 分配IP地址、环回IP地址
3. 配置路由
① R1配置路由信息
② R2配置路由信息
③ R3配置路由信息
④ R4配置路由信息
⑤ R5配置路由信息
四、测试
通过配置路由使如图拓扑全网可达
1. 除R5的环回地址固定以外,整个其他所有网段基于192.168.1.0/24进行合理的IP地址划分;
2. R1-R4每个路由器存在两个环回接口,用于模拟连接PC网段;地址也在192.168.1.0/24这个网络范围内;
6个骨干链路 + 8个环回接口 = 14网段
子网划分:192.168.1.0/24划分成16个网段,用14个,两个保留;
192.168.1.00000000
R1-R2:192.168.1.00000000 192.168.1.0/28
R2-R4:192.168.1.00010000 192.168.1.16/28 手工汇总:192.168.1.0/27
R1-R3:192.168.1.00100000 192.168.1.32/28
R3-R4:192.168.1.00110000 192.168.1.48/28 手工汇总:192.168.1.32/27
R1-R2、R2-R3、R1-R3、R3-R4手工汇总:192.168.1.0/26
R1环回:
192.168.1.01000000 192.168.1.64/28
192.168.1.01010000 192.168.1.80/28 手工汇总:192.168.1.64/27
R2环回:
192.168.1.01100000 192.168.1.96/28
192.168.1.01110000 192.168.1.112/28 手工汇总:192.168.1.96/27
R1环回、R2环回手工汇总:192.168.1.64/26
R3环回:
192.168.1.10000000 192.168.1.128/28
192.168.1.10010000 192.168.1.144/28 手工汇总:192.168.1.128/27
R4环回:
192.168.1.10100000 192.168.1.160/28
192.168.1.10110000 192.168.1.176/28 手工汇总:192.168.1.160/27
R3环回、R4环回手工汇总:192.168.1.128/26
R4-R5
1000M:192.168.1.11000000 192.168.1.192/28
100M:192.168.1.11010000 192.168.1.208/28
保留:
192.168.1.11100000 192.168.1.224/28
192.168.1.11110000 192.168.1.240/28
这这样配的好处是很好的减少了路由黑洞的产生,基本如果设备不出问题不会产生黑洞。
地址分配图:
3. R1-R4上不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问;
通过缺省路由进行访问;如:[R1]ip route-static 0.0.0.0 0 192.168.1.2
4. 全网可达,尽崖减少每台路由器,路由表条曰数量,避免环路出现;
全网可达就是要保证在任意一个网段都可以和其他所有的网段进行通信,既路由表中应该包含除自己直连自动产生的条目以外,自己手工添加其他所有不是直连的网段。减少路由条目,就是要使用手工汇总,所以在划分网段的过程中就应该考虑汇总问题。缺省路由遇到路由黑洞,将百分百出环,所以为避免环路,配置空接口路由:[R1]ip route-static 192.168.1.64 27 NULL 0
R1共13条静态路由(包含负载均衡):手工汇总AR2、AR3、AR4的环回接口网段;
R2共10条静态路由(包含负载均衡):手工汇总AR1、AR3、AR4的环回接口网段;
R3共10条静态路由(包含负载均衡):手工汇总AR1、AR2、AR4的环回接口网段;
R4共9条静态路由(包含负载均衡):手工汇总AR1、AR2、AR3的环回接口网段;
R5共8条静态路由:R1环回、R2环回手工汇总、R3环回、R4环回手工汇总,R1-R2、R2-R3手工汇总、R1-R3、R3-R4手工汇总。
5. R4与R5间,正常1000M链路通信,故障时自动改为100M。
设置到达5.5.5.0/24网段1000M网段、100M网段(优先级61)的路由优先级
[R4]ip route-static 0.0.0.0 0 192.168.1.194
[R4]ip route-static 0.0.0.0 0 192.168.1.210 preference 61
[Huawei]sysname R1/R2/R3/R4/R5
① R1:
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 28
[R1-GigabitEthernet0/0/1]ip address 192.168.1.33 28
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.65 28
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.81 28
② R2:
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 28
[R2-GigabitEthernet0/0/1]ip address 192.168.1.17 28
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 192.168.1.97 28
[R2]interface LoopBack 1
[R2-LoopBack1]ip address 192.168.1.113 28
③ R3:
[R3-GigabitEthernet0/0/0]ip address 192.168.1.34 28
[R3-GigabitEthernet0/0/1]ip address 192.168.1.49 28
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 192.168.1.129 28
[R3]interface LoopBack 1
[R3-LoopBack1]ip address 192.168.1.145 28
④ R4:
[R4-GigabitEthernet0/0/0]ip address 192.168.1.50 28
[R4-GigabitEthernet0/0/1]ip address 192.168.1.18 28
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 192.168.1.161 28
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 192.168.1.177 28
[R4-GigabitEthernet0/0/2]ip address 192.168.1.193 28
[R4-GigabitEthernet4/0/0]ip address 192.168.1.209 28
⑤ R5:
[R5-GigabitEthernet0/0/0]ip address 192.168.1.194 28
[R5-GigabitEthernet0/0/1]ip address 192.168.1.210 28
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 5.5.5.1 24
[R1]ip route-static 192.168.1.16 28 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.2
[R1]ip route-static 192.168.1.48 28 192.168.1.34
[R1]ip route-static 192.168.1.128 27 192.168.1.34
[R1]ip route-static 192.168.1.160 27 192.168.1.2
[R1]ip route-static 192.168.1.160 27 192.168.1.34
使用空接口路由避免环路产生:
[R1]ip route-static 192.168.1.64 27 NULL 0
不能直接编写到达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.34
设置R4-R5之间1000M网段、100M网段(优先级61)的路由
[R1]ip route-static 192.168.1.192 28 192.168.1.2
[R1]ip route-static 192.168.1.192 28 192.168.1.34
[R1]ip route-static 192.168.1.208 28 192.168.1.2
[R1]ip route-static 192.168.1.208 28 192.168.1.34
[R2]ip route-static 192.168.1.32 28 192.168.1.1
[R2]ip route-static 192.168.1.64 27 192.168.1.1
[R2]ip route-static 192.168.1.48 28 192.168.1.18
[R2]ip route-static 192.168.1.160 27 192.168.1.18
[R2]ip route-static 192.168.1.128 27 192.168.1.1
[R2]ip route-static 192.168.1.128 27 192.168.1.18
[R2]ip route-static 192.168.1.192 28 192.168.1.18
[R2]ip route-static 192.168.1.208 28 192.168.1.18
[R2]ip route-static 0.0.0.0 0 192.168.1.18
[R2]ip route-static 192.168.1.96 27 NULL 0
[R3]ip route-static 192.168.1.0 28 192.168.1.33
[R3]ip route-static 192.168.1.64 27 192.168.1.33
[R3]ip route-static 192.168.1.16 28 192.168.1.50
[R3]ip route-static 192.168.1.160 27 192.168.1.50
[R3]ip route-static 192.168.1.96 27 192.168.1.33
[R3]ip route-static 192.168.1.96 27 192.168.1.50
[R3]ip route-static 192.168.1.192 28 192.168.1.50
[R3]ip route-static 192.168.1.208 28 192.168.1.50
[R3]ip route-static 0.0.0.0 0 192.168.1.50
[R3]ip route-static 192.168.1.128 27 NULL 0
[R4]ip route-static 192.168.1.0 28 192.168.1.17
[R4]ip route-static 192.168.1.96 27 192.168.1.17
[R4]ip route-static 192.168.1.32 28 192.168.1.49
[R4]ip route-static 192.168.1.128 27 192.168.1.49
[R4]ip route-static 192.168.1.64 27 192.168.1.17
[R4]ip route-static 192.168.1.64 27 192.168.1.49
[R4]ip route-static 192.168.1.160 27 NULL 0
设置到达5.5.5.0/24网段1000M网段、100M网段(优先级61)的路由优先级
[R4]ip route-static 0.0.0.0 0 192.168.1.194
[R4]ip route-static 0.0.0.0 0 192.168.1.210 preference 61
[R5]ip route-static 192.168.1.0 27 192.168.1.193
[R5]ip route-static 192.168.1.0 27 192.168.1.209 preference 61
[R5]ip route-static 192.168.1.32 27 192.168.1.193
[R5]ip route-static 192.168.1.32 27 192.168.1.209 preference 61
[R5]ip route-static 192.168.1.64 26 192.168.1.193
[R5]ip route-static 192.168.1.64 26 192.168.1.209 preference 61
[R5]ip route-static 192.168.1.128 26 192.168.1.193
[R5]ip route-static 192.168.1.128 26 192.168.1.209 preference 61
① 全网可达
② 正常1000M链路通信,故障时自动改为100M