华为:VRRP

什么是VRRP?

虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP)是由IETF提出的解决局域网中配置静态网关出现单点失效现象的路由协议,1998年已推出正式的RFC2338协议标准。VRRP广泛应用在边缘网络中,它的设计目标是支持特定情况下IP数据流量失败转移不会引起混乱,允许主机使用单路由器,以及及时在实际第一跳路由器使用失败的情形下仍能够维护路由器间的连通性。

在这里插入图片描述
VRRP 的工作过程:
运行VRRP的多个路由器之间通过VRRP报文的交互,从而选择出优先级越高的路由器,作为Master路由器,由此转发数据包。Master路由器,仅仅只有一个,其他路由器称之为backup路由器。
1,VRRP 是值越大,优先级越高。
2,浮动路由的默认值为60,值越小越优先,跟VRRP相反。

下面我们来搭建vrrp的实验,涉及到浮动路由,拓扑如下:

一:sw3配置:

  • sw3配置:这里二层交换的配置比较简单,将各个接口配置类型并划分vlan,允许对应vlan通过
    system-view
    [Huawei]sysname sw3
    [sw3]vlan bat 10 20 //创建vlan 10 ,vlan 20
    [sw3]int e0/0/1
    [sw3-Ethernet0/0/1]p l a //封装接口类型access,并划分vlan 10
    [sw3-Ethernet0/0/1]p d v 10
    [sw3-Ethernet0/0/1]un sh
    Info: Interface Ethernet0/0/1 is not shutdown.
    [sw3-Ethernet0/0/1]dis this //查看当前配置
    在这里插入图片描述
    [sw3-Ethernet0/0/1]int e0/0/2
    [sw3-Ethernet0/0/2]p l a
    [sw3-Ethernet0/0/2]p d v 20 //封装接口类型access,并划分vlan 20
    [sw3-Ethernet0/0/2]un sh
    [sw3-Ethernet0/0/2]dis this //查看当前配置
    在这里插入图片描述
    [sw3-Ethernet0/0/2]int g0/0/1
    [sw3-GigabitEthernet0/0/1]p l t
    [sw3-GigabitEthernet0/0/1]p t a v 10 20 //封装接口类型trunk,并划分vlan 10 20
    [sw3-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [sw3-GigabitEthernet0/0/1]dis this //查看当前配置
    在这里插入图片描述
    [sw3-GigabitEthernet0/0/1]int g0/0/2
    [sw3-GigabitEthernet0/0/2]p l t
    [sw3-GigabitEthernet0/0/2]p t a v 10 20 //封装接口类型trunk,并划分vlan 10 20
    [sw3-GigabitEthernet0/0/2]un sh
    Info: Interface GigabitEthernet0/0/2 is not shutdown.
    [sw3-GigabitEthernet0/0/2]dis this
    在这里插入图片描述

二:Rsw1配置

  • sw1配置:将物理接口配置类型并划分vlan,允许对应vlan通过并配置vrrd
    system-view
    [Huawei]sysname sw1
    [sw1]vlan bat 10 20 100
    [sw1]int g0/0/2
    [sw1-GigabitEthernet0/0/2]p l t
    [sw1-GigabitEthernet0/0/2]p t a v 10 20
    [sw1-GigabitEthernet0/0/2]un sh
    Info: Interface GigabitEthernet0/0/2 is not shutdown.
    [sw1-GigabitEthernet0/0/2]dis this
    在这里插入图片描述
    [sw1-GigabitEthernet0/0/2]int g0/0/1
    [sw1-GigabitEthernet0/0/1]p l a
    [sw1-GigabitEthernet0/0/1]p d v 100
    [sw1-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [sw1-GigabitEthernet0/0/1]dis this
    在这里插入图片描述
    [sw1-GigabitEthernet0/0/1]q
    [sw1]int vlanif 10
    [sw1-Vlanif10]ip add 192.168.10.10 24
    [sw1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1 //配置vrrd地址
    [sw1-Vlanif10]vrrp vrid 1 priority 120 //设置优先级(数值越大越优先)
    [sw1-Vlanif10]vrrp vrid 1 track interface g0/0/1 //配置监听接口
    [sw1-Vlanif10]vrrp vrid 1 track interface g0/0/2 //配置监听接口
    [sw1-Vlanif10]q
    [sw1-Vlanif10]dis this
    在这里插入图片描述
    [sw1]int vlanif 20
    [sw1-Vlanif20]ip add 192.168.20.20 24
    [sw1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1 //配置vrrd地址
    [sw1-Vlanif20]vrrp vrid 2 priority 115 //设置优先级(数值越大越优先)
    [sw1-Vlanif20]q
    [sw1-Vlanif20]dis this
    在这里插入图片描述
    [sw1]int vlanif 100
    [sw1-Vlanif100]ip add 11.0.0.2 30
    [sw1-Vlanif100]q
    在这里插入图片描述
    [sw1]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
    配置默认路由

三:Rsw2配置

  • sw2配置:将物理接口配置类型并划分vlan,允许对应vlan通过并配置vrrd
    system-view
    [Huawei]sysname sw2
    [sw2]vlan bat 10 20 100
    [sw2]int g0/0/2
    [sw2-GigabitEthernet0/0/2]p l t
    [sw2-GigabitEthernet0/0/2]p t a v 10 20
    [sw2-GigabitEthernet0/0/2]un sh
    Info: Interface GigabitEthernet0/0/2 is not shutdown.
    [sw2-GigabitEthernet0/0/2]dis this
    在这里插入图片描述
    [sw2-GigabitEthernet0/0/2]int g0/0/1
    [sw2-GigabitEthernet0/0/1]p l a
    [sw2-GigabitEthernet0/0/1]p d v 100
    [sw2-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [sw2-GigabitEthernet0/0/1]dis this
    在这里插入图片描述
    [sw2]int vlanif 10
    [sw2-Vlanif10]ip add 192.168.10.20 24
    [sw2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1 //配置vrrd地址
    [sw2-Vlanif10]vrrp vrid 1 priority 115 //设置优先级(数值越大越优先)
    [sw2-Vlanif10]dis this
    在这里插入图片描述
    [sw2]int vlanif 20
    [sw2-Vlanif20]ip add 192.168.20.20 24
    [sw2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1 //配置vrrd地址
    [sw2-Vlanif20]vrrp vrid 2 priority 120 //设置优先级(数值越大越优先)
    [sw2-Vlanif20]vrrp vrid 2 track interface g0/0/1 //配置监听接口
    [sw2-Vlanif20]vrrp vrid 2 track interface g0/0/2 //配置监听接口
    [sw2-Vlanif20]dis this
    在这里插入图片描述
    [sw2]int vlanif 100
    [sw2-Vlanif100]ip add 12.0.0.2 30
    [sw2-Vlanif100]dis this
    在这里插入图片描述
    [sw2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1

三:R1配置

  • R1配置:这里需要配置回程的静态浮动路由并对其配置相应的优先级
    system-view
    [Huawei]sysname R1
    [R1]int g0/0/1
    [R1-GigabitEthernet0/0/1]ip add 12.0.0.1 30
    [R1-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [R1-GigabitEthernet0/0/1]dis this
    在这里插入图片描述
    [R1-GigabitEthernet0/0/1]int g0/0/0
    [R1-GigabitEthernet0/0/0]ip add 11.0.0.1 30
    [R1-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R1-GigabitEthernet0/0/0]dis this
    在这里插入图片描述
    [R1]int LoopBack 0 //设置回环地址
    [R1-LoopBack0]ip add 1.1.1.1 32
    [R1-LoopBack0]dis this
    在这里插入图片描述
    [R1]ip route-static 192.168.10.0 24 11.0.0.2 //配置浮动路由,主优先级默认60(越小越优先)
    [R1]ip route-static 192.168.10.0 24 12.0.0.2 preference 70 (备浮动路由)
    [R1]ip route-static 192.168.20.0 24 12.0.0.2 //配置浮动路由,主优先级默认60(越小越优先)
    [R1]ip route-static 192.168.20.0 24 11.0.0.2 preference 70(备浮动路由)
    [R1]dis this //查看当前配置
    在这里插入图片描述
    在这里插入图片描述
    ping加抓包验证:在这里插入图片描述在这里插入图片描述
    在这里插入图片描述在这里插入图片描述
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是华为交换机VRRP配置的步骤: 1. 创建VRRP实例 在系统视图下,输入以下命令创建VRRP实例: [huawei] vrrp vrid virtual-router-id [huawei-vrrp-vrid-virtual-router-id] 其中,virtual-router-id是虚拟路由器标识符,必须唯一。 2. 配置VRRP优先级 输入以下命令配置VRRP优先级: [huawei-vrrp-vrid-virtual-router-id] priority priority-value 其中,priority-value是VRRP实例的优先级,取值范围为1-254,值越大优先级越高。 3. 配置VRRP虚拟IP地址 输入以下命令配置VRRP虚拟IP地址: [huawei-vrrp-vrid-virtual-router-id] virtual-ip virtual-ip-address 其中,virtual-ip-address是VRRP实例的虚拟IP地址。 4. 配置VRRP备份路由器 输入以下命令配置VRRP备份路由器: [huawei-vrrp-vrid-virtual-router-id] track track-object-id priority-decrement priority-decrement-value 其中,track-object-id是要监控的对象ID,priority-decrement是优先级减少的方式,可选值为: - decrement:每次监控对象状态改变时,优先级减少priority-decrement-value。 - shutdown:每次监控对象状态改变时,将接口状态置为down。 priority-decrement-value是优先级减少的值,取值范围为1-254。 5. 配置VRRP接口 输入以下命令配置VRRP接口: [huawei-vrrp-vrid-virtual-router-id] interface interface-type interface-number 其中,interface-type是接口类型,interface-number是接口编号。 6. 启用VRRP实例 输入以下命令启用VRRP实例: [huawei-vrrp-vrid-virtual-router-id] quit [huawei] interface interface-type interface-number [huawei-interface-interface-type-interface-number] vrrp vrid virtual-router-id priority priority-value preempt delay-time 其中,delay-time是优先级抢占的延迟时间,取值范围为1-3600秒。 7. 验证VRRP配置 输入以下命令查看VRRP配置: [huawei] display vrrp configuration [huawei] display vrrp vrid virtual-router-id 以上就是华为交换机VRRP配置的步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值