Understanding the “network” statement in IGP configuration on Cisco routers


The “network” statement used on Cisco routers for IGP (RIP, OSPF & EIGRP) configuration is one of the most mis-understood configuration items of a router config.  I tell people that:

The “network” statement describes a list of interfaces. It tells the router three things:

1. Which interfaces to listen on. Accept routing protocol packets on the interfaces described by the network statement.

2. Which interfaces to advertise out. Send routing protocol packets on the interfaces described by the network statement.

3. What interface subnets/networks to advertise. Advertise the subnets/networks that belong to the interfaces described by the network statement.

Example:

A router has four interfaces:
10.0.1.1/24
10.0.2.1/24
172.22.1.1/24
172.22.2.1/24

Lets do a partial RIP configuration

router rip
 network 10.0.0.0

Remember, this statement tell the router 3 things:

1. Where to listen – listen for RIP on all interfaces described by the network 10.0.0.0 statement

2. Where to advertise – send advertisements on all interfaces described by the network 10.0.0.0 statement

3. What to advertise – advertise the interface networks/subnets described by the network 10.0.0.0 statement

Notice that I have related each function to the word “interface”.  There is a good reason for this – once you realise that the network statement is describing a set of interfaces, it becomes much easier to understand.

So we have told the router to listen for advertisements on the 10.0.0.0 network.  At this stage any RIP updates arriving at either of the 172.22.x.x interfaces will not be processed.

And we have told the router to send RIP on just the 10.x.x.x interfaces – any RIP routers in the 172.22.x.x cloud waiting to hear RIP from R1 will have to keep waiting.

The trickiest bit to understand is what to advertise.  The configuration says “advertise the 10.0.0.0 network/subnets”.  As to whether we advertise the entire 10.0.0.0 network or the individual subnets depends on which network/subnet we are advertising to.  Since (at this stage) we have only told the router to advertise on the 10.x.x.x interfaces, RIP will advertise the subnetworks that are NOT associated with the interface that is sending the advertisement.  The following illustration shows this:

Notice that since we are dealing with RIP v1, the updates are sent without any subnet mask.  RIP v1 assumes that the mask is consistent throughout the network.  The 10.0.2.0 subnet is advertised out the 10.0.1.x interface, and vice versa.

Next, I’m going to add another network statement that tells the other interfaces to participate in RIP.  The effect illustrates classful nature of RIP v1.  To do this, I add the network 172.22.0.0 statement to my RIP configuration so that it now looks like:

router rip
  network 10.0.0.0
  network 172.22.0.0

The additional statement tell the router 3 things:

1. Start listening for RIP on all interfaces described by the network 172.22.0.0 statement

2. Start sending advertisements on all interfaces described by the network 172.22.0.0 statement

3. Advertise the interface networks/subnets described by the network 172.22.0.0 statement

But what happens is not the same on all interfaces, because 172.22.0.0 is a different network to 10.0.0.0.  What happens in fact is that the 10.0.1.x interface continues advertising the 10.0.2.0 subnet, and starts advertising the 172.22.0.0 classful network

10.0.2.x interface continues advertising the 10.0.1.0 subnet, and starts advertising the 172.22.0.0 classful network
172.22.1.x interface begins advertising the 172.22.2.0 subnet, and the 10.0.0.0 classful network
172.22.2.x interface begins advertising the 172.22.1.0 subnet, and the 10.0.0.0 classful network

This is the end of the story as far as RIP v1 goes.  If however we were using RIP v2 or EIGRP, there would be a difference – the subnet mask would also be advertised, so the story would change to:
The:
10.0.1.x interface would advertise the 10.0.2.0/24 and start advertising the 172.22.0.0/16 classful network
10.0.2.x interface would advertise the 10.0.1.0/24 and start advertising the 172.22.0.0/16 classful network
172.22.1.x interface begins advertising the 172.22.2.0/24 subnet, and the 10.0.0.0/8 classful network
172.22.2.x interface begins advertising the 172.22.1.0/24 subnet, and the 10.0.0.0/8 classful network

Which is not really that much different to RIP v1.  However, there are time when you actually want all the subnets advertised out all the interfaces.  With RIP v1, you are out of luck.  With RIP v2 and EIGRP we have one more trick up our sleeve – we can tell the router that we don’t want it to auto-summarise the classful networks with the no auto-summary command.  If your config looks like this:

router rip
 version 2
 network 10.0.0.0
 network 172.22.0.0
 no auto-summary

then all subnets get advertised on all interfaces.

Differences between RIP and EIGRP and OSPF

With RIP, I can only ever specify an entire range of interfaces with the network statement.  If for instance I did NOT want to advertise the 172.22.1.0 subnet at all, but did want to advertise the 172.22.2.0, then I would not be able to achieve that easily.

With EIGRP I could specify my interface ranges by using a wildcard mask – which is an inverted subnet mask invented by an evil programmer who has had little regard for the future agony he would cause because he was too lazy to write a couple of extra lines of code to turn 255.0.0.0 into 0.255.255.255.

The simplest way to specify a single interface in EIGRP (or OSPF) configuration is to use the IP address of the interface in your network statement, matched with a wildcard mask of 0.0.0.0.

So if we wanted EIGRP to:

1. Start listening for EIGRP on all interfaces that have a 10.x.x.x IP address AND the 172.22.1.1 interface;

2. Start sending EIGRP on all interfaces that have a 10.x.x.x IP address AND the 172.22.1.1 interface; and

3. Advertise the interface networks/subnets on these interfaces;

Then my configuration would look like:

router eigrp 1
 network 10.0.0.0
 network 172.22.1.1 0.0.0.0

Some sadistic instructors may have taught you that the network statement for the 172.22.1.1 interface should be written as:

network 172.22.1.0 0.0.0.255

but the difference is purely cosmetic – each network statement defines the same range of interfaces.

Pop Quiz:

If you have been following, you should be able to answer this:

Given the configuration

router eigrp 1
 network 10.0.0.0
 network 172.22.1.1 0.0.0.0

and assuming EIGRP has found a neighbour attached to the 10.0.1.1 interface, what will your router advertise to that router?

  1. A. 10.0.0.0/8 and 172.22.1.0/24
  2. B. 10.0.2.0/24 and 172.22.1.0/24
  3. C. 10.0.1.0/24 and 172.22.1.0/24
  4. D. 10.0.2.0/24 and 172.22.0.0/16

If you answered D then you are correct.  A & C are wrong, because you don’t advertise your own network out the interface that owns that network, and B is wrong because EIGRP is a classful routing protocol by default.  Now before you get the poison out, remember I said “by default”.  To make EIGRP truly classless, you have to add the

no auto summary

command, just like in RIP v2.

Which brings us to the main difference (in configuration concepts anyway) between EIGRP and OSPF.  With OSPF I don’t need, and indeed can’t use, the no auto-summary statement – OSPF is a classless routing protocol.  So the following OSPF configuration would indeed see the networks 10.0.2.0/24 and 172.22.1.0/24 being advertised to a neighbour found on the 10.0.1.0/24 subnet.

router ospf 1
 network 10.0.0.0 0.255.255.255 area 0
 network 172.22.1.1 0.0.0.0 area 0

The other difference in the OSPF configuration is that the wildcard mask is ALWAYS required, and also I use the network statement to assign interfaces to areas as well.

Advertisements

About RedNectar Chris Welsh

Professional IT Instructor. All things TCP/IP, Cisco or VoIP
This entry was posted in Cisco, EIGRP, OSPF, RIP, RIP, Router Configuration, Routing. Bookmark the permalink.

One Response to Understanding the “network” statement in IGP configuration on Cisco routers

  1. Wonderful explanation of the classful summarization and the network statement. You made the life of at least one network engineer easier.Please continue on your chosen path.

Comments are closed.