OSPF’s Maximum Metric

There are some situations where you just don’t want any traffic flowing through a particular router unless there are ABSOLUTELY NO other alternatives. How can we do that? Tell a particular router to advertise his/her LSAs with the maximum metric possible (0xFFFF).

There are several good reasons to make use of this feature listed here. I’m particularly fond of the third option, gracefully removing a router. This could also apply to maintenance windows. If I know I’m going to be knocking out a transit link, I could force neighboring routers to recalculate a next-hop before I knock out the link. This way no packets are black-holed while SPF calculations are performed.

Assume I need to get from R0 to R3 (1.2.3.4) and my only transit routers are R1 and R2. R0 is currently using CEF to load-balance over the two paths:

R0#sh ip route 1.2.3.4
Routing entry for 1.2.3.4/32
  Known via "ospf 1", distance 110, metric 21, type intra area
  Last update from 1.1.1.1 on FastEthernet0/0, 00:00:27 ago
  Routing Descriptor Blocks:
  * 1.1.1.3, from 1.1.1.5, 00:00:27 ago, via FastEthernet0/1
      Route metric is 21, traffic share count is 1
    1.1.1.1, from 1.1.1.5, 00:00:27 ago, via FastEthernet0/0
      Route metric is 21, traffic share count is 1

R0#

If I were to unplug R1 without warning, a packet or two might be on its way from R0 to R1 to R3, only to die at R1 due to a power loss. Instead, I’ll tell R1 to advertise the maximum possible metric:

R1(config)#router ospf 1
R1(config-router)#max-m
R1(config-router)#max-metric ?
  router-lsa  Maximum metric in self-originated router-LSAs

R1(config-router)#max-metric ro
R1(config-router)#max-metric router-lsa ?
  external-lsa  Override external-lsa metric with max-metric value
  include-stub  Set maximum metric for stub links in router-LSAs
  on-startup    Set maximum metric temporarily after reboot
  summary-lsa   Override summary-lsa metric with max-metric value
  

R1(config-router)#max-metric router-lsa 

Now on R0 there’s only one route to 1.2.3.4 because the metric in R1’s LSA is 65535:

R0#sh ip route 1.2.3.4
Routing entry for 1.2.3.4/32
  Known via "ospf 1", distance 110, metric 21, type intra area
  Last update from 1.1.1.3 on FastEthernet0/1, 00:02:58 ago
  Routing Descriptor Blocks:
  * 1.1.1.3, from 1.1.1.5, 00:02:58 ago, via FastEthernet0/1
      Route metric is 21, traffic share count is 1

R0#
R0#sh ip o d ro 5.5.5.5

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Router Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 211
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 5.5.5.5
  Advertising Router: 5.5.5.5
  LS Seq Number: 80000012
  Checksum: 0x109D
  Length: 60
  Area Border Router
  Number of Links: 3

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 1.1.1.6
     (Link Data) Router Interface address: 1.1.1.6
      Number of TOS metrics: 0
       TOS 0 Metrics: 65535



R0#

This will be handy.

Tagged with:

One comment

  • Where are the updates to this site? I miss the dry wit and precise, quantitative solutions to inefficiency that it offered.

Leave a Reply

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