Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Order of OSPF Network Statements

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 192.168.129.96 0.0.0.3 area 40

network 192.168.128.0 0.0.127.255 area 20

and

network 192.168.128.0 0.0.127.255 area 20

network 192.168.129.96 0.0.0.3 area 40

Will these work the same way and remove interfaces in subnet 192.168.129.96/30 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).

2 REPLIES
Silver

Re: Order of OSPF Network Statements

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.

Re: Order of OSPF Network Statements

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.

HTH

Sundar

187
Views
9
Helpful
2
Replies
CreatePlease to create content