浮动路由
浮动路由指的是配置两条静态路由,默认选取链路质量优(带宽大的)作为主路径,当路径出现故障时,由带宽较小的备份路由顶替,保持网络的不中断
浮动路由的地址是默认不显示的,只有主路径失效时,该路径才显示
例题:
R1:
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]user-interface console 0
[R1-ui-console0]idle-timeout 0 0
[R1-ui-console0]quit
[R1]int e0/0/0
[R1-Ethernet0/0/0]ip add 10.1.3.1 24
[R1-Ethernet0/0/0]undo shut
Info: Interface Ethernet0/0/0 is not shutdown.
[R1-Ethernet0/0/0]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R1-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]int loop 0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]quit
[R1]ip route-static 0.0.0.0 0.0.0.0 10.1.3.2 preference 61
静态路由优先级是60,preference设置比60大即可
R2:
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]user-interface console 0
[R2-ui-console0]idle-timeout 0 0
[R2-ui-console0]quit
[R2]int e0/0/0
[R2-Ethernet0/0/0]ip add 10.1.3.2 24
[R2-Ethernet0/0/0]undo shut
Info: Interface Ethernet0/0/0 is not shutdown.
[R2-Ethernet0/0/0]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
[R2-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]int loop 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]quit
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.1.2.2 24
[R2-GigabitEthernet0/0/1]undo shut
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R2-GigabitEthernet0/0/1]quit
[R2]ip route-static 1.1.1.1 32 10.1.3.1 preference 61
R3:
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]user-interface console 0
[R3-ui-console0]idle-timeout 0 0
[R3-ui-console0]quit
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.1.2.3 24
[R3-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R3-GigabitEthernet0/0/0]int loop 0
[R3-LoopBack0]ip add 3.3.3.3 32
[R3-LoopBack0]quit
命令输入完成后开始验证:
R1:
Int g0/0/0
Shutdown
Quit
Display ip routing-table
手动shutdown该链路,测试是否显示备选路由
0.0.0.0/0 Static 61 0 RD 10.1.3.2 Ethernet0/0/0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.1.3.0/24 Direct 0 0 D 10.1.3.1 Ethernet0/0/0
10.1.3.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0