Sunday, November 2, 2008

VRRP - Tracking the metric of a route

R5 and R6 are configured for VRRP on a LAN. R5 is to be the master unless its route to 172.30.21.0/24 disappears or its metric increases.

Here is the basic VRRP config on R5:

interface FastEthernet0/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 need to figure out the metric threshold for the network we are tracking. Let's find our metric first:

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


Here we see our metric is 65. This will be our "UP" metric and anything above this will be our down metric. Let's configure the tracking object:

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


Now let's check the state of our tracked object:

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


Let's increase our metric to 66. The route is learned via OSPF on inerface serial 0/1/0 so it is easy to change:

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


Notice we are back up now...what is the state of our tracked object?

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


It is DOWN! Let's bring it up:

IPeR5(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
IPeR5#


Remember to be patient. The object may take 20-30 seconds to change state after the metric is changed.

7 comments:

  1. Perfect article explaining the metric threshold option. I was pulling my hair out trying to understand what cisco meant by scaling and other blah blah in their online documentation

    Thanks for explaining this.

    ReplyDelete
  2. very very nice & enough for strong concept

    ReplyDelete
  3. Expert article on this topic. Thank you for writing it, have been searching all over for a clear explanation and finally found it here.

    ReplyDelete
  4. This article is awesome! you rock mate!!!

    ReplyDelete
  5. I Just want to explain how the metric threshold works.

    1. First normalizing the metric means dividing it by 256. There are two cases
    1a.Say EIGRP Metric of 15616/256 = 61 This is your metric threshold
    1b.Say EIGRP Metric of 156160/256 = 610, Cisco IOS would truncate this to 61 which would be your metric threshold because this is above 255 max metric threshold limit.

    2. Given that your metric threshold is 61. Your metric threshold status would be UP only if the value is "LESS THAN OR EQUAL TO T0 THE UP VALUE".
    2a. If UP value is 65, DOWN value is 70 >>> Status is UP
    2b. If UP value is 60, DOWN value is 70 >>> Status is DOWN
    2c. If UP value is 61, DOWN value is 70 >>> Status is UP
    2d. If UP value is 50, DOWN value anything above and equal to 61 >>> Status is DOWN.

    ReplyDelete

Note: Only a member of this blog may post a comment.