​Junos VRRP Example

In this post, we’re going to look at how to configure VRRP on Juniper devices. If you need a refresher then have a look at VRRP basics. There is also how to troubleshoot VRRP on Junos.

We’ll start with a very basic configuration before progressing to adjusting timers, authentication, and tracking interfaces and routes.

Lab Setup

The lab setup is shown in the diagram below. We will configure VRRP on vMX-3 and vMX-4 to act as the default gateway for Linux-3. OSPF is running between the four vMX instances to advertise loopback addresses and local networks.

Example 1 – Basic Configuration

In the basic configuration, we are specifying the VRRP group, VIP address, and priority. This configuration happens under the IP address of the interface. On vMX-4 no priority is specified, so it defaults to priority 100.

VMX3:

lab@vMX-3> show configuration interfaces ge-0/0/2  
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
            }
        }
    }
}

vMX-4:

lab@vMX-4> show configuration interfaces ge-0/0/2  
unit 0 {
    family inet {
        address 172.16.50.3/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
            }
        }
    }
}

We can now check this using the show vrrp command.

vMX-3:

lab@vMX-3> show vrrp 
Interface     State       Group   VR state VR Mode   Timer    Type   Address
ge-0/0/2.0    up             50   master   Active      A  0.057 lcl    172.16.50.2    
                                                                vip    172.16.50.1    

vMX-4:

lab@vMX-4> show vrrp 
Interface     State       Group   VR state VR Mode   Timer    Type   Address
ge-0/0/2.0    up             50   backup   Active      D  3.127 lcl    172.16.50.3    
                                                                vip    172.16.50.1    
                                                                mas    172.16.50.2    

The vMX-3 device only lists its local address and the VIP. VMX-4 being in the backup state also lists the master address.

If we look at the detailed output, we can see some further helpful information.

  • The VRRP version is 2
  • The device’s current priority
  • The advertisement interval is 1, with a threshold of 3
  • There is no authentication in use
  • Pre-emption is enabled
  • Accept-Data is disabled
  • the virtual MAC address is listed
  • Tracking is disabled

VMX-3:

lab@vMX-3> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 120, Advertisement interval: 1, Authentication type: none
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: no, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 0.318s, Master router: 172.16.50.2
  Virtual router uptime: 01:10:03, Master router uptime: 01:10:00
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: disabled 

VMX-4:

On vMX-4 we get some additional information because it is in the backup state.

  • A dead timer is listed
  • Master priority is listed
lab@vMX-4> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.3/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: backup, VRRP Mode: Active
  Priority: 100, Advertisement interval: 1, Authentication type: none
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: no, VIP count: 1, VIP: 172.16.50.1        
  Dead timer: 3.458s, Master priority: 120, Master router: 172.16.50.2 
  Virtual router uptime: 01:10:04
  Preferred: yes 
  Tracking: disabled 

Example 2 – Adding Accept-Data

Adding accept-data allows the VRRP master to respond to traffic sent to the VIP address. As shown from Linux-3, we can currently ping a remote host which proves the default gateway is working. We can’t ping the gateway itself, which is the VRRP VIP address. The arp command shows the virtual MAC address for the VIP, also proving things are working.

eve@linux-3:~$ ping -c 2 192.168.20.6
PING 192.168.20.6 (192.168.20.6) 56(84) bytes of data.
64 bytes from 192.168.20.6: icmp_seq=1 ttl=61 time=326 ms
64 bytes from 192.168.20.6: icmp_seq=2 ttl=61 time=326 ms

--- 192.168.20.6 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 325.940/325.991/326.043/0.051 ms
eve@linux-3:~$ ping -c 2 172.16.50.1
PING 172.16.50.1 (172.16.50.1) 56(84) bytes of data.

--- 172.16.50.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1010ms

eve@linux-3:~$ arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
172.16.50.1              ether   00:00:5e:00:01:32   C                     ens4
172.16.50.2              ether   aa:bb:dd:00:aa:20   C                     ens4
172.16.50.3              ether   aa:bb:dd:00:aa:21   C                     ens4

Turning on accept-data, our new configuration looks as follows. I have also added the preempt statement, even though it is on by default, just to make it more obvious.

VMX-3:

lab@vMX-3> show configuration interfaces ge-0/0/2    
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
                preempt;
                accept-data;
            }
        }
    }
}

vMX-4:

lab@vMX-4> show configuration interfaces ge-0/0/2    
unit 0 {
    family inet {
        address 172.16.50.3/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                preempt;
                accept-data;
            }
        }
    }
}

Retrying the pings from Linux-3 we now get the following results.

eve@linux-3:~$ ping -c 2 192.168.20.6
PING 192.168.20.6 (192.168.20.6) 56(84) bytes of data.
64 bytes from 192.168.20.6: icmp_seq=1 ttl=61 time=329 ms
64 bytes from 192.168.20.6: icmp_seq=2 ttl=61 time=331 ms

--- 192.168.20.6 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 328.811/329.702/330.594/0.891 ms
eve@linux-3:~$ ping -c 2 172.16.50.1
PING 172.16.50.1 (172.16.50.1) 56(84) bytes of data.
64 bytes from 172.16.50.1: icmp_seq=1 ttl=64 time=111 ms
64 bytes from 172.16.50.1: icmp_seq=2 ttl=64 time=105 ms

--- 172.16.50.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 105.135/108.067/111.000/2.932 ms
eve@linux-3:~$

Example 3 – Tracking An Interface

In this example, we are only configuring vMX-3. VRRP will be set to track interface ge-0/0/1, which is the interface to vMX-2, and decrease priority by 30.

The vMX configuration now looks as follows:

lab@vMX-3> show configuration interfaces ge-0/0/2       
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
                preempt;
                accept-data;
                track {
                    interface ge-0/0/1 {
                        priority-cost 30;
                    }
                }
            }
        }
    }
}

The show vrrp detail, show vrrp track, and show vrrp track detail output is displayed below.

lab@vMX-3> show vrrp detail          
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 120, Advertisement interval: 1, Authentication type: none
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 0.822s, Master router: 172.16.50.2
  Virtual router uptime: 01:46:05, Master router uptime: 01:46:02
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: enabled 
    Current priority: 120, Configured priority: 120 
    Priority hold time: disabled
    Interface tracking: enabled, Interface count: 1  
      Interface     Int state   Int speed   Incurred priority cost
      ge-0/0/1.0    up                 1g                       0
    Route tracking: disabled

lab@vMX-3> show vrrp track           
Track Int   State         Speed   VRRP Int   Group   VR State      Current prio
ge-0/0/1.0  up               1g   ge-0/0/2.0    50   master                 120 

lab@vMX-3> show vrrp track detail    
Tracked interface: ge-0/0/1.0  
  State: up, Speed: 1g
  Incurred priority cost: 0
  Tracking VRRP interface: ge-0/0/2.0, Group: 50        
    VR State: master  
    Current priority: 120, Configured priority: 120
    Priority hold-time: disabled

Let’s see how that changes when we disable interface ge-0/0/1.

On vMX-3 we can see the interface is down, and the show vrrp output shows it is now in the backup state.

lab@vMX-3> show interfaces ge-0/0/1 terse    
Interface               Admin Link Proto    Local                 Remote
ge-0/0/1                down  down
ge-0/0/1.0              up    down inet     10.100.2.2/24   
                                   multiservice

lab@vMX-3> show vrrp                         
Interface     State       Group   VR state VR Mode   Timer    Type   Address
ge-0/0/2.0    up             50   backup   Active      D  3.506 lcl    172.16.50.2    
                                                                vip    172.16.50.1    
                                                                mas    172.16.50.3    

On vMX-4 we can see it is now VRRP master.

lab@vMX-4> show vrrp 
Interface     State       Group   VR state VR Mode   Timer    Type   Address
ge-0/0/2.0    up             50   master   Active      A  0.624 lcl    172.16.50.3    
                                                                vip    172.16.50.1    

On vMX-3 the tracking information has changed as follows:

lab@vMX-3> show vrrp detail                  
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: backup, VRRP Mode: Active
  Priority: 90, Advertisement interval: 1, Authentication type: none
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Dead timer: 3.514s, Master priority: 100, Master router: 172.16.50.3 
  Virtual router uptime: 01:50:29
  Preferred: yes 
  Tracking: enabled 
    Current priority: 90, Configured priority: 120 
    Priority hold time: disabled
    Interface tracking: enabled, Interface count: 1  
      Interface     Int state   Int speed   Incurred priority cost
      ge-0/0/1.0    down               1g                      30
    Route tracking: disabled

lab@vMX-3> show vrrp track 
Track Int   State         Speed   VRRP Int   Group   VR State      Current prio
ge-0/0/1.0  down             1g   ge-0/0/2.0    50   backup                  90 

lab@vMX-3> show vrrp track detail 
Tracked interface: ge-0/0/1.0  
  State: down, Speed: 1g
  Incurred priority cost: 30
  Tracking VRRP interface: ge-0/0/2.0, Group: 50        
    VR State: backup  
    Current priority: 90, Configured priority: 120
    Priority hold-time: disabled

Note how the incurred priority cost has changed to 30, which has changed the current priority value.

Example 4 – Tracking A Route

In this example, we set vMX-3 to track the route 192.168.20.0/24 which it learns via OSPF. We need to specify the route to track, which routing instance it belongs to, and the priority cost if the route is removed.

lab@vMX-3> show configuration interfaces ge-0/0/2   
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
                preempt;
                accept-data;
                track {
                    route 192.168.20.0/24 routing-instance default priority-cost 30;
                }
            }
        }
    }
}

lab@vMX-3> show route 192.168.20.0/24 

inet.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.20.0/24    *[OSPF/10] 00:07:11, metric 30
                    >  to 10.100.2.1 via ge-0/0/1.0

Next, we see the current show vrrp detail, show vrrp track, and show vrrp track detail output.

lab@vMX-3> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 120, Advertisement interval: 1, Authentication type: none
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 0.216s, Master router: 172.16.50.2
  Virtual router uptime: 02:01:15, Master router uptime: 00:08:21
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: enabled 
    Current priority: 120, Configured priority: 120 
    Priority hold time: disabled
    Interface tracking: disabled
    Route tracking: enabled, Route count: 1  
      Route               VRF name     Route state      Priority cost  
      192.168.20.0/24     default      up                          30 

lab@vMX-3> show vrrp track 

Track route         State       Cost    Interface  Group   Cfg   Run   VR State
192.168.20.0/24     up            30    ge-0/0/2.0    50   120   120   master   

lab@vMX-3> show vrrp track detail 

Track route         State       Cost    Interface  Group   Cfg   Run   VR State
192.168.20.0/24     up            30    ge-0/0/2.0    50   120   120   master   

To simulate a routing failure, I disabled the ge-0/0/1.0 interface in the OSPF configuration. We again see that vMX-3 is now the backup and its current VRRP priority is 90.

lab@vMX-3> show vrrp detail              
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: backup, VRRP Mode: Active
  Priority: 90, Advertisement interval: 1, Authentication type: none
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Dead timer: 3.010s, Master priority: 100, Master router: 172.16.50.3 
  Virtual router uptime: 02:05:02
  Preferred: yes 
  Tracking: enabled 
    Current priority: 90, Configured priority: 120 
    Priority hold time: disabled
    Interface tracking: disabled
    Route tracking: enabled, Route count: 1  
      Route               VRF name     Route state      Priority cost  
      192.168.20.0/24     default      unknown                     30 

lab@vMX-3> show vrrp track 

Track route         State       Cost    Interface  Group   Cfg   Run   VR State
192.168.20.0/24     unknown       30    ge-0/0/2.0    50   120    90   backup   

lab@vMX-3> show vrrp track detail 

Track route         State       Cost    Interface  Group   Cfg   Run   VR State
192.168.20.0/24     unknown       30    ge-0/0/2.0    50   120    90   backup   
  

On vMX-4 we see it also believes it is the VRRP master.

lab@vMX-4> show vrrp    
Interface     State       Group   VR state VR Mode   Timer    Type   Address
ge-0/0/2.0    up             50   master   Active      A  0.238 lcl    172.16.50.3    
                                                                vip    172.16.50.1    

Example 5 – VRRP Authentication

To set up VRRP authentication you need to specify both the authentication type and the authentication key. Types of authentication are none, simple, or md5. The authentication needs to be configured the same on both VRRP routers or they will ignore each other’s advertisements and both act as the master.

This is the configuration for vMX-3. VMX-4 is configured exactly the same except it does not have the priority set.

lab@vMX-3> show configuration interfaces ge-0/0/2   
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
                preempt;
                accept-data;
                authentication-type md5;
                authentication-key "$9$JdUi.QF/0BEP5BEcyW8ZUj"; ## SECRET-DATA
            }
        }
    }
}

The show vrrp detail command confirms that we are using authentication and what type.

lab@vMX-3> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 120, Advertisement interval: 1, Authentication type: md5
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 0.146s, Master router: 172.16.50.2
  Virtual router uptime: 00:04:35, Master router uptime: 00:04:32
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: disabled 

Example 6 – Setting Advertisement Interval And Threshold

The backup VRRP router maintains a “Dead Timer”, if this expires it takes over as master. Every time it receives an advertisement it refreshes or restarts this timer. It is calculated by multiplying the advertisement interval and the advertisement threshold together.

By altering the advertisement timer and threshold values, we can control how quickly the VRRP mastership will failover between the VRRP routers.

When setting timers and thresholds, it becomes important to think about their impact on the device you configure them on. Factors to consider include:

  • Type of device. (How powerful is it?)
  • Frequency of timers (How often does it need to send VRRP advertisements?)
  • How many VRRP Groups do you have

On “smaller” devices, they may not be able to keep up with generating the advertisements if the timer values are small and there are a large number of VRRP groups configured. This might cause their VRRP partner to think they have failed when in reality they just can’t keep up with the VRRP messaging, and could lead to VRRP mastership flapping.

There are two ways of setting the advertisement interval. In either case, the timer must be set the same on both the VRRP routers.

To set an advertisement timer as a number of seconds, use advertise-interval as shown below. VMX-4 was configured with the same interval setting.

lab@vMX-3> show configuration interfaces ge-0/0/2  
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
                advertise-interval 2;
                preempt;
                accept-data;
                authentication-type md5;
                authentication-key "$9$JdUi.QF/0BEP5BEcyW8ZUj"; ## SECRET-DATA
            }
        }
    }
}

The results can be seen in the show vrrp detail output.

lab@vMX-3> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 120, Advertisement interval: 2, Authentication type: md5
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 1.354s, Master router: 172.16.50.2
  Virtual router uptime: 00:38:22, Master router uptime: 00:38:19
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: disabled 

To set an advertisement timer for less than a second we can set the fast-interval, where the value is in milliseconds.

lab@vMX-3> show configuration interfaces ge-0/0/2      
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
                fast-interval 250;
                preempt;
                accept-data;
                authentication-type md5;
                authentication-key "$9$JdUi.QF/0BEP5BEcyW8ZUj"; ## SECRET-DATA
            }
        }
    }
}

lab@vMX-3> show vrrp detail                          
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 120, Advertisement interval: 0.250, Authentication type: md5
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 0.186s, Master router: 172.16.50.2
  Virtual router uptime: 00:41:19, Master router uptime: 00:41:16
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: disabled 

In contrast to the timers, the threshold can be set differently on each VRRP router, but I wouldn’t recommend that.

Here we can see the vMX-4 where we have set the advertisement-threshold to 5.

lab@vMX-4> show configuration interfaces ge-0/0/2  
unit 0 {
    family inet {
        address 172.16.50.3/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                fast-interval 250;
                preempt;
                accept-data;
                authentication-type md5;
                authentication-key "$9$5znCO1hKMXtuMX7-2gTz3"; ## SECRET-DATA
                advertisements-threshold 5;
            }
        }
    }
}

This change is reflected in the show vrrp detail output.

lab@vMX-4> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.3/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: backup, VRRP Mode: Active
  Priority: 100, Advertisement interval: 0.250, Authentication type: md5
  Advertisement threshold: 5, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Dead timer: 1.796s, Master priority: 120, Master router: 172.16.50.2 
  Virtual router uptime: 00:42:58
  Preferred: yes 
  Tracking: disabled 

Example 7 – Bringing It All Together

This example brings together everything we have covered above. The configuration for interface ge-0/0/2 is also shown in set commands.

lab@vMX-3> show configuration interfaces ge-0/0/2    
unit 0 {
    family inet {
        address 172.16.50.2/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 120;
                fast-interval 100;
                preempt;
                accept-data;
                authentication-type md5;
                authentication-key "$9$JdUi.QF/0BEP5BEcyW8ZUj"; ## SECRET-DATA
                track {
                    interface ge-0/0/1 {
                        priority-cost 30;
                    }
                    route 192.168.20.0/24 routing-instance default priority-cost 30;
                }
            }
        }
    }
}
                                        
lab@vMX-3> show configuration interfaces ge-0/0/2 | display set 
set interfaces ge-0/0/2 mac aa:bb:dd:00:aa:20
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 virtual-address 172.16.50.1
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 priority 120
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 fast-interval 100
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 preempt
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 accept-data
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 authentication-type md5
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 authentication-key "$9$JdUi.QF/0BEP5BEcyW8ZUj"
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 track interface ge-0/0/1 priority-cost 30
set interfaces ge-0/0/2 unit 0 family inet address 172.16.50.2/24 vrrp-group 50 track route 192.168.20.0/24 routing-instance default priority-cost 30

lab@vMX-3> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.2/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 120, Advertisement interval: 0.100, Authentication type: md5
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 0.039s, Master router: 172.16.50.2
  Virtual router uptime: 04:17:09, Master router uptime: 04:17:06
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: enabled 
    Current priority: 120, Configured priority: 120 
    Priority hold time: disabled
    Interface tracking: enabled, Interface count: 1  
      Interface     Int state   Int speed   Incurred priority cost
      ge-0/0/1.0    up                 1g                       0
    Route tracking: enabled, Route count: 1  
      Route               VRF name     Route state      Priority cost  
      192.168.20.0/24     default      up                          30 

lab@vMX-3> show vrrp track  
Track Int   State         Speed   VRRP Int   Group   VR State      Current prio
ge-0/0/1.0  up               1g   ge-0/0/2.0    50   master                 120 

Track route         State       Cost    Interface  Group   Cfg   Run   VR State
192.168.20.0/24     up            30    ge-0/0/2.0    50   120   120   master   

lab@vMX-3> show vrrp track detail 
Tracked interface: ge-0/0/1.0  
  State: up, Speed: 1g
  Incurred priority cost: 0
  Tracking VRRP interface: ge-0/0/2.0, Group: 50        
    VR State: master  
    Current priority: 120, Configured priority: 120
    Priority hold-time: disabled

Track route         State       Cost    Interface  Group   Cfg   Run   VR State
192.168.20.0/24     up            30    ge-0/0/2.0    50   120   120   master  

Bonus Example – Using An Interface Address As The VIP

For one final example, we will reconfigure vMX-3 so that the interface address and the VIP are the same.

Since we are using the interface IP address as the VIP there are a few limitations. First, the priority must be set to 255, or else there is a commit error. You cannot configure tracking of interfaces or routes, these also cause a commit error.

This makes sense. When configured this way, the only time vMX-3 will not be the VRRP Master is if the router fails, or the interface goes down.

lab@vMX-3> show configuration interfaces ge-0/0/2  
unit 0 {
    family inet {
        address 172.16.50.1/24 {
            vrrp-group 50 {
                virtual-address 172.16.50.1;
                priority 255;
                fast-interval 100;
                preempt;
                accept-data;
                authentication-type md5;
                authentication-key "$9$JdUi.QF/0BEP5BEcyW8ZUj"; ## SECRET-DATA
            }
        }
    }
}

lab@vMX-3> show vrrp detail 
Physical interface: ge-0/0/2, Unit: 0, Address: 172.16.50.1/24
  Index: 335, SNMP ifIndex: 548, VRRP-Traps: disabled, VRRP-Version: 2
  Interface state: up, Group: 50, State: master, VRRP Mode: Active
  Priority: 255, Advertisement interval: 0.100, Authentication type: md5
  Advertisement threshold: 3, Computed send rate: 0
  Preempt: yes, Accept-data mode: yes, VIP count: 1, VIP: 172.16.50.1        
  Advertisement Timer: 0.081s, Master router: 172.16.50.1
  Virtual router uptime: 00:00:13, Master router uptime: 00:00:11
  Virtual Mac: 00:00:5e:00:01:32
  Preferred: yes 
  Tracking: disabled 

Leave a Comment

Your email address will not be published. Required fields are marked *