In IPv6, we can collapse 0's when talking about addresses.

In IPv4, can I write as 192.168.1/24? Can I write as 10/8?

I'm working on some software that takes CIDR's as arguments and some of my customers have provided these "short hand CIDRs". I want to know if they are valid or not.


3 Answers 3


Collapsing IPv4 addresses like that is not a standard the way it is with IPv6. There are some applications which can take addresses like that, but you will find that most do not. It is fine, and recommended, to leave off the leading zeros in each IPv4 octet (some things will misread leading zeros to mean octal notation), but you shouldn't collapse octets.


While it may be acceptable to write or speak that way, very few systems will accept an address entered that way. Ultimately, no engineer will enter an address like that, so there's little point coding your software to accept it.

(for example, what does 10.1/8 mean? In CIDR, it's nonsense. In a classful system, that would be network == 10, host == 1, or


Juniper boxes will happily accept routes like 0/0 or 10/8. IOS certainly doesn't, and i'm pretty sure that XR doesn't either.

Your Answer

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

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