I have made some minor changes to and fixed some bugs in my updated
version of grepcidr. It will now match CIDR ranges in the input, so
you can look either for CIDRs that are completely contained in pattern
ranges, or that overlap any pattern range.
It handles both IPv4 and IPv6 addresses. The pattern matching uses a
state machine that is quite fast, so it can handle large numbers of
patterns and large input files.
It's here: http://www.taugh.com/grepcidr-2