Vrrpv6

Examples for High Availability (VRRP) using IPv6

Test using alarm to notify VRRP state change

Description

This example illustrates how to notify the VRRP state with the alarm.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 advisor vrrp_adv
set interfaces ethernet eth0 vrrp vrrp-group 1 alarm vrrp_al
set interfaces ethernet eth0 vrrp vrrp-group 1 preempt
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 200
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set protocols static route6 '::/0' next-hop '20::2'
set system advisor vrrp_adv test 'not r_al'
set system alarm r_al
set system alarm vrrp_al
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '20::2/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 100
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command system vrrp show at DUT0 and check if output contains the following tokens:

MASTER
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:00         none

Step 4: Run command interfaces ethernet eth0 show at DUT0 and check if output contains the following tokens:

10::1
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  20::3/128                     up     up
      10::1/128
      20::1/64
      fe80::dcad:beff:feef:6c00/64

Step 5: Run command interfaces ethernet eth0 show at DUT0 and expect this output:

Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  20::3/128                     up     up
      10::1/128
      20::1/64
      fe80::dcad:beff:feef:6c00/64

Step 6: Run command interfaces ethernet eth0 show at DUT1 and expect this output:

Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  20::2/64                      up     up
      fe80::dcad:beff:feef:6c10/64

Step 7: Run command system vrrp show at DUT1 and check if output contains the following tokens:

BACKUP
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    BACKUP       yes           no          0:00:03         none

Step 8: Run command system alarm vrrp_al show at DUT0 and check if output contains the following tokens:

false
Show output
----------------------------------------------------------------------------------------------------------------------
 Alarm   Status                Toggled                             Prev-toggled              Toggle-count  Time up (%)
----------------------------------------------------------------------------------------------------------------------
vrrp_al  false   2025-01-10 16:12:16.610455019 +00:00  2025-01-10 16:12:13.445157676 +00:00             2        72.52

Step 9: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 disable
set interfaces ethernet eth0 vrrp vrrp-group 1 advisor vrrp_adv
set interfaces ethernet eth0 vrrp vrrp-group 1 alarm vrrp_al
set interfaces ethernet eth0 vrrp vrrp-group 1 preempt
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 200
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set protocols static route6 '::/0' next-hop '20::2'
set system advisor vrrp_adv test 'not r_al'
set system alarm r_al
set system alarm vrrp_al
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 10: Run command system vrrp show detail at DUT0 and check if output contains the following tokens:

FAULT
Show output
Interface: eth0
   Group: 1
   State:                       FAULT
   Last Transition:             0:00:01

   Priority:                    200
   Advertisement interval:      1000 milli-sec
   Preempt:                     enabled

   Sync-group:                  none

   VIP count:                   2
      10::1
      20::3

Step 11: Run command system vrrp show detail at DUT1 and check if output contains the following tokens:

MASTER
Show output
Interface: eth0
   Group: 1
   State:                       MASTER
   Last Transition:             0:00:00

   Priority:                    100
   Advertisement interval:      1000 milli-sec
   Preempt:                     disabled

   Sync-group:                  none

   VIP count:                   2
      10::1
      20::3

Step 12: Run command system alarm vrrp_al show at DUT0 and check if output contains the following tokens:

true
Show output
----------------------------------------------------------------------------------------------------------------------
 Alarm   Status                Toggled                             Prev-toggled              Toggle-count  Time up (%)
----------------------------------------------------------------------------------------------------------------------
vrrp_al  true    2025-01-10 16:12:17.918291262 +00:00  2025-01-10 16:12:16.610455019 +00:00             3        81.76

Step 13: Run command interfaces ethernet eth0 show at DUT1 and expect this output:

Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  20::3/128                     up     up
      10::1/128
      20::2/64
      fe80::dcad:beff:feef:6c10/64

Step 14: Run command interfaces ethernet eth0 show at DUT0 and expect this output:

Show output
-----------------------------------------------
Name  IP Address  Admin  Oper  Vrf  Description
-----------------------------------------------
eth0  20::1/64    down   down

Step 15: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 advisor vrrp_adv
set interfaces ethernet eth0 vrrp vrrp-group 1 alarm vrrp_al
set interfaces ethernet eth0 vrrp vrrp-group 1 preempt
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 200
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set protocols static route6 '::/0' next-hop '20::2'
set system advisor vrrp_adv test 'not r_al'
set system alarm r_al
set system alarm vrrp_al
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 16: Run command system vrrp show at DUT0 and check if output contains the following tokens:

BACKUP
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    BACKUP       yes           no          0:00:00         none

Step 17: Run command system alarm vrrp_al show at DUT0 and check if output contains the following tokens:

true
Show output
----------------------------------------------------------------------------------------------------------------------
 Alarm   Status                Toggled                             Prev-toggled              Toggle-count  Time up (%)
----------------------------------------------------------------------------------------------------------------------
vrrp_al  true    2025-01-10 16:12:17.918291262 +00:00  2025-01-10 16:12:16.610455019 +00:00             3        85.30

Test using advisor to change VRRP state

Description

This example illustrates how to change the VRRP state with the advisor.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 advisor vrrp_adv
set interfaces ethernet eth0 vrrp vrrp-group 1 alarm vrrp_al
set interfaces ethernet eth0 vrrp vrrp-group 1 preempt
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 200
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set protocols route-monitor prefix '::/0' alarm r_al
set protocols static route6 '::/0' next-hop '20::2'
set system advisor vrrp_adv test 'not r_al'
set system alarm r_al
set system alarm vrrp_al
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '20::2/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 100
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command system vrrp show at DUT0 and check if output contains the following tokens:

MASTER
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:02         none

Step 4: Run command system vrrp show at DUT1 and check if output contains the following tokens:

BACKUP
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    BACKUP       yes           no          0:00:02         none

Step 5: Run command system alarm r_al show at DUT0 and check if output contains the following tokens:

false
Show output
--------------------------------------------------------------------------------------------------------------------
Alarm  Status                Toggled                             Prev-toggled              Toggle-count  Time up (%)
--------------------------------------------------------------------------------------------------------------------
r_al   false   2025-01-10 16:12:36.509845218 +00:00  2025-01-10 16:12:31.516675907 +00:00             2        48.77

Step 6: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 advisor vrrp_adv
set interfaces ethernet eth0 vrrp vrrp-group 1 alarm vrrp_al
set interfaces ethernet eth0 vrrp vrrp-group 1 preempt
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 200
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set protocols route-monitor prefix '::/0' alarm r_al
set system advisor vrrp_adv test 'not r_al'
set system alarm r_al
set system alarm vrrp_al
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 7: Run command system vrrp show at DUT0 and check if output contains the following tokens:

FAULT
Show output
-------------------------------------------------------------------------------
Interface  Group  State  RFC Compliant  Addr Owner  Last Transition  Sync Group
-------------------------------------------------------------------------------
  eth0       1    FAULT       yes           no          0:00:00         none

Step 8: Run command system vrrp show at DUT1 and check if output contains the following tokens:

MASTER
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:01         none

Test advertise-interval

Description

Extracts timestamps from VRRP packets and calculates intervals between them.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 advertise-interval 2
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 200
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Run command system vrrp show at DUT0 and check if output contains the following tokens:

MASTER
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:00         none

Step 3: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '20::2/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 100
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Test VRRP source-address

Description

Captures VRRP packets and verifies the source address is correct.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 200
set interfaces ethernet eth0 vrrp vrrp-group 1 source-address '20::1'
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Run command system vrrp show at DUT0 and check if output contains the following tokens:

MASTER
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:02         none

Step 3: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '20::2/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 priority 100
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Two VRRP devices in same sync-group

Description

Configure 2 DUTs in the same sync-group to check that they do communicate between each other.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 sync-group MAIN0
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN0

Step 2: Run command system vrrp show at DUT0 and check if output contains the following tokens:

MASTER
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:01        MAIN0

Step 3: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '20::2/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 sync-group MAIN1
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN1

Step 4: Run command system vrrp show at DUT1 and check if output contains the following tokens:

BACKUP
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    BACKUP       yes           no          0:00:00        MAIN1

Step 5: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 vrrp vrrp-group 1 disable

Step 6: Run command system vrrp sync-group MAIN0 show at DUT0 and check if output contains the following tokens:

BACKUP
Show output
Group: MAIN0
   State: BACKUP
   Monitoring:
      Interface: eth0, Group: 1

Step 7: Run command system vrrp sync-group MAIN1 show at DUT1 and check if output contains the following tokens:

MASTER
Show output
Group: MAIN1
   State: MASTER
   Monitoring:
      Interface: eth0, Group: 1

Two VRRP devices in different sync-group

Description

Configure 2 DUTs in different sync-groups to check that they do not communicate between each other.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '20::1/64'
set interfaces ethernet eth0 vrrp vrrp-group 1 sync-group MAIN0
set interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN0

Step 2: Run command system vrrp sync-group MAIN0 show at DUT0 and check if output contains the following tokens:

MASTER
Show output
Group: MAIN0
   State: MASTER
   Monitoring:
      Interface: eth0, Group: 1

Step 3: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '20::2/64'
set interfaces ethernet eth0 vrrp vrrp-group 2 sync-group MAIN1
set interfaces ethernet eth0 vrrp vrrp-group 2 virtual-address '10::1'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN1

Step 4: Run command system vrrp sync-group MAIN1 show at DUT1 and check if output contains the following tokens:

MASTER
Show output
Group: MAIN1
   State: MASTER
   Monitoring:
      Interface: eth0, Group: 2

Step 5: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 vrrp vrrp-group 1 disable

Step 6: Run command system vrrp sync-group MAIN0 show at DUT0 and check if output contains the following tokens:

MASTER
Show output
Group: MAIN0
   State: MASTER
   Monitoring:
      Interface: eth0, Group: 1

Step 7: Run command system vrrp sync-group MAIN1 show at DUT1 and check if output contains the following tokens:

MASTER
Show output
Group: MAIN1
   State: MASTER
   Monitoring:
      Interface: eth0, Group: 2