当前位置:网站首页>VRRP principle and command
VRRP principle and command
2022-08-05 06:10:00 【Magic star,】
VRRPPrinciples and Commands
VRRP
vrrp基本概述
vrrp是虚拟路由冗余协议,能够在不改变组网的情况下,将多台路由器虚拟成一个虚拟路电器,通过配置虚拟路由器的IP地址为默认网关,实现网关的备份.
vrrp作用:Backup of the egress gateway,Ensure high availability of egress gateways.
vrrp好处:
- 主路由器失效后,备份路由器立即顶替主路由器的工作,保证数据的不丢失.
- 两个不同的路由器成为不同组的主路由器,相互备份.
- 跟踪上行链路接口状态,当上行链路接口失效时,The backup route copy is automatically promoted to the primary router,保证数据的不丢失.
vrrp原理:
通过在冗余网关间共享虚拟MAC和IP地址,Ensure that data is not forwarded to a specific gateway when forwardedIP,而是把数据转发给虚拟网关的IP,因此,No matter which router becomes the main router,都不会影响数据通信.通过组播协议对数据端口进行监控,一旦检测数据转发的端口坏掉,主路由器会停发HELLO包,备路由器提升为主路由,实现数据的稳定高效转发.


| 设备类型 | |
|---|---|
| master路由器 | 通过比较VRRP优先级,优先级大的是master路由器;周期性的发送VRRP报文,维护master路由器和备份路由器的身份;周期时间默认是1s; 备份网关,通过比较 VRRP 优先级,优先级小的是备份路由器; |
| 备份(backup)路由器 | 通过不断的接收master路由器发送的 VRRP 报文来判断master路由器的状态; 如果在一定的时间内,收不到 VRRP 报文,则认为master路由器出现故障,自己升级为master路由器; 这个“一定的时间”,默认是“master路由器发送VRRP的周期”的3倍,所以默认是 3s . |
| 虚拟网关 | 通过VRRP虚拟出来的网关IP地址,这个网关IP地址,is configured on the terminal device;终端设备访问其他网段时,直接将数据发送给虚拟网关IP地址,此时只有master路由器会回应针对虚拟网关IP地址的ARP请求,So finally the data sent by the end device is sent tomaster路由器设备上 |
| VRID | same in the same group Only in the same group will be shared 虚拟ip 虚拟路由器的标识.有相同VRID的一组路由器构成一个虚拟路由器VRRP报文格式VRRP只使用到advertisement这一种报文,VRRP使用ip报文作为传输协议报文,协议号为112,使用固定的组播地址224.0.0.18进行发送 |
| VRRP状态机 | VRRP协议中定义了三种状态机:初始状态(Initialize)、活动状态(Master)、备份状态(Backup).其中,只有处于活动状态的设备才可以转发那些发那些发送到虚拟IP地址的报文. |
| Initialize | 设备启动时进入此状态,当收到接口Startup的消息,将转入Backup或Master状态(IP地址拥有者的接口优先级为255,直接转为Master).在此状态时,不会对VRRP报文做任何处理. |
VRRPActive and standby backup process
- 设置了优先级 优先级大的优先,when the priority is the same,Compare the interface mac 地址

After the router is configured,Each other is unaware of the configuration of the opposite side,会Send notification messages to each other,Election of active and standby routers

The comparison priority is determinedRA为master路由器,RB为备份(backup)路由器 (RA优先级大于RB).After electing the master and backup, backup No more messages will be sent.master 始终在周期性发送 通告报文.
master发生故障,主备切换,一般来说 in the event of a master failure, backup在3no second成为主(This time core priority and other settings are related)
The original main router is restored,抢占模式(The non-preemptive mode can be modified,The default preemption mode has no delay)

实验操作

配置master路由器R2

配置备份(backup)路由器R3

配置路由R1

PC2 ping 192.168.2.1(PC1)

总结:
- 设置了优先级 优先级大的优先,when the priority is the same,Compare the interface mac 地址;
- After the router is configured,Each other is unaware of the configuration of the opposite side,会Send notification messages to each other,Election of active and standby routers;
- master 始终在周期性发送 通告报文.
- masterRouter and backup router configuration commands
master路由器:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.10 24
[r1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[r1-GigabitEthernet0/0/0]vrrp vrid 1 priority 120
[r1-GigabitEthernet0/0/0]vrrp vrid 1 track interface GigabitEthernet 0/0/1 reduc
ed 30
备份路由器:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.20 24
[r1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[r1-GigabitEthernet0/0/0]vrrp vrid 1 priority 80
边栏推荐
- [Day1] VMware software installation
- 每日一题-最长回文子串-0714
- Lua,ILRuntime, HybridCLR(wolong)/huatuo热更对比分析
- Autoware中安装Yolo3目标检测模块遇到的问题
- 每日一题-合并两个有序链表-0720
- Cocos Creator开发中的事件响应
- Getting Started Documentation 12 webserve + Hot Updates
- 乘云科技受邀出席2022阿里云合作伙伴大会荣获“聚力行远奖”
- dsf5.0 弹框点确定没有返回值的问题
- Getting Started 04 When a task depends on another task, it needs to be executed in sequence
猜你喜欢

Cocos Creator小游戏案例《棍子士兵》

spark源码-任务提交流程之-1-sparkSubmit

Unity huatuo 革命性热更系列1.2 huatuo热更环境安装与示例项目

【Day8】RAID Disk Array
![[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves](/img/8f/3c9944db96eef623779a5abe68355b.png)
[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves

2020年手机上最好的25种免费游戏

每日一题-两数相加-0711

入门文档09 独立的watch

入门文档01 series按顺序执行

Getting Started Documentation 12 webserve + Hot Updates
随机推荐
SSL证书提示过期或者无效,该怎么处理呢?
UE4美术你有必要了解的数学基础
dsf5.0 弹框点确定没有返回值的问题
lvm logical volume and disk quota
spark operator-wholeTextFiles operator
【机器学习】1单变量线性回归
传输层协议(TCP3次握手)
spark源码-任务提交流程之-1-sparkSubmit
单臂路由与三成交换机
C语言的一些小常识
入门文档11 自动添加版本号
乘云科技受邀出席2022阿里云合作伙伴大会荣获“聚力行远奖”
Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
无影云桌面
如何使用Houdini进行程序化优化?
腾讯云消息队列CMQ
Getting Started Documentation 12 webserve + Hot Updates
Getting Started Doc 06 Adding files to a stream
什么是全栈设计师?
网站ICP备案是什么呢?