Amazon VPC n ^ 2 -4 IP地址? CIDR块 [英] Amazon VPC n^2 -4 IP Addresses? CIDR Block

查看:183
本文介绍了Amazon VPC n ^ 2 -4 IP地址? CIDR块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的实例创建一个新的AWS VPC。但是,我注意到当我使用CIDR表示法创建VPC&公共子网,AWS指示我有n ^ 2-4(其中n是位数)个可用IP地址?为什么会这样?

I was in the process of creating a new AWS VPC for my instances. However, I noticed that when I used CIDR Notation to create the VPC & Public Subnet, AWS indicates that I have n^2 - 4 (where n is the # of bits) available IP addresses? Why is this?

我了解到,当n ^ 2 -2出现时,通常是删除位全为0或全为1的情况。但是不确定为什么是这种情况-在这种情况下为4。

I understand that when n^2 -2 occurs it is usually to remove the case where bits are all 0s or all 1s. But am not sure why it is - 4 in this case.

此处/ 28表示当我期望15或13时11个IP地址可用,而当我期望255或253时251个IP地址

Here the /28 indicates 11 IP addresses available when I expected 15 or 13, and 251 when I expected 255 or 253

推荐答案


重要

AWS在每个子网CIDR块中保留前四个IP地址和最后一个IP地址;它们不可供您使用。例如,在具有CIDR块10.0.0.0/24的子网中,保留了以下IP地址:10.0.0.0、10.0.0.1、10.0.0.2、10.0.0.3和10.0.0.255。

AWS reserves both the first four IP addresses and the last IP address in each subnet CIDR block; they're not available for you to use. For example, in a subnet with CIDR block 10.0.0.0/24, the following IP addresses are reserved: 10.0.0.0, 10.0.0.1, 10.0.0.2, 10.0.0.3, and 10.0.0.255.

  http:// docs .aws.amazon.com / AmazonVPC / latest / UserGuide / VPC_Subnets.html

除了网络和广播地址,自动配置的默认网关以及每个子网中VPC基础设施自动提供的用于提供服务的IP地址(例如DNS解析器和DHCP)。这些对您基本上是透明的,但这就是地址的去向以及为什么无法将其分配给子网中的实例。

In addition to the network and broadcast addresses, there's a default gateway automatically provisioned, as well as IP addresses used for delivering services automatically provided by the VPC infrastricture in each subnet (like DNS resolvers and DHCP). These are largely transparent to you, but that is where the addresses are going and the reason why they aren't available for assignment to instances in the subnet.

这篇关于Amazon VPC n ^ 2 -4 IP地址? CIDR块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆