VRRP Virtual Routing Redundancy Protocol-Learn from scratch

technical background

effect

Implement a backup mechanism for LAN devices, which ensures that when the next hop router of the host fails, it can be replaced by another router in time, thus maintaining continuous reliability

work process

When VRRP works, a virtual router containing VIP and VMAC is added to the network. The router acts as a gateway to the host, so that the virtual router communication on the network does not need to connect to the information of the physical router on the network.

Multiple routing interfaces in the group share a virtual IP

Three states of VRRP protocol

Initialize | Master | Backup

The initial state is Initialize. Master and Buckup are generated by comparing priorities. If Backup does not receive the heartbeat insulation from Master within the specified time, it will replace it as the next Master.
Insert picture description here

Master router

  • Regularly send VRRP notification messages to tell Backup that he is still alive
  • Use the virtual MAC address to correspond to other devices' ARP requests for VIP addresses
  • Forward IP packets whose destination MAC address is virtual MAC address
  • If you receive a message with a higher priority than yourself, it will become Backup
  • If you receive a packet with the same priority as your own, and the local interface IP address is less than the peer interface IP, it will become Backup

Buckup router

  • Receive VRRP notification message sent by the Master device to determine whether it can take over
  • ARP request to VIP will not respond
  • Discard IP packets whose destination IP address is the VIP address
  • If you receive a packet with the same priority as yourself or greater than yourself, it will recharge the Master_Down_Interval timer without further comparing IP addresses
  • If a packet smaller than itself is received and the priority of the packet is equal to 0, the timer time is set to the offset time. If the packet is not 0, the packet is discarded and immediately takes over and becomes the Master

VRRP configuration instructions

[R-Vlanifn]vrrp vrid 1 virtual-ip 192.168.10.1
//创建VRRP虚拟路由器的标识vrid为1 并配置vrid1的VIP
[R-Vlanifn]vrrp vrid 1 priority 120
//设置vrid1的优先级为120
/* 优先级默认100 越大越优先*/
[R-Vlanifn]vrrp vrid 1 preempt-mode timer delay 10
//设置Master设备抢占延时为10秒
[R-Vlanifn]vrrp vrid 1 track int g0/0/1 reduce 50
//设置跟踪上行接口,如端口故障则Master优先级降低50
[R-Vlanifn]vrrp vrid 1 track int g0/0/2
//设置跟踪下行接口

Guess you like

Origin blog.csdn.net/qq_42427971/article/details/112267292