Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

VRRP with cRPD

date_range 10-Dec-24

Overview

The Virtual Router Redundancy Protocol (VRRP) in cRPD eliminates the single point of failure in the static default route environment. VRRP dynamically assigns responsibility for a virtual router to one of the VRRP routers. The VRRP router that controls the IP address associated with the virtual router is called Master. Master forwards the packets to these IP addresses.

When the master router is unavailable, any of the virtual routers IP address is used as the default first hop router by end hosts.

Benefit of VRRP

Supports high availability default path without configuring dynamic routing on every end host.

How VRRP Works with cRPD?

This example configuration provides steps on how to configure active/back up load balancing feature using VRRP in cRPD. To achieve this support, you must configure VRRP instance with a virtual address in two cRPD containers. One as a master and other as a backup. When the failover happens, the virtual address is taken by the backup router from the master router.
  1. Configure VRRP on cRPD instance 1. The virtual address is used as a next hop for the route.
    content_copy zoom_out_map
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 virtual-address 10.0.0.254/32 device-name ens3f1
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 priority 200
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 advertise-interval 1
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 mode master
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 authentication-type simple
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 authentication-key 12345
  2. Configure VRRP with track and notify script. Notify script is to trigger script execution when the VRRP state changes to master/backup. Track script is used to monitor every state transition of instance.
    content_copy zoom_out_map
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track interface ens3f2 weight cost 10
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track track-script keepalived_check script-name /etc/crpd/scripts/track_script_sample.sh
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track track-script keepalived_check interval 10
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track track-script keepalived_check time-out 5
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track track-script keepalived_check rise 3
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track track-script keepalived_check fall 3
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track track-script keepalived_check weight cost 10
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.1/24 vrrp-group 111 track notify-script /etc/crpd/scripts/keepalived_notify.sh
  3. Configure VRRP on cRPD instance 2.
    content_copy zoom_out_map
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 virtual-address 10.0.0.254/32 device-name ens3f1
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 priority 200
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 advertise-interval 1
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 mode backup
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 authentication-type simple
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 authentication-key 12345
  4. Configure VRRP with track and notify script.
    content_copy zoom_out_map
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track interface ens3f2 weight cost 10
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track track-script keepalived_check script-name /etc/crpd/scripts/track_script_sample.sh
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track track-script keepalived_check interval 10
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track track-script keepalived_check time-out 5
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track track-script keepalived_check rise 3
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track track-script keepalived_check fall 3
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track track-script keepalived_check weight cost 10
    user@crpd1# set interfaces ens3f1 unit 0 family inet address 10.0.0.2/24 vrrp-group 111 track notify-script /etc/crpd/scripts/keepalived_notify.sh

Use the following commands to verify that cRPD1 has transitioned to backup state and that the router is backup for group ens3f1_v4_111.

content_copy zoom_out_map
user@crpd1> show vrrp
Interface  State   Group     VR-state   VR Mode  Interface-address   Virtual-address
ens3f1   up        ens3f1_v4_111 backup   Inactive  10.0.0.1/24             10.0.0.254/32
content_copy zoom_out_map
user@crpd1> show vrrp track
Track Int     State       VRRP int       Group  VR State Priority
ens3f2        up          ens3f1  ens3f1_v4_111   backup    200

Use the following commands to verify that the instance has transitioned to master state and that the router is master for group ens3f1_v4_111.

content_copy zoom_out_map
user@crpd1> show vrrp
Interface  State   Group     VR-state   VR Mode  Interface-address   Virtual-address
ens3f1   up        ens3f1_v4_111 master   Active    10.0.0.2/24             10.0.0.254/32
content_copy zoom_out_map
user@crpd1> show vrrp track
Track Int     State       VRRP int       Group  VR State Priority
ens3f2        up          ens3f1  ens3f1_v4_111   master    200
footer-navigation