1. 概述:
浮动静态路由是通过配置去往同一网段,但优先级不同的静态路由,保证在网络中优先级较高的路由(即主路由)失效的情况下,提供备份路由。备份路由一般不会出现在路由表中。只有主链路失效时,浮动路由才会浮出来。
2. 实验拓扑
3. 实验要求
网络互通;
采用静态路由实现PC1与PC2链路冗余负载均衡;
PC1与PC2之间通信时,采用浮动静态路由实现。链路pc1-R2-R3-pc2为主链路,另一条为备份链路。
4. 配置思路
规划网段配置相应地址
配置主链路静态路由
配置浮动路由实现备份
配置负载均衡
基本配置
#R1
system-view
[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]undo shutdown
[Huawei-Ethernet0/0/0]ip add 10.1.1.2 24
[Huawei-Ethernet0/0/0]quit
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei-Ethernet0/0/1]ip add 192.168.10.254 24
[Huawei-Ethernet0/0/1]quit
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]undo shutdown
[Huawei-GigabitEthernet0/0/0]ip add 10.3.3.1 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]
#R2
system-view
[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]undo shutdown
[Huawei-Ethernet0/0/0]ip add 10.1.1.1 24
[Huawei-Ethernet0/0/0]quit
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]undo shutdown
[Huawei-Ethernet0/0/1]ip add 10.2.2.1 24
[Huawei-Ethernet0/0/1]quit
#R3
system-view
[Huawei]sysname R3
[R3]int e0/0/0
[R3-Ethernet0/0/0]undo shutdown
[R3-Ethernet0/0/0]ip add 10.2.2.2 24
[R3-Ethernet0/0/0]int e0/0/1
[R3-Ethernet0/0/1]undo shutdown
[R3-Ethernet0/0/1]ip add 192.168.20.254 24
[R3-Ethernet0/0/1]int g0/0/0
[R3-GigabitEthernet0/0/0]undo shutdown
[R3-GigabitEthernet0/0/0]ip add 10.3.3.2 24
[R3-GigabitEthernet0/0/0]quit
配置主链路静态路由
#R1
[Huawei]ip route-static 192.168.20.0 24 10.3.3.2
#R2
[Huawei]ip route-static 192.168.10.0 24 10.1.1.2
[Huawei]ip route-static 192.168.20.0 24 10.2.2.2
#R3
[Huawei]ip route-static 192.168.10.0 24 10.3.3.1
配置备份链路
#R1
[R1]ip route-static 192.168.20.0 24 10.1.1.1 preference 100 //优先级默认为60
#R3
[R3]ip route-static 192.168.20.0 24 10.2.2.1 preference 100
在R1上查看静态路由的路由信息
路由显示到目的地址pc2有两条优先级为60和100的静态路由.
然后关闭路由器R1的接口g/0/0/0,测试备份链路
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]shutdown
配置负载均衡
#R1
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]undo shutdown
[R1]ip route-static 192.168.20.0 255.255.255.0 10.1.11
R3
[R3]ip route-static 192.168.10.0 255.255.255.0 10.2.2.1
查看R1路由表
看到去往192.168.20.0网段有两条不同吓一跳的路由条目,及实现负载均衡。
华为协议默认优先级: