During my journey of CCIE, I noticed an OSPF feature worth of sharing. In Core/IGP routing, instead of typing a lot in network commands in OSPF, we can just use network 0.0.0.0 255.255.255.255 and more surprisingly 0.0.0.0 0.0.0.0.
Once you enter all zeroes, running-config will convert it to quad 0 followed by quad 255. We can also use 0.0.0.0 0.0.0.0. It just includes all interfaces the same way as if you do 0.0.0.0 255.255.255.255.
Below is the practical demonstration:
If the router has all interfaces in a single area, I always use network 0.0.0.0 255.255.255.255 area area-id.
Since, OSPF network command uses the following syntax:
network ip-address wildcard-mask area area-id
This combination of ip+wildcard mask allows us to specify interfaces with one statement and assign them to the specified OSPF area. In essence, the Cisco IOS software evaluates the ip+wildcard-mask pair for each interface in the following manner:
- Logically OR the wildcard-mask argument with the interface IP address
- Logically OR the wildcard-mask argument with the ip argument in the network command
- Result of Software comparison of the two. If they match, OSPF is enabled on the associated interface and this interface is attached to the OSPF area specified.
In short, we always encounter three scenarios, when configuring OSPF on IP devices/Routers:
- Definitions of only one interface are done with a wildcard-mask of 0.0.0.0 and the exact IP address of the given interface. This will match exact on that interface and nothing else.
- If we have to specify multiple interfaces and the IP concept has been done nicely, we might be able to summarize them all into one network statement. For example, if we have an address range like 99.99.16.0/21 which belongs to area N we can use network 99.99.16.0 0.0.7.255 area N to define them in one network statement. Every new interface on that router with an IP in that range will automatically be added into the OSPF process and added to that area
- If you want to specify all interfaces on the router, the network statement network 0.0.0.0 255.255.255 area N will do the trick. Every new interface with an IP address on the router will automatically join OSPF and this area
Thanks Waqas. I found your blog using msn. This is a well written article on OSPF network commands.
I’ll make sure to bookmark it and return to read more of your useful information. Thanks for the post. I will certainly return.
Can you please explain the same about EIGRP as well?
I wish to say that this post is amazing, nice written and come with approximately all important infos. I would like to peer extra posts like this.
Yes, we can execute “network 0.0.0.0” to enable eigrp on all current and future IP interfaces.
Appreciated!!
Very good article about Network Statements & OSPF! Ꮤe are linking to this great article оn our website.
Keep it up the great writing!!
What is the main function of Network statement in case of all Routing Protocols?
The ‘network’ statement tells a Layer3 Device or a router three things:
i. It tells the Router on which interfaces to listen and accept the routing protocol packets
ii. It tells the Router which interfaces to advertise out and send routing protocol packets
iii. Finally, it tells the Router on which interfaces subnets/networks to advertise
Hello! I’m at work browsing your blog!
Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the outstanding work!
Hi there, You have done a fantastic job. I was looking for detail on OSPF. I’ll definitely dig it and personally recommend to my friends. I am sure they will be benefited from this web site.
Can you explain how ospf is different EIGRP?
EIGRP is now known as IETF draft which is no longer proprietary. For more info please visit: http://tools.ietf.org/html/draft-savage-eigrp-01
EIGRP is much faster than OSPF because there are multiple loop free paths to a destination which are called feasible successors. EIGRP also has summarization at any point in the network with stub feature which is useful when you don’t want to use a router for transit. EIGRP is also less confusing than OSPF because it does not have different network types and EIGRP is easier to deploy in hub and spoke scenarios.
On the other hand OSPF is an open standard. It can perform well but it requires that you tweak SPF timers because by default in IOS there is a 5seconds value.
Why OSPF is known as Link state protocol?
OSPF is a link state protocol because it keeps database of the complete topology and has information about the links. OSPF works on IP Protocol 89.
well done, all your blogs are an asset for network engineers. great work.
Wonderful article which helped me revise topics for my placements activity going on.