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 (18.104.22.168) 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 22.214.171.124 Routing entry for 126.96.36.199/32 Known via "ospf 1", distance 110, metric 21, type intra area Last update from 188.8.131.52 on FastEthernet0/0, 00:00:27 ago Routing Descriptor Blocks: * 184.108.40.206, from 220.127.116.11, 00:00:27 ago, via FastEthernet0/1 Route metric is 21, traffic share count is 1 18.104.22.168, from 22.214.171.124, 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 <cr> R1(config-router)#max-metric router-lsa
Now on R0 there’s only one route to 126.96.36.199 because the metric in R1’s LSA is 65535:
R0#sh ip route 188.8.131.52 Routing entry for 184.108.40.206/32 Known via "ospf 1", distance 110, metric 21, type intra area Last update from 220.127.116.11 on FastEthernet0/1, 00:02:58 ago Routing Descriptor Blocks: * 18.104.22.168, from 22.214.171.124, 00:02:58 ago, via FastEthernet0/1 Route metric is 21, traffic share count is 1 R0# R0#sh ip o d ro 126.96.36.199 OSPF Router with ID (188.8.131.52) (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: 184.108.40.206 Advertising Router: 220.127.116.11 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: 18.104.22.168 (Link Data) Router Interface address: 22.214.171.124 Number of TOS metrics: 0 TOS 0 Metrics: 65535 <!-- output omitted --> R0#
This will be handy.