Friday, 4 January 2013

OSPF, NXOS v IOS, prefix-list, NOT access-list people!

Just ran into several of the differences between OSPF commands on NXOS v IOS.

I was trying to configure redistribute static routes. The eventual answer was simple, but took me some time to arrive at.

In short, when using OSPF on NXOS you use route-maps to filter for only the static routes you want to send out.  

The route-map is made up from a prefix-list, NOT an access-list, I started out using an access list, the results were unexpected. 

Basically the access list was not working, but because you have configured OSPF to use a route-map it defaults to allow all…  In my case, the static route was propagated to a neighbour on another site, ok it had a higher metric than gateway at the other site but it still made me panic briefly.

Below is a sample output that worked for me!

! Create the prefix-list.
ip prefix-list 10 seq 5 permit

! Create the route-map.
route-map OSPF-redist permit 10
  match ip address prefix-list 10

! Configure OSPF to redistribute static and filter using the new route-map.
router ospf 111
redistribute static route-map OSPF-redist

Confirm its working my looking at the OSPF database.

# show ip ospf database

1 comment:

  1. I think you can simplify your route-map, if you want to redistribute every connected subnet and static route. If you don't have *any* prefix-list (ie "no match ip address prefix-list 10"), it should match everything. If you want to specifically limit what you're advertising to just the one subnet in this example, that's what you're doing here.