OSPFv2 Enabler #1 – Answers
The first OSPF Enabler exercise asked you to configure three routers, specifically to add the OSPFv2 network commands. This post lists the answers – simple enough.
The Topology
It is probably best to have the exercise post on the screen at the same time you look at this post. If not, for convenience, here’s a copy of the topology figure for this exercise.
OSPF Enabler OSPF Topology 1
The Answers
I promised short, sweet, and to the point. Here are the answers!
router ospf 1 network 172.16.0.0 0.0.255.255 area 0 network 172.21.0.0 0.0.255.255 area 0
Answers: Router R1
router ospf 1 network 172.16.12.0 0.0.0.3 area 0 network 172.16.23.0 0.0.0.7 area 0 network 172.22.2.0 0.0.0.127 area 0 network 172.22.2.128 0.0.0.63 area 0
Answers: Router R2
router ospf 1 network 172.16.13.3 0.0.0.0 area 0 network 172.16.23.3 0.0.0.0 area 0 network 172.23.33.3 0.0.0.0 area 0 network 172.23.33.213 0.0.0.0 area 0
Answers: Router R3
Comments and Explanations – R1
For R1, you needed to start by identifying the various classful networks (class A, B, or C networks) used on the interfaces. Then, to configure one network command to match each classful network, you need to take the default mask for each classful network and invert the mask to find the corresponding wildcard mask. For default masks, those are:
Default mask 255.0.0.0 – Inverts to wildcard mask 0.255.255.255
Default mask 255.255.0.0 – Inverts to wildcard mask 0.0.255.255
Default mask 255.255.255.0 – Inverts to wildcard mask 0.0.0.255
For OSPF areas, in this case, all interfaces were in area 0, so all the network commands of course end with the area 0 keywords.
Comments and Explanations – R2
R2 requires the most thought. To get these commands totally correct per the requirements, you must:
- Begin with each interface’s IP address and subnet mask
- Calculate the subnet ID, which will be the first parameter in the network command
- Invert the subnet mask, which will be the second parameter in the network command
- The design places all interfaces in area 0, so the commands all end with area 0.
Because of how the exercise is worded, you should have four network commands, one matching the subnet off each of the four interfaces on R2.
Comments and Explanations – R3
R3 requires the least thought of the three requirements. To match a single IP address, use wildcard mask of 0.0.0.0. For the number preceding the wildcard mask in the network command, use the interface IP address. The result: each network command matches an interface IP address, and only that address, enabling OSPFv2 on that interface.
Also, as with all other cases in this lab, all interfaces were in area 0, so all the network commands of course end with the area 0 keywords.
Mr. Wendell,
Do we really need to calculate the subnet ID for the R2’s configuration?
For example,
instead of writing
‘network 172.16.23.0 0.0.0.7 area 0’
cannot we write
‘network 172.16.23.2 0.0.0.7 area 0’ ?
Warmest Regards,
Mit
Hi Mit,
If you typed ‘network 172.16.23.2 0.0.0.7 area 0’ in OSPF config mode, IOS would accept it, but change it to ‘network 172.16.23.0 0.0.0.7 area 0’. So the literal answer is that you could indeed use the version that includes 172.16.23.2. However, you would be typing an incorrect version of the command, and letting IOS fix it for you. That’s not a good practice for learning for the exam, in case you then weren’t ready to choose the right answer on the exam. But literally, either is accepted by IOS.
Wendell
Hi Wendell,
Could you provide any example for unsdestand this network :172.16.23.0 0.0.0.7 area 0, I don´t understand why the number 7.
Erison,
Sure, no problem.
First, note that the OSPF *network* command, with it’s wildcard mask, can be correctly configured in many ways. For the lab exercise, I made up different rules for R1, R2, and R3 – not because those rules are good for real networks, but as a way to let you practice all the ways you can configure the *network* command. With that context, the lab asks that for router R2, you should use wildcard masks such that the *network* command matches all hosts in the subnet of an interface.
To figure out the wildcard mask to use:
Look at the interface config
Find the IP subnet mask (255.255.255.248 in this case)
subtract octet-by-octet from 255.255.255.255
Answer: 0.0.0.7
That’s the wildcard mask, which, when combined with the subnet ID of the subnet off that same interface, will match the IP addresses in the subnet.
Hope this helps,
Wendell
Mr Wendell
Can you explain me why R2 configure for g0/4 is network 172.22.2.128 0.0.0.63 area 0, not 172.22.2.0 for subnet ID?
Thanks you
Ducino,
Sure. It mostly has to do with the instructions, which are artificial, just to give us some exercise.
For R2, the request is: each network command matches the addresses in one subnet.
For R2’s G0/4 interface, to match all addresses in the subnet, you need to use the subnet ID of that subnet in the network command, and a wildcard mask that defines a range from the subnet ID to the end of the subnet’s range of addresses. network 172.22.2.128 0.0.0.63 does that. The interface IP address is defined by “ip address 172.22.2.130 255.255.255.192”, so a little subnet math gives us subnet ID 172.22.2.128. Subtract subnet mask 255.255.255.192 from 255.255.255.255 to get the wildcard mask to use (0.0.0.63). The range of addresses then begin with .128 and ends w/ .191, matching the addresses in the subnet.
Mr Wendell,
Thank you very much for your reply, I understand now.