CIDR 地址选择
我了解 CIDR 的一般概念以及前缀和后缀位如何工作,并且我通常理解您可以将一个地址说:
73.132.68.12/24
有 24 个前缀和 8 个后缀位。与此对应的网络地址为:
73.132.68.0
,因为后缀全为零。
更进一步,您可以通过进一步扩展网络/前缀来将该地址分解为更多子网。不过,这就是我有点困惑的地方。
如果我将前缀扩展 4,那么对于任何子网的网络地址,只有最后 4 位必须为 0。这是否意味着我必须使用最后一个字节中的前 4 位来识别子网?这就是我在示例中的意思...
73.132.68.16 --> subnet 1 with final byte as 0001 0000
73.132.68.32 --> subnet 2 with final byte as 0010 0000
73.132.68.48 --> subnet 3 with final byte as 0011 0000
等等。
这是否是对地址进行子网划分的适当方法?
有更好的办法吗?
I understand the general concept of CIDR and how the prefix and suffix bits work, and I generally understand that you can take an address say:
73.132.68.12/24
There are 24 prefix and 8 suffix bits. The network address corresponding to this would be:
73.132.68.0
as the suffix is all zeros.
Going further, you can break this address down into more subnets by extending the network/prefix a little further. This is where I get a little confused though.
If I extended the prefix by 4, then only the last 4 bits would have to be 0 for the network address of any of the subnets. Does this mean that I have to use the first 4 bits in the last byte to identify the subnets? Here's what I mean in example...
73.132.68.16 --> subnet 1 with final byte as 0001 0000
73.132.68.32 --> subnet 2 with final byte as 0010 0000
73.132.68.48 --> subnet 3 with final byte as 0011 0000
etc.
Would this be an appropriate way to subnet the address ?
Is there a better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这就是它的工作原理,在您的示例中,您将拥有网络 73.132.68.0/28、73.132.68.16/28 等。子网由整个网络前缀(示例中的 28 位)标识,因此您不应该仅考虑最后一个字节。除了具有常见的 C/B/A 类名称之外,字节边界不具有任何特殊含义。
Yes, that's how it works in general, in your example you would have networks 73.132.68.0/28, 73.132.68.16/28, etc. The subnets are identified by the whole network prefix (28 bits in your example) so you should not consider only the last byte. Byte boundaries don't hold any special meaning, apart from having common C/B/A class names.