静态路由、负载分担、备用链路
一、静态路由
1.1路由器基本配置
1.2静态路由配置
1.3主机间互通验证
二、负载分担
2.1接入serial接口
2.2负载分担配置
2.3检测新链路是否连通
三、备用链路
3.1备用链路配置
3.2验证备用链路连通
一、静态路由
静态路由是一种路由的方式,路由项由手动配置,而非动态决定。静态路由不会改变,即使网络状况已经改变或是重新被组态。一般来说,静态路由是由网络管理员逐项加入路由表。
要求:通过静态路由使得PC1、PC2、PC3互通
1.1路由器基本配置
AR1:
<Huawei>sys
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip a 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip a 10.1.1.1 24
[R1-GigabitEthernet0/0/1]q
AR2:
<Huawei>sys
[Huawei]sysname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip a 192.168.2.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip a 10.1.1.2 24
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip a 20.1.1.2 24
[R2-GigabitEthernet0/0/2]q
AR3:
<Huawei>sys
[Huawei]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip a 192.168.3.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip a 20.1.1.3 24
[R3-GigabitEthernet0/0/1]q
1.2静态路由配置
静态路由的配置基本格式为:
[route]ip route-static 目的地址网段 子网掩码 下一跳IP地址
对应此实验的配置命令如下:
AR1:
[R1]ip route-static 192.168.2.0 24 10.1.1.2
[R1]ip route-static 20.1.1.0 24 10.1.1.2
[R1]ip route-static 192.168.3.0 24 10.1.1.2
AR2:
[R2]ip route-static 192.168.1.0 24 10.1.1.1
[R2]ip route-static 192.168.3.0 24 20.1.1.3
AR3:
[R3]ip route-static 192.168.2.0 24 20.1.1.2
[R3]ip route-static 10.1.1.0 24 20.1.1.2
[R3]ip route-static 192.168.1.0 24 20.1.1.2
1.3主机间互通验证
PC1
PC2
PC3
二、负载分担
由不少于2条链路传输数据,多链路分担传输压力。
要求:AR1与AR2之间串行链路负载分担
2.1接入serial接口
对Route路由器鼠标右键,选择“设置”,选择“2SA”接口卡,拖拽至路由器接口处
2.2负载分担配置
除多了一条Serial链路,拓扑图与上述静态路由相同,基本配置不再重复,参考上述配置命令
Serial链路配置负载分担,与配置静态路由的配置命令相同
AR1:
[R1]int Serial 1/0/0
[R1-Serial1/0/0]ip a 12.1.1.1 24
[R1-Serial1/0/0]q
[R1]ip route-static 192.168.2.0 24 12.1.1.2
[R1]ip route-static 20.1.1.0 24 12.1.1.2
[R1]ip route-static 192.168.3.0 24 12.1.1.2
AR2:
[R2]int Serial 2/0/0
[R2-Serial2/0/0]ip a 12.1.1.2 24
[R2-Serial2/0/0]q
[R2]ip route-static 192.168.1.0 24 12.1.1.1
AR3:
[R3]ip route-static 12.1.1.0 24 20.1.1.2
2.3检测新链路是否连通
PC1
PC2
PC3
三、备用链路
在Route路由器间串连一条备用链路,与负载分担不同,备用链路在正常情况下不会与主链路同时运作,只有在主链路断开时,备用链路才会运行。
3.1备用链路配置
除AR2与AR3之间的Serial链路,其余拓扑配置与上述负载分担拓扑配置相同
配置格式[route]ip route-static 目的地址网段 子网掩码 下一跳IP地址 preference 优先级值
网关默认优先级值为60,且值越小优先级越高,故备用链路的优先级数需大于60
AR1:
[R1]ip route-static 23.1.1.0 24 10.1.1.2 preference 80
[R1]ip route-static 23.1.1.0 24 12.1.1.2 preference 80
AR2:
[R2]int Serial 2/0/1
[R2-Serial2/0/1]ip a 23.1.1.2 24
[R2-Serial2/0/1]q
[R2]ip route-static 192.168.3.0 24 23.1.1.3 preference 80
AR3:
[R3]int Serial 3/0/1
[R3-Serial3/0/1]ip a 23.1.1.3 24
[R3-Serial3/0/1]q
[R3]ip route-static 192.168.1.0 24 23.1.1.2 preference 80
[R3]ip route-static 10.1.1.0 24 23.1.1.2 preference 80
[R3]ip route-static 12.1.1.0 24 23.1.1.2 preference 80
[R3]ip route-static 192.168.2.0 24 23.1.1.2 preference 80
3.2验证备用链路连通
首先将AR2与AR3之间GE接口的链路断开
然后主机间相互执行Ping命令
PC1 Ping PC3
PC2 Ping PC3
PC3 Ping PC1与PC2
PC1
PC2
PC3
验证成功!