2

There are times where CIDR notation isn't used to subnetting or for routing/summarization but rather just for ranging IP addresses, IPv4 mostly. It seems very non-standard and it seems to be like a makeshift solution around Docker because the only examples that I can remember right now are related to Docker: Portainer and vSphere Integrated Containers. Whatever might be, it's always been a little confusing of where does it starts and ends and if normal subnet edges are respected. However, the ambiguous instructions given, for what it's worth, usually almost verbatim one another. It's consistently ambiguous.

For example, I want to tell X app/system that I want to use 30 addresses starting from 10.2.44.21 to 10.2.44.50. In subnetting, that'd fit nicely in a /27, only the range edges (start/end) wouldn't work. However, it's usually pointed out that when used in this way the address given is not the network ID but the initial address in a given /{CIDR}.

So, that could potentially be 10.2.44.21/27 (+2). Yet, back again in subnetting rules there'd be another problem with that; when a range is overshoot, the extra is usually just ignored.

In subnetting, 10.2.44.21/27 subnet would be:

NetworkID 10.2.44.0
AddrRange 10.2.44.1-10.2.44.30
BcastAddr 10.2.44.31

So, would the range be broken off at address .31 (where the subnetting range ends) or would it go all the way to .50? And, is the range is fully usable? i.e; not .50 but .52.

I just remembered another use for it: in pfSense/OPNsense, it can be used for firewall rules but I do believe subnet ranges are respected since these are downloaded in DNSBL/Pi-hole/pfBlockerNG-type lists, which are ranged in the subnets as they were assigned — I think ranges would be broken off on edges. In the captive portal rules are different thought.

1 Answer 1

2

You cannot represent arbitrary ranges in a single CIDR notation.

You seem to be asking for a standard way to modify CIDR notation so that becomes possible, but that doesn't exist. The simple answer is use a range to represent a range.

Also, whether the addresses with all-zero or all-one host parts are usable or not depends on the use case. As an actual subnet address with IPv4 they're not, but with IPv6 or if you e.g. use them just for routing or for ACL rules, then they are. (ACLs generally support non-contiguous wildcard patterns as well.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.