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. Sets an alarm to trigger actions or alerts when there is a state change in the VRRP 4 group (e.g., when a backup router becomes master).

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 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

Note

No state changes in vrrp-group 1, so alarm state is false.

Step 5: 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-10-10 20:31:50.293881233 +00:00  2025-10-10 20:31:47.132568438 +00:00             2        77.49

Step 6: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 vrrp vrrp-group 1 priority 50

Step 7: 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 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

Note

State has changed in vrrp-group 1, so alarm state is true.

Step 9: 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-10-10 20:31:52.547066870 +00:00  2025-10-10 20:31:50.293881233 +00:00             3        59.31

Test using advisor to change VRRP state

Description

This example illustrates how to change the VRRP state with the advisor. If the status of the specified advisor becomes FALSE, a backup router can take over and become master.

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:01         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

Note

Alarm “r_al” is set to false beacause it is triggered if the route ::/0 is missing, so the advisor “not r_al” is set to true because it is the opposite of “r_al”.

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-10-10 20:32:05.947587833 +00:00  2025-10-10 20:32:00.946791110 +00:00             2        48.48

Step 6: Run command system advisor vrrp_adv show at DUT0 and check if output contains the following tokens:

true
Show output
-----------------------------------------------------------------------------------------------------------------------
Advisor   Status                Toggled                             Prev-toggled              Toggle-count  Time up (%)
-----------------------------------------------------------------------------------------------------------------------
vrrp_adv  true    2025-10-10 20:32:05.953375799 +00:00  2025-10-10 20:32:01.114800221 +00:00             2        53.43

Step 7: Modify the following configuration lines in DUT0 :

delete protocols static

Note

The route ::/0 is missing alarm “r_al” is triggered and the advisor “not r_al” is set to false, which means that the backup router can take over and become master.

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

false
Show output
-----------------------------------------------------------------------------------------------------------------------
Advisor   Status                Toggled                             Prev-toggled              Toggle-count  Time up (%)
-----------------------------------------------------------------------------------------------------------------------
vrrp_adv  false   2025-10-10 20:32:15.956358546 +00:00  2025-10-10 20:32:05.953375799 +00:00             3        67.61

Step 9: 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:01         none

Step 10: 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:02         none

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 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 source-address '20::1'
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'

Note

Source address is 20::1.

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         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 interfaces ethernet eth0 vrrp vrrp-group 1 virtual-address '20::3'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Note

Capture packets and show one:

Note

Source and destination addresses. ff02::12 is the IPv6 multicast address used by VRRPv3 for sending hello messages.

Show output
1 2025-10-10 20:32:32.899439539        20::1 → ff02::12     VRRP 94 Announcement (v3)

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

Note

VRRP Sync Groups allow you to synchronize the state of multiple VRRP instances in a router, ensuring they all transition to the same state (either MASTER or BACKUP) together. Two routers with instances in the same sync group can communicate between each other so their states are different.

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 interfaces ethernet eth1 address '20::10/64'
set interfaces ethernet eth1 vrrp vrrp-group 2 sync-group MAIN0
set interfaces ethernet eth1 vrrp vrrp-group 2 virtual-address '10::2'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN0

Note

Both instances have the same state.

Step 2: Run command system vrrp show at DUT0 and check if output matches the following regular expressions:

eth0
1
MASTER
MAIN0
eth1
2
MASTER
MAIN0
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:01        MAIN0
  eth1       2    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 3 sync-group MAIN0
set interfaces ethernet eth0 vrrp vrrp-group 3 virtual-address '10::1'
set interfaces ethernet eth1 address '20::20/64'
set interfaces ethernet eth1 vrrp vrrp-group 4 sync-group MAIN0
set interfaces ethernet eth1 vrrp vrrp-group 4 virtual-address '10::2'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN0

Note

Both instances have the same state.

Step 4: Run command system vrrp show at DUT1 and check if output matches the following regular expressions:

eth0
3
BACKUP
MAIN0
eth1
4
BACKUP
MAIN0
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       3    BACKUP       yes           no          0:00:00        MAIN0
  eth1       4    BACKUP       yes           no          0:00:00        MAIN0

Step 5: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 vrrp vrrp-group 1 disable

Note

It does not matter that only vrrp-group 1 is disabled, since all instances are in the same sync group they all change their state.

Step 6: Run command system vrrp show at DUT0 and check if output matches the following regular expressions:

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

Step 7: Run command system vrrp show at DUT1 and check if output matches the following regular expressions:

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

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

Note

VRRP Sync Groups allow you to synchronize the state of multiple VRRP instances in a router, ensuring they all transition to the same state (either MASTER or BACKUP) together. Two routers with instances in the different sync groups cannot communicate between each other so their states are the same.

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 interfaces ethernet eth1 address '20::10/64'
set interfaces ethernet eth1 vrrp vrrp-group 2 sync-group MAIN0
set interfaces ethernet eth1 vrrp vrrp-group 2 virtual-address '10::2'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN0

Note

Both instances have the same state.

Step 2: Run command system vrrp show at DUT0 and check if output matches the following regular expressions:

eth0
1
MASTER
MAIN0
eth1
2
MASTER
MAIN0
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       1    MASTER       yes           no          0:00:01        MAIN0
  eth1       2    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 3 sync-group MAIN1
set interfaces ethernet eth0 vrrp vrrp-group 3 virtual-address '10::1'
set interfaces ethernet eth1 address '20::20/64'
set interfaces ethernet eth1 vrrp vrrp-group 4 sync-group MAIN1
set interfaces ethernet eth1 vrrp vrrp-group 4 virtual-address '10::2'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrrp sync-group MAIN1

Note

Both instances have the same state.

Step 4: Run command system vrrp show at DUT1 and check if output matches the following regular expressions:

eth0
3
MASTER
MAIN1
eth1
4
MASTER
MAIN1
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       3    MASTER       yes           no          0:00:01        MAIN1
  eth1       4    MASTER       yes           no          0:00:01        MAIN1

Step 5: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 vrrp vrrp-group 1 disable

Note

It does not matter that only vrrp-group 1 is disabled, since both instances in DUT0 are in the same sync group they both share the same state, but DUT0 and DUT1 do not communicate with each other, so their states do not change.

Step 6: Run command system vrrp show at DUT0 and check if output matches the following regular expressions:

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

Step 7: Run command system vrrp show at DUT1 and check if output matches the following regular expressions:

eth0
3
MASTER
MAIN1
eth1
4
MASTER
MAIN1
Show output
--------------------------------------------------------------------------------
Interface  Group  State   RFC Compliant  Addr Owner  Last Transition  Sync Group
--------------------------------------------------------------------------------
  eth0       3    MASTER       yes           no          0:00:07        MAIN1
  eth1       4    MASTER       yes           no          0:00:07        MAIN1

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:01         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'