redistribute maximum-prefix (OSPF)

To limit the number of routes redistributed into Open Shortest Path First (OSPF), use the redistribute maximum-prefix command. To return to the default setting, use the no form of this command.

redistribute maximum-prefix max [threshold] [warning-only | withdraw [num-retries timeout]]

no redistribute maximum-prefix max [threshold] [warning-only | withdraw
num-retries timeout]

Syntax Description


Maximum number of prefixes that OSPF will distribute. The range is from 0 to 65535.


(Optional) Percentage of maximum prefixes that triggers a warning message. The range is from 1 to 100. The default is 75 percent.


(Optional) Logs a warning message when the maximum number of prefixes is exceeded.


(Optional) Withdraws all redistributed routes.


(Optional) Number of times OSPF tries to retrieve the redistributed routes. The range is from 1 to 12. The default is 1.


(Optional) Time between retry attempts. The range is from 60 to 600 seconds. The default is 300.

Command Default

No limit

Command Modes

Router configuration mode
VRF configuration mode

Command History



This command was introduced.

Usage Guidelines

Use the clear ip ospf redistribute command if all routes are withdrawn.

This command requires the LAN Base Services license.


This example shows how to limit the number of redistributed routes into OSPF:

switch# config t
switch(config)# router ospf 201
switch(config-router)# redistribute bgp route-map FilterExternalBGP
switch(config-router)# redistribute maximum-prefix 1000 75

Related Commands


copy running-config startup-config

Saves the configuration changes to the startup configuration file.

show ip ospf

Displays OSPF information.

show running-config ospf

Displays the OSPF running configuration.