Table of Contents
redistribute maximum-prefix command
Use the redistribute maximum-prefix command to prevent an unexpectedly large amount of route information from being redistributed to OSPF due to a configuration error.
With the redistribute maximum-prefix command, you can determine the maximum amount of route information that will be redistributed to OSPF from other routing protocols (routing processes).
redistribute maximum-prefix command syntax
The redistribute maximum-prefix command is configured in OSPF configuration mode.
(config)#router ospf <process-id>
(config-router)#redistribute maximum-prefix <maximum> [<threshold>] [warning-only]
<process-id> : OSPF process id
<maximum> : Upper limit of routes to be redistributed. (Percentage)
<threshold> : Threshold for generating a warning message
The command format is very simple. Basically, you just use <maximum> to determine the upper limit of routes that will be redistributed to OSPF. <threshold> determines the threshold at which warning messages are generated. The default value for <threshold> is 75 (%), rounded down to the nearest whole number.
Also, if you add the warning-only option, just generate a warning message and it will be redistributed to OSPF even if the configured limit is exceeded.
redistribute maximum-prefix command configuration example
In the following simple network diagram, use the redistribute maximum-prefix command to limit the routes that are redistributed to OSPF.
Redistribute to OSPF on R1. The routing process of the redistribution source is connected.
When there is no limit
10.1.1.0/24 to 10.1.6.0/24 are the connected route information of the IP address configured in R1’s Lo0. Connected route informations in R1 are redistributed to OSPF.
R1
interface Loopback0 ip address 10.1.2.1 255.255.255.0 secondary ip address 10.1.3.1 255.255.255.0 secondary ip address 10.1.4.1 255.255.255.0 secondary ip address 10.1.5.1 255.255.255.0 secondary ip address 10.1.6.1 255.255.255.0 secondary ip address 10.1.1.1 255.255.255.0 ! router ospf 1 redistribute connected subnets
The OSPF LSDB has six route information registered for LSA type 5, from 10.1.1.0/24 to 10.1.6.0/24.
R1
R1#show ip ospf database OSPF Router with ID (1.1.1.1) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1.1 1.1.1.1 213 0x80000003 0x007DBC 1 2.2.2.2 2.2.2.2 214 0x80000002 0x003BF8 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.12.1 1.1.1.1 213 0x80000001 0x00C7EB Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.1.1.0 1.1.1.1 272 0x80000001 0x003060 0 10.1.2.0 1.1.1.1 272 0x80000001 0x00256A 0 10.1.3.0 1.1.1.1 272 0x80000001 0x001A74 0 10.1.4.0 1.1.1.1 272 0x80000001 0x000F7E 0 10.1.5.0 1.1.1.1 272 0x80000001 0x000488 0 10.1.6.0 1.1.1.1 272 0x80000001 0x00F892 0
Configuring redistribute maximum-prefix command
The maximum limit of route information to be redistributed to OSPF is configured to be 5 with the redistribute maximum-prefix command.
R1
router ospf 1 redistribute maximum-prefix 5
If the maximum amount of route information to be redistributed is set to 5, the following message will be displayed in the console.
*Mar 1 00:08:28.755: %IPRT-4-REDIST_THR_PFX: Redistribution prefix threshold has been reached "ospf 1" - 3 prefixes *Mar 1 00:08:28.759: %IPRT-4-REDIST_MAX_PFX: Redistribution prefix limit has been reached "ospf 1" - 5 prefixes
The threshold for generating a warning message is 5*0.75=3 (rounded down to the nearest whole number). 3 or more routes are redistributed and a warning message is generated. Looking at the LSDB of R1, there are only 5 routes redistributed from connected.
R1
R1#show ip ospf database OSPF Router with ID (1.1.1.1) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1.1 1.1.1.1 260 0x80000004 0x0085B2 1 2.2.2.2 2.2.2.2 267 0x80000003 0x0043EE 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.12.2 2.2.2.2 267 0x80000001 0x008F1F Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.1.1.0 1.1.1.1 252 0x80000001 0x003060 0 10.1.2.0 1.1.1.1 252 0x80000001 0x00256A 0 10.1.3.0 1.1.1.1 252 0x80000001 0x001A74 0 10.1.5.0 1.1.1.1 252 0x80000001 0x000488 0 10.1.6.0 1.1.1.1 252 0x80000001 0x00F892 0
warning-only option
Add the warning-only option to the redistribute maximum-prefix command.
R1
router ospf 1 redistribute maximum-prefix 5 warning-only
The message generated to the console is the same.
*Mar 1 00:16:45.791: %IPRT-4-REDIST_THR_PFX: Redistribution prefix threshold has been reached "ospf 1" - 3 prefixes *Mar 1 00:16:45.795: %IPRT-4-REDIST_MAX_PFX: Redistribution prefix limit has been reached "ospf 1" - 5 prefixes
If you look at the LSDB of R1, you can see that by adding the warning-only option, it is redistributed even if the limit is exceeded.
R1
R1#show ip ospf database OSPF Router with ID (1.1.1.1) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1.1 1.1.1.1 84 0x80000005 0x0083B3 1 2.2.2.2 2.2.2.2 580 0x80000003 0x0043EE 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.12.2 2.2.2.2 580 0x80000001 0x008F1F Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 10.1.1.0 1.1.1.1 69 0x80000001 0x003060 0 10.1.2.0 1.1.1.1 69 0x80000001 0x00256A 0 10.1.3.0 1.1.1.1 69 0x80000001 0x001A74 0 10.1.4.0 1.1.1.1 69 0x80000001 0x000F7E 0 10.1.5.0 1.1.1.1 69 0x80000001 0x000488 0 10.1.6.0 1.1.1.1 69 0x80000001 0x00F892 0
How the OSPF works
- OSPF Overview
- OSPF process flow
- OSPF Router ID : Identify OSPF routers
- What if the router ID of the OSPF router is duplicated?
- OSPF Neighbor and Adjacency
- OSPF DR/BDR
- How show ip ospf neighbor looks on Ethernet
- OSPF Network Type : Classification of OSPF-enabled interfaces
- Synchronization process of OSPF LSDB
- Problems with large-scale OSPF network
- OSPF Area – Inside the area, in detail; outside the area, just a summary
- OSPF Router Type
- OSPF LSA Type
- OSPF Area Type
- OSPF Basic Configuration and Verification Commands
- Details of enabling OSPF on the interface
- OSPF Advertising Loopback Interface
- Configuring and Verifying OSPF Hello/Dead interval
- OSPF Cost Configuration and Verification
- Configuring and Verifying OSPF Router Priority
- Configuring OSPF Neighbor Authentication
- Neighbor Authentication over Virtual-link
- OSPF Configuring and Verifying Stub area [Cisco]
- OSPF Stub Area Configuration Example [Cisco]
- OSPF default route generation : default-information originate command
- Configuration Example of OSPF default route generation : stub area
- OSPF Virtual-Link : Virtual area 0 point-to-point link
- Configuring and Verifying OSPF Virtual-link [Cisco]
- OSPF Virtual-link Configuration Example [Cisco]
- OSPF Virtual-link for discontinuous backbone configuration example
- OSPF Route Summary and Configuration
- Cisco OSPF Route Summary Configuration Example
- OSPF Route Type Preference
- Why the OSPF neighbor state gets stuck in Exstart?
- OSPF packet type and header format
- OSPF Hello Packet
- OSPF DD(Database Description) Packet
- OSPF LSR(Link State Request) Packet
- OSPF LSU(Link State Update) Packet
- OSPF LSAck(Link State Acknowledgement) Packet
- Limitation of OSPF redistribution routes – redistribute maximum-prefix command
- Overview of LSA Filters for OSPF – Filter LSA Type 3/Type 5
- Configuration example of LSA type 3 filter
- Configuration example of LSA type 5 filter
- OSPFv3 Configuration Example [Cisco]
- Configuration Example of OSPFv3 Route Summary [Cisco]