How about using ranges of IP addresses instead of subnets in ACLs? For example, I have to block access to 66.114.175.151-178 and I can't figure out how to mask that. I guess since there's not all that many, I could do them individually, but a range would make it a bit easier and cleaner to read.
Thanks, Peter.
Didn't find your answer? Ask the community — no account required.
M
Martin Bilgrav
This is done by use of what cisco calls wildcard, or wildcardbits. I.e. one bit eq a match/do-care, and a zero eq dont-care fx range= 192.168.10.0 0.0.0.255 is the same as subnet 192.168.10.0 255.255.255.0
or if you what to match a specific host i many networks:
192.168.10.13 0.0.255.0 means the hosts .13 in whatevery 192.168.xxx.13 network
google more about it ...
HTH Martin
W
Walter Roberson
You did not mention the product or software version.
In PIX 6, you cannot use ranges in ACLs, but you can create "object groups" that can refer to the hosts together. Saves a lot of typing sometimes.
access-list in2out deny ip any object-group badguys
I seem to recall reading that there is some grouping facility in IOS 12.4 but I was not able to find it when I looked last time (~5ish months ago.)
W
Walter Roberson
... For IOS. Other Cisco products may use different representations.
Perhaps you meant 192.168.0.13 0.0.255.0
P
Peter Lecki
Oh yes, sorry about not mentioning the product. I was talking about PIX515 and I don't believe that uses the same wildcard masking as the IOS-based products do, as mentioned by Martin. However, your suggestion, Walter, is exactly what I needed, I was going to group all the individual IPs together, but this makes it even cleaner/shorter.
Thanks guys!
M
Martin Bilgrav
hmm - seem to be missing a post from W.R in my newsfeed...
anyway - PIX doesnt support wildcards you could do a network-group instead, and apply this in the ACL.
W
Walter Roberson
Yes it does, just with the bit negated relative to IOS.
There used to be a C program available from Cisco (masks.c by Joel Bion) which would help you do that. For many years I had a copy but it seems to have disappeared, though I used the logic of it later[1]. Does anyone have a copy or is there a web-based version anywhere?
Alternatively you can make a table of power-of-two blocks ( is an example and I could easily provide the script that made that, or an Excel spreadsheet with a similar layout - lots of other people do that too) and just match the ones that complete the range you're interested in.
In your case that would be 151, the blocks 152-159, 160-175, 176-177 and 178.
Sam
[1] In a perl script of my own for a different purpose so it would be no use my giving you the script.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.