cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7825
Views
0
Helpful
5
Replies

OSPF WildCard mask problem

gulzaib
Level 1
Level 1

hi every one...

i  am new in networking and i am bit confused in ospf  wildcard mask..pp.PNG

ospf configartion on routers are as follow:


R2(config)#router os 3
R2(config-router)#net 4.1.1.0 0.0.0.6 a 1
% OSPF: Invalid address/mask combination (discontiguous mask)

 

i want to allow network 4.1.1.0 to 4.1.1.6 ..

so its wild card mask will be 0.0.0.6

so why this error?

it only not give error on 0.0.0.0 or  0.0.0.255 why?

5 Replies 5

chrihussey
VIP Alumni
VIP Alumni

0.0.0.6 is not really a network mask. If your network is sized to contain just hosts 4.1.1.1 - 6 then the reverse mask would be 0.0.0.7. (255.255.255.248 in standard notation)

However, the network in the diagram shows 4.1.1.4 /8 which would be 0.255.255.255 for the OSPF.

Hope this helps 

Ben Walters
Level 3
Level 3

You are getting an error because 0.0.0.6 is not a valid wildcard mask. The other values of 0.0.0.0 and 0.0.0.255 are valid. 0.0.0.0 covers only a single IP address and 0.0.0.255 would cover .0-.255 of a given subnet (4.1.1.0-4.1.1.254 based on your example.) 

 

I have an easy way to determine the wildcard mask based on any given subnet mask. Just take each octet in the subnet mask and subtract it from 255 to get the corresponding wildcard value. 

 

For example if you have a /29 network with a mask of 255.255.255.248 (which would match the IP range 4.1.1.0-4.1.1.7 from your example)

The corresponding wildcard mask is: 0.0.0.7

255 - 255 = 0

.

255 - 255  = 0

.

255 - 255 = 0

.

255 - 248 = 7

 

Hopefully this helps you in determining wildcard masks in the future. 

Richard Burts
Hall of Fame
Hall of Fame

There have been good responses explaining the error message about discontiguous mask being that the mask used 0.0.0.6 is not a valid mask. I believe that there is another aspect of the original post which we need to address. It is this statement

i want to allow network 4.1.1.0 to 4.1.1.6 ..

If we take that statement literally then it can not be done in a single network statement. The responses suggested using a mask of 0.0.0.7 which is pretty close but not exact for the requirement. This mask would include 4.1.1.0 to 4.1.1.7. If the original poster really does want to include 4.1.1.6 but not 4.1.1.7 then the solution is to use individual network statements with mask 0.0.0.0 for each address in the desired range.

 

HTH

Rick

gaston.benitez
Level 1
Level 1

Hi Gulzaib

 

I have made a test and I see that this happens when the mask in the interface does not match the wildard.

 

R1(config)#int f0/0
R1(config-if)#ip add 10.1.1.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#
R1(config-if)#router ospf 1
R1(config-router)#network 10.1.1.0 0.0.0.6 a 0
% OSPF: Invalid address/mask combination (discontiguous mask)
R1(config-router)#

 

Please. Validate that the interface mask matches the wildcard and also, don´t forget to mark this as a solution in case this help you to identify the issue.

 

BR

BR

 

There is not any requirement that the OSPF mask must match the interface mask. The requirements are that the OSPF mask be a valid mask and that the address of the interface fall into the range defined by the OSPF mask.

HTH

Rick