01-13-2016 01:44 AM - edited 03-05-2019 03:06 AM
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
01-13-2016 01:56 AM
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
01-13-2016 04:02 AM
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
01-13-2016 04:41 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide