cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
777
Views
0
Helpful
3
Replies

Wild Card question

Simon Young
Level 1
Level 1

I have a question about a 0.0.0.191 wildcard mask

What is that actually matching

say 202.30.57.0 0.0.0.191

Am I correct that

202.30.57 stays the same, then the second bit can change

128 64 32 16 8 4 2 1

    1   0   1  1  1 1 1 1

so what am I matching

202.30.57.64 - 191 only?

Thanks in advance

3 Replies 3

Peter Paluch
Cisco Employee
Cisco Employee

Hi Simon,

202.30.57 stays the same, then the second bit can change

Not quite correct. 202.30.57 stays the same - that's okay - but from the fourth octet, the second highest bit (64) must match the value in the template address which is 0. All remaining bits can be arbitrary. Remember, '0' in the wildcard mask says MUST MATCH while '1' says IGNORE.

As a result, this wildcard mask allows addresses of the format 202.30.57.X where X is one of 128 possible values, none of which have 64 in their binary series: 0, 1, 2, 3, 4, ..., 63, 128, 129, 130, ..., 191.

Best regards,
Peter

Hi Paul

Thanks for the reply, so in context

route-map SET-MED-hi permit 10
 match ip address 1
 set metric 200
!

access-list 1 permit 202.30.27.0 0.0.0.191

 1-63        would match and have a MED of 200 applied
 64-127    would not match
 
 128-191  would match and have a MED of 200 applied
 192-255  would not match

Thanks

Simon,

 1-63        would match and have a MED of 200 applied
 64-127    would not match
 
 128-191  would match and have a MED of 200 applied
 192-255  would not match

A slight correction: 0-63 would match and have a MED of 200 applied. Otherwise correct.

Please note that if this route-map is used in a routing protocol configuration such as BGP, the individual routes you are talking about would need to have netmasks larger than /24, as you are matching them on the last octet and its different values. That requires that the netmask is more than /24; otherwise, with a mask of /24, the only network you can get is 202.30.27.0/24.

Best regards,
Peter