cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
9663
Views
25
Helpful
5
Replies

OSPF 'network' Command Wildcard Mask

rossua994
Level 1
Level 1

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 ?

5 Replies 5

luqmankondeth
Level 1
Level 1

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.

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

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

HTH

Rick

Hi,

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

rossua994
Level 1
Level 1

Thanks for all replies, this has clarified the matter.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco