max-metric router-lsa (OSPFv2)

Advertises the maximum metric value in different Link State Advertisements (LSAs).
Syntax
max-metric router-lsa [ all-lsas ] [ all-vrfs ] [ external-lsa metric-value ] [ link { all | ptp | stub | transit } ] [ on-startup { time | wait-for-bgp } ] [ summary-lsa metric-value ] [ te-lsa metric-value ]
no max-metric router-lsa [ all-lsas ] [ all-vrfs ] [ external-lsa metric-value ] [ link { all | ptp | stub | transit } ] [ on-startup { time | wait-for-bgp } ] [ summary-lsa metric-value ] [ te-lsa metric-value ]
Parameters
all-lsas
Sets the external-lsa, summary-lsa, and te-lsa optional parameters to the corresponding default max-metric value.
all-vrfs
Applies the configuration change to all instances of OSPFv2.
external-lsa metric-value
Configures the maximum metric value for all external type-5 and type-7 LSAs. The range for metric value is 1 through 16777214 (0x00001 - 0x00FFFFFE), and the default is 16711680 (0x00FF0000).
link
Specifies the types of links for which the maximum metric is advertised. By default, the maximum metric is advertised only for transit links.
all
Advertises the maximum metric in Router LSAs for all supported link types.
ptp
Advertises the maximum metric in Router LSAs for point-to-point links.
stub
Advertises the maximum metric in Router LSAs for stub links.
transit
Advertises the maximum metric in Router LSAs for transit links. This is the default link type.
on-startup
Specifies the advertisement of the maximum metric for a limited period only, on startup.
time
Sets the time (in seconds) for which the specified links in Router LSAs are advertised when the metric is set to the maximum value of 0xFFFF. The range for time is 5 through 86400.
wait-for-bgp

Specifies that the maximum metric is advertised until BGP converges, or for 600 seconds.

summary-lsa metric-value
Configures the maximum metric value for all summary type 3 and type 4 LSAs. The range for metric value is 1 through 16777214 (0x00001 - 0x00FFFFFE), and the default is 16711680 (0x00FF0000).
te-lsa metric-value

Specifies that the TE metric field in the TE metric sub tlv for all type 10 Opaque LSAs LINK TLV originated by the router will be modified to the specified metric-value or a default value. The range for metric-value are 1 through 4294967295 (Hex: 0x00001 to 0xFFFFFFFF). The default value is 4294967295 (Hex: 0xFFFFFFFF). This parameter only applies to the default instance of OSPF.

Modes

OSPFv2 router configuration mode

OSPFv2 router VRF configuration mode

Usage Guidelines

Use this command to enable OSPFv2 to advertise its locally generated router LSAs with a maximum metric to direct transit traffic away from the device, while still routing for directly connected networks. By advertising the maximum metric, the device does not attract transit traffic.

Any new OSPFv2 instance configured after the max-metric configuration is completed requires that the max-metric command be configured again to take in the new OSPFv2 instance.

The no form of the command disables the advertising of the maximum metric value in different LSAs.

Examples

The following example turns off the advertisement of special metric values in all router, summary, and external LSAs.

device# configure terminal
device(config)# router ospf
device(config-ospf-router)# no max-metric router-lsa
 

The following example configures an OSPFv2 device to advertise a maximum metric for 72 seconds after a restart before advertising with a normal metric.

device# configure terminal
device(config)# router ospf
device(config-ospf-router)# max-metric router-lsa on-startup 72
 

The following example indicates that OSPF is being shutdown and that all links in the router LSA should be advertised with the value 0xFFFF and the metric value for all external and summary LSAs is set to 0xFF0000 until OSPF is restarted. This configuration will not be saved.

device# configure terminal
device(config)# ip router ospf
device(config-ospf-router)# max-metric router-lsa external-lsa summary-lsa link all