当前位置:网站首页>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
边栏推荐
- Autoware--北科天绘rfans激光雷达使用相机&激光雷达联合标定文件验证点云图像融合效果
- 每日一题-合并两个有序链表-0720
- spark operator-wholeTextFiles operator
- Wireshark抓包及常用过滤方法
- 【Machine Learning】1 Univariate Linear Regression
- 错误类型:reflection.ReflectionException: Could not set property ‘xxx‘ of ‘class ‘xxx‘ with value ‘xxx‘
- unity实现第一人称漫游(保姆级教程)
- Account and Permission Management
- Cocos Creator小游戏案例《棍子士兵》
- 虚幻引擎5都有哪些重要新功能?
猜你喜欢
随机推荐
Getting Started Document 07 Staged Output
UE4动画雨滴材质制作教程
[Paper Intensive Reading] Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation (R-CNN)
lvm逻辑卷及磁盘配额
D41_缓冲池
腾讯云消息队列CMQ
静态路由
dsf5.0新建页面访问时重定向到首页的问题
“元宇宙”是个啥?都有哪些大招?
偷题——腾讯游戏开发面试问题及解答
腾讯内部技术:《轩辕传奇》服务器架构演变
入门文档08 条件插件
Introductory document 05-2 use return instructions the current task has been completed
Unity huatuo 革命性热更系列1.2 huatuo热更环境安装与示例项目
每日一题-正则表达式匹配-0715
如何使用Houdini进行程序化优化?
Autoware中安装Yolo3目标检测模块遇到的问题
网站ICP备案是什么呢?
spark算子-wholeTextFiles算子
Account and Permission Management









