8.9.2. cidr
8.9.2. cidr
The cidr type holds an IPv4 or IPv6 network specification. Input and output formats follow Classless Internet Domain Routing conventions. The format for specifying networks is address/y where address is the network represented as an IPv4 or IPv6 address, and y is the number of bits in the netmask. If y is omitted, it is calculated using assumptions from the older classful network numbering system, except it will be at least large enough to include all of the octets written in the input. It is an error to specify a network address that has bits set to the right of the specified netmask.
cidr类型确保保存的IPv4或IPv6网络复合规范。输入和输出格式遵循Classless Internet Domain Routing约定。指定网络的格式为address/y,其中address是表示为IPv4或IPv6的网络地址,y是子网掩码中的位数。 如果省略y,则使用来自较旧的有类网络编号系统的假设进行计算,除非它至少足够大以包括输入中写入的所有八位位组。指定指定子网掩码右侧位的网络地址是错误的。
Table 8.22 shows some examples.
示例参见表8.22。