Most things in networking are not revolutionary. No need to reinvent the wheel.

After many years of continuous growth of your backbone network, you might decide to clean up the mess and renumber the network within one single IP prefix covering the whole area. If OSPF is your choice for the interior routing protocol for IPv4, this is the right time to think again about using the OSPF network statements. A single network statement per router is all you need to make all the backbone interfaces seen by the OSPF process.
Here, for example, all the backbone is covered by a single prefix 10.0.0.0/8:
interface FastEthernet0/0
 ip address 10.1.0.0 255.255.255.254
!
router ospf 4
 passive-interface default
 no passive-interface FastEthernet0/0
 ! all backbone links are derived from 10.0.0.0/8
 network 10.0.0.0 0.255.255.255 area 0
!

What happens if we add another interface within the same global 10.0.0.0/8 to the OSPF, but we are putting it into a different OSPF area. For this exception we have to use a more specific network statement, for example:
interface Vlan991
 ip address 10.4.4.4 255.255.255.254
!
router ospf 4
 ! adding Vlan991 to area 4 with a /32 network statement
 no passive-interface Vlan991
 network 10.4.4.4 0.0.0.0 area 4
!

Will it work or will it cause conflict with the “network 10.0.0.0 0.255.255.255 area 0” statement?

Yes, it works as expected. The more specific network statement (the one with a /32 wildcard) takes precedence over the global one with a /8 wildcard:
router1(config)#interface Vlan991
router1(config-if)#ip address 10.4.4.4 255.255.255.254
% Warning: use /31 mask on non point-to-point interface cautiously
router1(config-if)#exit

router1(config)#router ospf 4
router1(config-router)#network 10.4.4.4 0.0.0.0 area 4
router1(config-router)#
Apr 17 18:39:06.808 UTC: %OSPF-6-AREACHG: 10.4.4.4/32 changed from area 0 to area 4
^Z
router1#show running-config partition router ospf 4
!
router ospf 4
 passive-interface default
 no passive-interface FastEthernet0/0
 no passive-interface Vlan991
 network 10.4.4.4 0.0.0.0 area 4
 network 10.0.0.0 0.255.255.255 area 0
!
end

A single network statement that covers all the backbone is a good choice if your network is neatly subneted. You can add exceptions with more specific network statements.

Looking for some best practices about using the OSPF networks statements, I’ve found out that Ivan Pepelnjak discussed that a few years ago in two of his own posts
Be smart when using the OSPF network statement and Network statements in the OSPF process are no longer order-dependent. I was amazed finding myself reinventing the wheel.


Ivan also suggests

If the router has all interfaces in a single area, I would almost always use network 0.0.0.0 255.255.255.255 area area-id (unless there is an extremely good reason that some interfaces should not be seen by the OSPF process).

Do you dare?

Advertisements