OSPFv2 Stub Router Commands

Use these commands to configure OSPFv2 stub router advertisement.

Note: Open Shortest Path First (OSPF) commands are supported on the M4350 series switches only. The M4250 series switches do not support OSPF.

max-metric router-lsa (Router OSPF Config)

M4350

To configure OSPF to enter stub router mode, use this command in Router OSPF Configuration mode. When OSPF is in stub router mode, as defined by RFC 3137, OSPF sets the metric in the nonstub links in its router LSA to LsInfinity. Other routers therefore compute very long paths through the stub router, and prefer any alternate path. Doing so eliminates all transit traffic through the stub router, when alternate routes are available. Stub router mode is useful when adding or removing a router from a network or to avoid transient routes when a router reloads.

You can administratively force OSPF into stub router mode. OSPF remains in stub router mode until you take OSPF out of stub router mode. Alternatively, you can configure OSPF to start in stub router mode for a configurable period of time after the router boots up.

If you set the summary LSA metric to 16,777,215, other routers will skip the summary LSA when they compute routes.

If you have configured the router to enter stub router mode on startup and then enter the max-metric router-lsa command, there is no change. If OSPF is administratively in stub router mode (that is, you entered the max-metric router-lsa command), and you configure OSPF to enter stub router mode on startup (that is, the switch enters the max-metric router-lsa command on startup), OSPF exits stub router mode (assuming that the startup period has expired) and the configuration is updated.

Default OSPF is not in stub router mode by default
Format max-metric router-lsa [on-startup seconds] [summary-lsa metric]
Mode Router OSPF Config
Parameter Description
on-startup (Optional) OSPF starts in stub router mode after a reboot.
seconds (Required if on-startup) The number of seconds that OSPF remains in stub router mode after a reboot. The range is 5 to 86,400 seconds. There is no default value.
summary-lsa (Optional) Set the metric in type 3 and type 4 summary LSAs to LsInfinity (0xFFFFFF).
metric (Optional) Metric to send in summary LSAs when in stub router mode. The range is 1 to 16,777,215. The default is 16,711,680 (0xFF0000).

no max-metric router-lsa

Use this command in Router OSPF Config mode to disable stub router mode. The command clears either type of stub router mode (always or on-startup) and resets the summary-lsa option. If OSPF is configured to enter global configuration mode on startup, and during normal operation you want to immediately place OSPF in stub router mode, issue the no max-metric router-lsa on-startup command. The no max-metric router-lsa summary-lsa command causes OSPF to send summary LSAs with metrics computed using normal procedures defined in RFC 2328.

Format no max-metric router-lsa [on-startup] [summary-lsa]
Mode Router OSPF Config

clear ip ospf stub-router

M4350

This command forces OSPF to exit stub router mode when it has automatically entered stub router mode because of a resource limitation. OSPF only exits stub router mode if it entered stub router mode because of a resource limitation or if it is in stub router mode at startup. If OSPF is configured to function permanently in stub router mode, the command does not take effect.

Format clear ip ospf stub-router
Mode Privileged EXEC