Network statements in Lazy mode & Deep dive into OSPF Network command

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:

  1. Logically OR the wildcard-mask argument with the interface IP address
  2. Logically OR the wildcard-mask argument with the ip argument in the network command
  3. 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:

  1. 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.
  2. 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
  3. 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

 

Open Shortest Path First (OSPF)

 

Written by 

Waqas Karim is a seasoned Network Expert … Geek. He is the founder of ATech. ATech was started for learning & sharing. Over time the platform has grown to include other resources which continue to attract fellow networkers. Today it sees upward trend of a hundred thousand visitors per month, scattered all over the globe. His specialty is networking, but his interest & expertise spans from traditional IT to Network Security including Programming, Virtualization, Service Provider & so on... no matter the badge on the box. He is CCIE Certified (CCIE#56732) in addition to below badges: Telecom Engineer (BE) + CCIE-RS (CCIE#56732) + Huawei Certified (HW#706632) + MBA Microsoft Certified MCITP, MCSE#109*26, CCNP-Sec, CCNP-SP, CCNA-DC, CompTIA Security+, Nokia NRS-I, JNCIA, ITIL Certified (ITIL#*6373), CEH (Certified Ethical Hacker).

avatar
11 Comment threads
5 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
8 Comment authors
Doel EnsifWaqas KarimLionlin.KGeile MateureBenk Essler Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Lionlin.K
Guest
Lionlin.K

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.

Benk Essler
Guest
Benk Essler

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.

Geile Mateure
Guest
Geile Mateure

Appreciated!!

Cabi Pett
Guest
Cabi Pett

Very good article about Network Statements & OSPF! Ꮤe are linking to this great article оn our website.
Keep it up the great writing!!

Doel Ensif
Guest
Doel Ensif

What is the main function of Network statement in case of all Routing Protocols?

mikkimann
Guest
mikkimann

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!

Mistop Restol
Guest
Mistop Restol

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.

Alex
Guest
Alex

Can you explain how ospf is different EIGRP?

Jack Reddy
Guest
Jack Reddy

Why OSPF is known as Link state protocol?

Cedric Clark
Guest
Cedric Clark

well done, all your blogs are an asset for network engineers. great work.

john oh
Guest
john oh

Wonderful article which helped me revise topics for my placements activity going on.