Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

OSPF 'network' Command Wildcard Mask

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
New Member

Re: OSPF 'network' Command Wildcard Mask

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.

Re: OSPF 'network' Command Wildcard Mask

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

Hall of Fame Super Silver

Re: OSPF 'network' Command Wildcard Mask

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

New Member

Re: OSPF 'network' Command Wildcard Mask

Hi,

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

New Member

Re: OSPF 'network' Command Wildcard Mask

Thanks for all replies, this has clarified the matter.

5709
Views
25
Helpful
5
Replies
CreatePlease login to create content