VRRP – Tracking the metric of a route

By | January 7, 2022

We are having two routers as below and VRRP is configured for LAN. R1 is to be the master unless its route to 172.30.21.0/24 disappears or its metric increases.

R1—————————–R2
| |
|————–SW————-|

Below is basic VRRP configuration on R1:

interface F0/0
ip address 172.30.200.5 255.255.255.0
vrrp 1 ip 172.30.200.1
vrrp 1 priority 105
vrrp 1 authentication ipexpert

Now we will figure out the metric threshold for the network 172.30.21.0 which we are tracking.

Let’s find our metric first:

R1#show ip route 172.30.21.0 | in metric
Known via "ospf 1", distance 80, metric 65, type inter area
Advertised by eigrp 1 metric 1 1 1 1 1 route-map OSPF2EIGRP
Route metric is 65, traffic share count is 1
R1#

we see metric is 65. This will be our lowest metric and anything above this will be our higher metric. Lowest metric is more preferable and higher metric means less preferable.

Lowest Metric = UP

Higher Metric = DOWN

Let’s configure the tracking object:

R1(config)#track 2 ip route 172.30.21.0/24 metric threshold
R1(config-track)#threshold metric ?
down Down threshold
up Up threshold
R1(config-track)#threshold metric up 65 down 66
R2(config-track)#int f0/0
R1(config-if)#vrrp 1 track 2

Now let’s check the state of tracked object:

R1#show track 2
Track 2
IP route 172.30.21.0 255.255.255.0 metric threshold
Metric threshold is Up (OSPF/65/65)
8 changes, last change 00:02:04
Metric threshold down 66 up 65
First-hop interface is Serial0/1/0
Tracked by:
VRRP FastEthernet0/0 1
R1#

Let’s increase the metric to 66. The route is learning via OSPF on interface serial 0/1/0.

R1(config)#interface s0/1/0
R1(config-if)#ip ospf cost 65
R1#
*Nov 2 22:59:35.437: %VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Master -> Backup
R1#

Have you Noticed, we are back to up now…what is the state of our tracked object?

R1#show track 2
Track 2
IP route 172.30.21.0 255.255.255.0 metric threshold
Metric threshold is Down (OSPF/66/66)
9 changes, last change 00:00:42
Metric threshold down 66 up 65
First-hop interface is Serial0/1/0
Tracked by:
VRRP FastEthernet0/0 1
R1#

It went DOWN. Let’s bring it up:

R1(config-if)#ip ospf cost 64
IPeR5(config-if)#^Z
*Nov 2 23:01:05.029: %VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Backup -> Master
R1#

Please note that object may take 20 to 30 seconds to change the state post changed the metric.

Thanks for visiting ……………..

Recommended Links:

Leave a Reply

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