Sunday, June 15, 2008

OSPF - Limiting number of redistributed routes

This short lab uses the topology of previous OSPF posts:

R2 ---> R5 in area 25
R5 ---> R4 in area 0
R4 ---> R3 in area 345

Area 25 is an NSSA.
R2 is an ASBR redistruting connected and static routes into OSPF:

R2#show run | section router ospf
router ospf 1
log-adjacency-changes
area 25 nssa
redistribute connected subnets tag 100
redistribute static metric-type 1 subnets tag 200
network 172.12.25.0 0.0.0.255 area 25

static: 1.1.1.1, 192.168.254.0
connected 2.2.2.2-5, 172.12.123.0

These routes are tagged with 100 and 200 respectively for easy filtering. Below is the database on R4, we have 7 LSA's:

R4#show ip ospf database | inc 100|200
1.1.1.1 5.5.5.5 48 0x80000001 0x00BD82 200
2.2.2.2 5.5.5.5 48 0x80000001 0x00041C 100
2.2.2.3 5.5.5.5 48 0x80000001 0x00F925 100
2.2.2.4 5.5.5.5 48 0x80000001 0x00EF2E 100
2.2.2.5 5.5.5.5 48 0x80000001 0x00E537 100
172.12.123.0 5.5.5.5 48 0x80000001 0x00BC37 100
192.168.254.0 5.5.5.5 48 0x80000001 0x004596 200

Let's configure a redistribution limit on R2:

R2(config)#router ospf 1

R2(config-router)#redistribute maximum-prefix ?
<1-4294967295> Maximum number of IP prefixes redistributed

R2(config-router)#redistribute maximum-prefix 4 ?
<1-100> Threshold value (%) at which to generate a warning message
warning-only Only give warning message when limit is exceeded

R2(config-router)#redistribute maximum-prefix 4 50

Now wait a few moments and the following message appears on R2:

Mar 1 02:21:01.775: %IPRT-4-REDIST_THR_PFX: Redistribution prefix threshold has been reached "ospf 1" - 2 prefixes
Mar 1 02:21:01.783: %IPRT-4-REDIST_MAX_PFX: Redistribution prefix limit has been reached "ospf 1" - 4 prefixes

The threshold was reached at 50% of 4 (2 routes). The maximum limit was reached shortly thereafter. Let's check R4 to see how many external LSA's it has now:

R4#show ip ospf database | inc 100|200
1.1.1.1 5.5.5.5 92 0x80000001 0x00BD82 200
2.2.2.2 5.5.5.5 92 0x80000001 0x00041C 100
2.2.2.3 5.5.5.5 92 0x80000001 0x00F925 100
2.2.2.4 5.5.5.5 92 0x80000001 0x00EF2E 100

Only 4 show up the rest have been filtered. We can also set up R2 to only give a warning and not actually limit the redistribution of the routes:

R2(config-router)#redistribute maximum-prefix 4 50 warning-only
Mar 1 02:23:53.487: %IPRT-4-REDIST_THR_PFX: Redistribution prefix threshold has been reached "ospf 1" - 2 prefixes
Mar 1 02:23:53.495: %IPRT-4-REDIST_MAX_PFX: Redistribution prefix limit has been reached "ospf 1" - 4 prefixes

Warning only, no filtering:

R4#show ip ospf database | inc 100|200
1.1.1.1 5.5.5.5 43 0x80000001 0x00BD82 200
2.2.2.2 5.5.5.5 43 0x80000001 0x00041C 100
2.2.2.3 5.5.5.5 43 0x80000001 0x00F925 100
2.2.2.4 5.5.5.5 43 0x80000001 0x00EF2E 100
2.2.2.5 5.5.5.5 43 0x80000001 0x00E537 100
172.12.123.0 5.5.5.5 43 0x80000001 0x00BC37 100
192.168.254.0 5.5.5.5 43 0x80000001 0x004596 200

Note that this command doesn't require you to clear ospf but it can take a few moments (20+ seconds) if you don't.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.