Order of OSPF Network Statements

Unanswered Question
Aug 26th, 2007

Does the order of OSPF network statements matter ? Ie. do they work like an ACL where more specific statements must come come before more general ones ?

For example is there any difference between entering :-

network area 40

network area 20


network area 20

network area 40

Will these work the same way and remove interfaces in subnet from area 20 and place them in area 40 ? Ie. will the more SPECIFIC network statement take precedence in either case, and the order these statements appear in the configuration is irrelevant ? In other words it doesn't function like an ACL (which applies whichever network statement matches first in the list).

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Pavel Bykov Sun, 08/26/2007 - 11:08

I tested it, and it works with LOGEST PREFIX MATCH. ie, more specific match wins.

BUT, it also automatically reorders all the entries, placing more specific matches at the beginning of configuration, and less specific matches towards the end of configuration.

I have to warn though - this is not a good design practice, as it may depend on vendor implementation.

Hope this helps.

Please rate all helpful posts.

sundar.palaniappan Sun, 08/26/2007 - 14:02

In the older IOS the network statement was matched against the interface address in the order (top-down) in which it's configured and the interface is assigned to the appropriate area. This behavior is similar to the access list matching. In this situation a more specific network statement configured down in the order would be ignored by the router in a favor of a less specific network statement configured at the top of the list.

However, in the newer IOS I believe the router reorders the network statement, as confirmed by Pavlo, from more specific to less specific irrespective of what order you have configured the network statements.

I would suggest that you always issue the command 'show ip ospf interfaces' to confirm whether the interfaces are assigned to the appropriate area that it should be part of.




This Discussion