VRRP双主双备实验

内容要点
1.VRRP
2.浮动路由

注意事项
1.浮动路由默认优先级是60,数值约小越优先。
2.VRRP—(公有协议)
在多个路由器之间运行,可以虚拟出一个或多个网关IP地址(虚拟路由器)从而实现内网不同网段间的互通。
3.VRRP的工作过程:
运行VRRP的多个路由器之间通过VRRP报文的交互,从而选择出一个最牛的路由器,作为“master”路由器,以后就用这个设备来转发数据包。
master路由器,仅仅只有一个,其他的路由器称之为“backup”路由器。
同时,master和backup路由器,会产生一个虚拟的路由器,也就是一个虚拟的IP地址。

在这里插入图片描述
VRRP双主双备实验
先配置SW3:
u t m
system-view
[Huawei]sysname SW3
[SW3]v b 10 20
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]p l a
[SW3-Ethernet0/0/1]p d v 10
[SW3-Ethernet0/0/1]un sh
[SW3-Ethernet0/0/1]int e0/0/2
[SW3-Ethernet0/0/2]p l a
[SW3-Ethernet0/0/2]p d v 20
[SW3-Ethernet0/0/2]un sh
[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1]p l t
[SW3-GigabitEthernet0/0/1]p t a v 10 20
[SW3-GigabitEthernet0/0/1]un sh
[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
[SW3-GigabitEthernet0/0/2]un sh

配置SW1
u t m
system-view
[Huawei]sysname SW1
[SW1]v b 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
[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
[SW1]int vlan
[SW1]int Vlanif 10
[SW1-Vlanif10]ip add 192.168.10.10 24
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[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]int Vlanif 20
[SW1-Vlanif20]ip add 192.168.20.10 24
[SW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
vrrp vrid 2 priority 115
[SW1]int vlanif 100
[SW1-Vlanif100]ip add 11.0.0.2 30
[SW1]ip route-static 0.0.0.0 0.0.0.0 11.0.0.

配置SW2
u t m
system-view
[Huawei]sysname SW2
[SW2]v b 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
[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
[SW2]int vlan
[SW2]int Vlanif 10
[SW2-Vlanif10]ip add 192.168.10.20 24
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW2-Vlanif10]vrrp vrid 1 priority 115
[SW2]int Vlanif 20
[SW2-Vlanif20]ip add 192.168.20.20 24
[SW2-Vlanif20]vrrp vrid 1 virtual-ip 192.168.20.1
[SW2-Vlanif20]vrrp vrid 1 priority 120
[SW2-Vlanif20]undo vrrp vrid 1
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW2-Vlanif20]vrrp vrid 2 priority 120
[SW2-Vlanif20]vrrp vrid 2 track int g0/0/1
[SW2-Vlanif20]vrrp vrid 2 track int g0/0/2
[SW2]int Vlanif 100
[SW2-Vlanif100]ip add 12.0.0.2 30
[SW2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1

配置R1
u t m
system-view
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 11.0.0.1 30
[R1-GigabitEthernet0/0/0]un sh
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.1 30
[R1-GigabitEthernet0/0/1]un sh
[R1]int loo 0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1]ip route-static 192.168.10.0 24 11.0.0.2
[R1]ip route-static 192.168.10.0 24 12.0.0.2
[R1]ip route-static 192.168.20.0 24 11.0.0.2
[R1]ip route-static 192.168.20.0 24 12.0.0.2

用PC1ping环回口1.1.1.1,可以ping通
在这里插入图片描述
接下来断掉其中一条链路
[SW1-GigabitEthernet0/0/1]shutdown

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值