标题华为ENSP-配置静态路由以及负载均衡
1. 静态路由:
一种路由的方式,路由项由手动配置,而非动态决定。与动态路由不同,静态路由是固定的,不会改变,即使网络状况已经改变或是重新被组态。一般来说,静态路由是由网络管理员逐项加入路由表。
2. 拓扑图
(只需要关注R2、R3)
3. 实验要求
网络互通
采用静态路由实现PC2与PC3链路冗余负载均衡;
PC2与PC3之间通信时,采用浮动静态路由实现。以其中一条链路pc2-R2-R3-pc3为主链路,另一条为备份链路。
4. 配置
①基础配置
R1:
sysname R1
[R1]interface Ethernet0/0/0
[R1-Ethernet0/0/0]ip address 192.168.1.1 24
[R1-Ethernet0/0/0]quit
[R1]interface Serial 0/0/0
[R1-Serial0/0/0]ip address 192.168.10.1 24
R2:
[Huawei]sysname R2
[R2]interface Ethernet0/0/0
[R2-Ethernet0/0/0]ip address 192.168.2.1 24
[R2]interface s
[R2]interface Serial 0/0/0
[R2-Serial0/0/0]ip address 192.168.10.2 24
[R2-Serial0/0/0]interface Serial 0/0/1
[R2-Serial0/0/1]ip address 192.168.20.1 24
[R2-Serial0/0/1]interface Serial 0/0/2
[R2-Serial0/0/2]ip address 192.168.30.1 24
R3:
[Huawei]sysname R3
[R3]interface Ethernet0/0/0
[R3-Ethernet0/0/0]ip address 192.168.3.1 24
[R3-Ethernet0/0/0]quit
[R3]interface Serial 0/0/0
[R3-Serial0/0/0]ip address 192.168.20.2 24
[R3]interface Serial 0/0/1
[R3-Serial0/0/1]ip address 192.168.30.2 24
②配置 (以192.168.20.0/24为主链路)静态路由:
R1:
[R1]ip route-static 192.168.2.0 24 192.168.10.2
[R1]ip route-static 192.168.20.0 24 192.168.10.2
[R1]ip route-static 192.168.30.0 24 192.168.10.2
[R1]ip route-static 192.168.3.0 24 192.168.20.2
[R1]ip route-static 192.168.3.0 24 192.168.30.2
R2:
[R2]ip route-static 192.168.1.0 24 192.168.10.1
[R2]ip route-static 192.168.3.0 24 192.168.20.2
R3:
[R3]ip route-static 192.168.2.0 24 192.168.20.1
[R3]ip route-static 192.168.10.0 24 192.168.20.1
[R3]ip route-static 192.168.1.0 24 192.168.10.1
③配置备份链路:
R2:
[R2]ip route-static 192.168.3.0 24 192.168.30.2 preference 100 //优先级默认为60
R3:
[R3]ip route-static 192.168.2.0 24 192.168.30.1 preference 100 //优先级默认为60
此时路由表配置:
R1:
R2:
从路由表R2中并未查看到下一跳为192.168.30.2的静态路由条目
R3:
5.关闭路由器R2的接口Serial0/0/1,测试备份链路
[R2]interface Serial0/0/1
[R2-Serial0/0/1]shutdown
此时再次查看路由表:
发现备份链路已经出现在路由表!