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

Wilcard mask 1 in OSPF

       Hi all,

Need to confirm this

in ospf when we use network command if we do this to advertise the network

say  15.15.5.0  0.0.0.255  

can we also write this instead

15.15.4.0 0.0.1.255

here is what  i did

Subracted wild card mask 0.0.1.255 from 255.255.255.255

then i get the subnet mask of 255.255.254.0

Now we have IP 15.15.4.0 and SM of 255.255.254.0

Now the subnet number of this is 15.15.4.0

Next valid ip is 15.15.4.1

Broadcast ip is 15.15.5.255  right???????

just need to confirm with you guys if i am right?

Thanks

Everyone's tags (3)
2 ACCEPTED SOLUTIONS

Accepted Solutions

Wilcard mask 1 in OSPF

Hi Mahesh,

This is basic stuff but your math is correct.

You have created the subnet 15.15.4.0/23.

Did you know there is an aternative way to configure ospf networks?

Under interface configuration you can enter something like:

ip ospf area XX

example:

int fa 0/0

ip address 15.15.5.250 255.255.254.0

ip ospf 1 area 0

regards,

Leo

Hall of Fame Super Gold

Wilcard mask 1 in OSPF

Mahesh

I would offer a couple of comments about your question:

- you said:"if we do this to advertise the network" which seems to imply that the network statement controls what is advertised. But that is not the case. The network statement controls which interfaces OSPF will include in the routing protocol. After the routing protocol has selected the interfaces it checks the subnets on those interfaces, and this is what determines what OSPF will advertise.

- you certainly could use 15.15.5.0  0.0.0.255 or you could use 15.15.4.0 0.0.1.255. They are not equivalent and the second one defines a larger range than the first one. Whether they have the same result in OSPF depends on how many subnets and which subnets are configured on interfaces. If there is an interface with address 15.15.5.1 then certainly it will match both of the statements. But if that router also has an interface with 15.15.4.1 then it will match the second but not the first.

So when you are configuring OSPF and trying to determine what mask to use you need to think about which interfaces you do want to match and which interfaces, if any, you do not want to match. Using the 0.0.1.255 mask may result in fewer network statements in the config (and sometimes more simple is good) but it is also less specific and sometimes we might want the greater specificity.

HTH

Rick

4 REPLIES

Wilcard mask 1 in OSPF

Hi Mahesh,

This is basic stuff but your math is correct.

You have created the subnet 15.15.4.0/23.

Did you know there is an aternative way to configure ospf networks?

Under interface configuration you can enter something like:

ip ospf area XX

example:

int fa 0/0

ip address 15.15.5.250 255.255.254.0

ip ospf 1 area 0

regards,

Leo

Hall of Fame Super Gold

Wilcard mask 1 in OSPF

Mahesh

I would offer a couple of comments about your question:

- you said:"if we do this to advertise the network" which seems to imply that the network statement controls what is advertised. But that is not the case. The network statement controls which interfaces OSPF will include in the routing protocol. After the routing protocol has selected the interfaces it checks the subnets on those interfaces, and this is what determines what OSPF will advertise.

- you certainly could use 15.15.5.0  0.0.0.255 or you could use 15.15.4.0 0.0.1.255. They are not equivalent and the second one defines a larger range than the first one. Whether they have the same result in OSPF depends on how many subnets and which subnets are configured on interfaces. If there is an interface with address 15.15.5.1 then certainly it will match both of the statements. But if that router also has an interface with 15.15.4.1 then it will match the second but not the first.

So when you are configuring OSPF and trying to determine what mask to use you need to think about which interfaces you do want to match and which interfaces, if any, you do not want to match. Using the 0.0.1.255 mask may result in fewer network statements in the config (and sometimes more simple is good) but it is also less specific and sometimes we might want the greater specificity.

HTH

Rick

Community Member

Wilcard mask 1 in OSPF

Hi Rick,

Thanks for reply and explaining me in so detail.

This forum is so good to learn the cisco stuff that we do not find  in books.

Regards

MAhesh

Community Member

Wilcard mask 1 in OSPF

Hi Leo,

MAny thanks for reply back.

To be honest i was not knowing alertnative way to config OSPF networks.

There is always something to learn everyday specially from this forum.

Thanks

MAhesh

559
Views
0
Helpful
4
Replies
CreatePlease to create content