实验要求:
1.除R5的环回地址固定以外,整个其它所有网段基于192.168.1.0/24进行合理的IP地址划分
2.R1-R4每个路由器存在两个环回接口,用于模拟PC网段;地址也在192.168.1.0/24这个网络上
3.R1-R4上不能直接编写到达5.5.5.0/24的静态路由,但依然可以访问
4.全网可达,尽量减少每台路由器,路由表条目数量,避免环路出现
5.R4与R5间,正常1000M链路通信,故障时自动改为100M
实验过程
AR1
更改路由器名称
<Huawei>system-viem
[Huawei]sysname r1
给接口配IP
[r1]int GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r1-GigabitEthernet0/0/0]qu
[r1-GigabitEthernet0/0/1]ip address 192.168.1.14 30
配置缺省路由
[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.13
配置环回地址
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 192.168.1.33 28
[r1-LoopBack1]qu
[r1]interface LoopBack 2
[r1-LoopBack2]ip address 192.168.1.49 28
[r1-LoopBack2]qu
配置空接口
[r1]ip route-static 192.168.1.32 27 null 0
向路由表添加路径
[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.13
[r1]ip route-static 192.168.1.128 27 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.13
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.16 30 192.168.1.2
[r1]ip route-static 192.168.1.12 30 192.168.1.2
[r1]ip route-static 192.168.1.12 30 192.168.1.13
[r1]ip route-static 192.168.1.16 30 192.168.1.13
[r1]ip route-static 192.168.1.8 30 192.168.1.13
AR2
更改路由器名称
<Huawei>system-viem
[Huawei]sysname r2
给接口配IP
[r2]int GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2-GigabitEthernet0/0/0]qu
[r2-GigabitEthernet0/0/1]ip address 192.168.1.8 30
配置缺省路由
[r2]ip route-static 0.0.0.0 0 192.168.1.10
配置环回地址
[r2]interface LoopBack 1
[r2-LoopBack1]ip address 192.168.1.65 28
[r2-LoopBack1]qu
[r2]interface LoopBack 2
[r2-LoopBack2]ip address 192.168.1.81 28
[r2-LoopBack2]qu
配置空接口
[r2]ip route-static 192.168.1.64 27 null 0
向路由表添加路径
[r2]ip route-static 192.168.1.32 27 192.168.1.2
[r2]ip route-static 192.168.1.96 27 192.168.1.2
[r2]ip route-static 192.168.1.96 27 192.168.1.5
[r2]ip route-static 192.168.1.128 27 192.168.1.5
[r2]ip route-static 192.168.1.4 30 192.168.1.2
[r2]ip route-static 192.168.1.10 30 192.168.1.5
[r2]ip route-static 192.168.1.16 30 192.168.1.5
[r2]ip route-static 192.168.1.20 30 192.168.1.5
AR3
更改路由器名称
<Huawei>system-viem
[Huawei]sysname r3
给接口配IP
[r3]int GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[r3-GigabitEthernet0/0/0]qu
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
配置缺省路由
[r3]ip route-static 0.0.0.0 0 192.168.1.14
配置环回地址
[r3]interface LoopBack 1
[r3-LoopBack1]ip address 192.168.1.97 28
[r3-LoopBack1]qu
[r3]interface LoopBack 2
[r3-LoopBack2]ip address 192.168.1.113 28
[r3-LoopBack2]qu
配置空接口
[r3]ip route-static 192.168.1.96 27 null 0
向路由表添加路径
[r3]ip route-static 192.168.1.32 27 192.168.1.10
[r3]ip route-static 192.168.1.64 27 192.168.1.10
[r3]ip route-static 192.168.1.64 27 192.168.1.13
[r3]ip route-static 192.168.1.128 27 192.168.1.13
[r3]ip route-static 192.168.1.0 30 192.168.1.10
[r3]ip route-static 192.168.1.8 30 192.168.1.13
[r3]ip route-static 192.168.1.16 30 192.168.1.13
[r3]ip route-static 192.168.1.20 30 192.168.1.13
AR4
更改路由器名称
<Huawei>system-viem
[Huawei]sysname r4
给接口配IP
[r4]int GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r4-GigabitEthernet0/0/0]qu
[r4-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[r4-GigabitEthernet0/0/1]qu
[r4]int GigabitEthernet 0/0/2
[r4-GigabitEthernet0/0/2]ip address 192.168.1.21 30
[r4-GigabitEthernet0/0/2]qu
[r4-GigabitEthernet2/0/0]ip address 192.168.1.17 30
配置缺省路由
[r4]ip route-static 0.0.0.0 0 192.168.1.18
配置环回地址
[r4]interface LoopBack 1
[r4-LoopBack1]ip address 192.168.1.129 28
[r4-LoopBack1]qu
[r4]interface LoopBack 2
[r4-LoopBack2]ip address 192.168.1.145 28
[r4-LoopBack2]qu
配置空接口
[r4]ip route-static 192.168.1.128 27 null 0
向路由表添加路径
[r4]ip route-static 192.168.1.32 27 192.168.1.6
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.96 27 192.168.1.9
[r4]ip route-static 192.168.1.64 27 192.168.1.6
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.4 30 192.168.1.6
AR5
更改路由器名称
<Huawei>system-viem
[Huawei]sysname r5
给接口配IP
[r5]int GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.22 30
[r5-GigabitEthernet0/0/0]qu
[r5-GigabitEthernet0/0/1]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/1]qu
配置环回地址
[r4]interface LoopBack 1
[r4-LoopBack1]ip address 5.5.5.5 24
[r4-LoopBack1]qu
向路由表添加路径
[r5]ip route-static 192.168.1.32 27 192.168.1.21
[r5]ip route-static 192.168.1.64 27 192.168.1.21
[r5]ip route-static 192.168.1.96 27 192.168.1.21
[r5]ip route-static 192.168.1.128 27 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.21
[r5]ip route-static 192.168.1.4 30 192.168.1.21
[r5]ip route-static 192.168.1.8 30 192.168.1.21
[r5]ip route-static 192.168.1.12 30 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.17 preference 70
[r5]ip route-static 192.168.1.4 30 192.168.1.17 preference 70
[r5]ip route-static 192.168.1.8 30 192.168.1.17 preference 70
[r5]ip route-static 192.168.1.12 30 192.168.1.17 preference 70
[r5]ip route-static 192.168.1.32 27 192.168.1.17 preference 70
[r5]ip route-static 192.168.1.64 27 192.168.1.17 preference 70
[r5]ip route-static 192.168.1.96 27 192.168.1.17 preference 70
[r5]ip route-static 192.168.1.128 27 192.168.1.17 preference 70