cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1541
Views
0
Helpful
9
Replies

Redistribute Static to OSP via Prefix list not working!

graham smart
Level 1
Level 1

Hi guys,

I have like the simplest form of redistribution setup in a test lab but cant seem to get it to work correctly:

router ospf 1

redistribute static subnets route-map STATIC-TO-OSPF

ip route 123.0.0.0 255.255.255.0 10.100.0.18

!

!

route-map STATIC-TO-OSPF permit 1

match ip address prefix-list STATIC-PREFFERED-RTR1

set metric 10000 10 255 1 150

!

route-map STATIC-TO-OSPF permit 2

match ip address prefix-list STATIC-PREFFERED-RTR2

set metric 10000 20 255 1 150

!

However, With this setup, It still advertises the 123.0.0.0  subnet.

How do I get it to NOT do this?

I add the

ip prefix-list STATIC-PREFFERED-RTR1 seq 10 deny 0.0.0.0/0 le 32

And yet it still advertises the 123.0.0.0 subnet?!?

Clearly its ignoring the prefix list?

Any help would be epic.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

1 Accepted Solution

Accepted Solutions

Put those what you want in prefix-list...for example if you have:

ip route 10.10.1.0 255.255.255.0

ip route 10.10.2.0 255.255.255.0

ip route 10.10.3.0 255.255.255.0

And you want to redistribute only 1 and 3 statement:

ip prefix-list STATIC-PREFFERED-RTR1 permit ip 10.10.1.0/24

ip prefix-list STATIC-PREFFERED-RTR2 permit ip 10.10.3.0/24

And then use this lists in your route-map...

There are also many other options but this could be one of them...

HTH,
Dragan

HTH,
Dragan

View solution in original post

9 Replies 9

Peter Paluch
Cisco Employee
Cisco Employee

Graham,

Can you perhaps post the entire prefix lists? Thanks!

Best regards,

Peter

That is it.

When I add the denys to the prefix list ( to not allow ANY statics for the moment )

The prefix lists vanish from the running config ( I assume deny is implied? )

yet, It still allows any static to be redistributed..

This is all my routing config and prefix list config.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

graham smart
Level 1
Level 1

Ok, maybe not.

Im being stupid..

I want to have two prefix lists. These will contain statics I want to redistribute.

However, I cannot for the life of me get it to work correctly.

if i place a deny in the first prefix list, then it matches everything and the second one is never looked at?

route-map STATIC-TO-OSPF permit 1

match ip address prefix-list STATIC-PREFFERED-RTR1

set metric 10000 10 255 1 150

!

route-map STATIC-TO-OSPF permit 2

match ip address prefix-list STATIC-PREFFERED-RTR2

set metric 10000 20 255 1 150

!

route-map STATIC-TO-OSPF deny 3

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

Right - because you have positive match second one is not going to be evaluated...you must be more specific in it.

HTH,
Dragan

HTH,
Dragan

Any ideas how to do this?

If I dont match on the first, It never goes on to the second because it thinks it matched nothing.

Arrge

This si driving me crazy..

I have a bunch of statics that I dont want to be redistributed, but some that I do ( in either the RTR1 or RTR2 route map. )

This is driving me absolutely crazy.

It seems like there is no way around this..

Needs to be almost.

If IP is not in list 1, move on to route map 2.

If IP is not in list 2, deny anything else.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

Put those what you want in prefix-list...for example if you have:

ip route 10.10.1.0 255.255.255.0

ip route 10.10.2.0 255.255.255.0

ip route 10.10.3.0 255.255.255.0

And you want to redistribute only 1 and 3 statement:

ip prefix-list STATIC-PREFFERED-RTR1 permit ip 10.10.1.0/24

ip prefix-list STATIC-PREFFERED-RTR2 permit ip 10.10.3.0/24

And then use this lists in your route-map...

There are also many other options but this could be one of them...

HTH,
Dragan

HTH,
Dragan

Thanks,

The problem I have is that in some places, the prefix list may be empty at the moment..

Does adding the deny 0.0.0.0/0 atthe end cause any issues? Because without it, Its allowing everything through.

ip route 120.0.0.0 255.255.255.0 10.100.0.18

ip route 123.0.0.0 255.255.255.0 10.100.0.18

ip route 123.123.0.0 255.255.255.0 10.100.0.18

!

!

ip prefix-list STATIC-PREFFERED-RTR1 seq 4 permit 123.123.0.0/24

ip prefix-list STATIC-PREFFERED-RTR1 seq 5 deny 0.0.0.0/0

!

ip prefix-list STATIC-PREFFERED-RTR2 seq 10 deny 0.0.0.0/0

!

route-map STATIC-TO-OSPF permit 1

match ip address prefix-list STATIC-PREFFERED-RTR1

set metric 10000 10 255 1 150

set metric-type internal

!

route-map STATIC-TO-OSPF permit 2

match ip address prefix-list STATIC-PREFFERED-RTR2

set metric 10000 20 255 1 150

!

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

graham smart
Level 1
Level 1

For exmaple. I need to do it like this otherwise it doesnt work.

Does this seem sensible?

ip prefix-list STATIC-PREFFERED-RTR1 seq 10 deny 0.0.0.0/0

!

ip prefix-list STATIC-PREFFERED-RTR2 seq 5 permit 123.123.0.0/24

ip prefix-list STATIC-PREFFERED-RTR2 seq 10 deny 0.0.0.0/0

!

route-map STATIC-TO-OSPF permit 1

match ip address prefix-list STATIC-PREFFERED-RTR1

set metric 10000 10 255 1 150

set metric-type internal

!

route-map STATIC-TO-OSPF permit 2

match ip address prefix-list STATIC-PREFFERED-RTR2

set metric 10000 20 255 1 150

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

graham smart
Level 1
Level 1

Right,

Thanks guys,

I think I have it licked now.

Ill just have the deny 0.0.0.0/0 at the end of each list ( even ones not having any IP's in them )

Looks like I ws getting muddled with empty prefix lists allowing all.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

Review Cisco Networking products for a $25 gift card