OSPF 'network' Command Wildcard Mask

Unanswered Question
May 2nd, 2007
User Badges:

Can anyone please clarify how the 'wildcard mask' in the 'network' command works with OSPF.


I am confused by the answer given to question 7 at the start of Chapter 6 of the Cisco Press ICND Exam Cert Guide book by Wendell Odom.


This question asks if the command :-


network 10.0.0.0 0.255.255.0 area 0


will match interface IP addresses 10.1.1.1, 10.1.100.1, and 10.1.120.1.


What is the right answer here ?


As I understand it 0.255.255.0 means first and last octets must match 10.0.0.0, so does this mean the IP address themselves must match this, or can it be sufficient that the network in which these IP addresses reside match it ? For example all the above IP addresses are in 10.0.0.0, but does this mean they match in the above command ?


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (5 ratings)
Loading.
luqmankondeth Wed, 05/02/2007 - 08:37
User Badges:

Your understanding of the command is correct.

0.255.255.0 in the wildcard mask means the second and third octet can be any number from 0-255.

the last and first octets must be exactly as specified in the network command. now your network command says

10.0.0.0 0.255.255.0


this means, the first octet must be 10 and the last octet must be 0. however,the last octet in your config could be the network number , so any interface with an ip address inside this network number qualifies.

royalblues Wed, 05/02/2007 - 09:25
User Badges:
  • Green, 3000 points or more

Friend,


Though your understanding is correct, these type of masks cannot be used with OSPF. You will get the following error when you try to do so.


Router(config)#router ospf 100

Router(config-router)#net

Router(config-router)#network 10.10.10.0 0.255.255.0 are

Router(config-router)#network 10.10.10.0 0.255.255.0 area 0

OSPF: Invalid address/mask combination (discontiguous mask)

Router(config-router)#


These type of wildcard masks can be used with access-lists though


HTH, rate if it does

Narayan

Richard Burts Wed, 05/02/2007 - 09:51
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Narayan


Actually this is a function where the behavior of IOS changed. There are versions of code (older versions) where the network mask of the OSPF network command did support discontiguous masks and there are versions of code (newer) which do not support it. So you have to be careful about which version of code when considering this question (and I believe that the question should be updated or removed to conform to current behavior of IOS).


HTH


Rick

get_shanu Wed, 05/02/2007 - 22:59
User Badges:

Hi,


I strongly agree with the above replies, because the OSPF will not allow discontigous masks.

rossua994 Sat, 05/19/2007 - 07:33
User Badges:

Thanks for all replies, this has clarified the matter.



Actions

This Discussion