ensp通过修改优先级配置路由负载均衡

做两条路由,一条用做主路由,一条是备用路由,通过修改路由的优先级选定需要的作为主路由的路由条目。
路由的优先级为越小越优先
在这里插入图片描述

该拓扑主要是使用静态路由实现全网互通。PC1可以ping通PC2、PC3、PC4,反之也是一样。交换机不做配置。主要在路由上做配置。
这里讲述路由的负载均衡
AR1:

sys
sys R1
int G0/0/0
ip add 1.0.0.254 24
int G0/0/1
ip add 12.0.0.1 24
int G0/0/2
ip add 21.0.0.1 24

ip route-s 0.0.0.0 0 12.0.0.2
ip route-s 0.0.0.0 0 21.0.0.2  preference  61  // 这里使用缺省路由的形式,把去往23.0.0.2为下一跳的路由优先级修改为61

AR2:

sys
sys R2
int G0/0/1
ip add 12.0.0.2 24
int G0/0/2
ip add 21.0.0.2 24
int G0/0/0
ip add 23.0.0.2 24
int G0/0/3
ip add 32.0.0.2 24

ip route-s 1.0.0.0 24 12.0.0.1
ip route-s 1.0.0.0 24 21.0.0.1 preference 61 //设置为备用路由
ip route-s 3.0.0.0 24 23.0.0.3
ip route-s 3.0.0.0 24 32.0.0.3 preference 61 //设置为备用路由

AR3

sys
sys R3
int G0/0/0
ip add 23.0.0.3 24
int G0/0/3
ip add 32.0.0.3 24
int G0/0/1
ip add 3.0.0.254 24
ip route-s 1.0.0.0 24 23.0.0.2
ip route-s 1.0.0.0 24 32.0.0.2 preference 61 //设置该路由为备用路由

使用命令dis ip routing-table protocol static 查看AR1的静态路由协议状态,显示该条路由是不活跃没有起来的,只有另一条down之后才会起来,可以看到把优先值修改之后这条路由是不在活动里面的。
在这里插入图片描述
其他两个路由器使用同样的命令查看也是这样。
当把AR1的G0/0/1关掉之后,备用路由就会起来了

[R1-GigabitEthernet0/0/1]shutdown   //关闭端口

使用命令dis ip routing-table protocol static查看,可以看到之前没有启用的路由条目活跃了,而被down掉的接口的路由则没有活跃。
在这里插入图片描述

  • 2
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值