本文介绍了CIDR 地址不在 VPC 的 CIDR 地址内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在适用于 AWS 的新 VPC 上为我的 CIDR 块尝试了各种 IP 范围组合.

I have tried every combination of IP ranges for my CIDR block on my new VPC for AWS.

我当前的 CIDR 是 172.31.0.0/16

My current CIDR is 172.31.0.0/16

171.31.0.0/32 (CIDR Address is not within CIDR Address from VPC)

推荐答案

一个 IPv4 地址由 32 位组成.

An IPv4 address consists of 32 bits.

1) CIDR x.x.x.x/32 中的/32 表示使用所有 32 位来形成地址范围.在这种情况下,只能使用一个 IP 地址.

1) /32 in CIDR x.x.x.x/32 means use all 32 bits to form a range of addresses. In this case just one IP address is possible.

2) CIDR x.x.x.0/24 中的/24 表示固定前 24 位并使用后 8 位形成地址范围.在这种情况下,可以有 2^8 个 IP 地址,即从 x.x.x.0 到 x.x.x.255.

2) /24 in CIDR x.x.x.0/24 means fix the first 24 bits and use last 8 bits to form a range of addresses. In this case, there can be 2^8 IP addresses i.e. from x.x.x.0 to x.x.x.255.

3) CIDR x.x.0.0/16 中的/16 表示固定前 16 位并使用后 16 位形成地址范围.在这种情况下,可以有 2^16 个 IP 地址,即从 x.x.0.0 到 x.x.255.255.

3) /16 in CIDR x.x.0.0/16 means fix the first 16 bits and use the last 16 bits to form a range of addresses. In this case, there can be 2^16 IP addresses i.e. from x.x.0.0 to x.x.255.255.

4) CIDR x.0.0.0/8 中的/8 表示固定前 8 位并使用后 24 位形成地址范围.在这种情况下,可以有 2^24 个 IP 地址,即从 x.0.0.0 到 x.255.255.255.

4) /8 in CIDR x.0.0.0/8 means fix the first 8 bits and use the last 24 bits to form a range of addresses. In this case, there can be 2^24 IP addresses i.e. from x.0.0.0 to x.255.255.255.

5) CIDR 0.0.0.0/0 中的/0 表示固定前 0 位并使用后 32 位形成地址范围.在这种情况下,所有可能的 IP 地址都包含在该范围内.

5) /0 in CIDR 0.0.0.0/0 means fix the first 0 bits and use the last 32 bits to form a range of addresses. In this case, all the possible IP addresses are included in the range.

希望它可以帮助您理解需要在 x.x.0.0/16 CIDR 中修复前 16 位的问题.

Hope it helps you in understanding your problem that first 16 bits needs to be fixed in x.x.0.0/16 CIDR.

这篇关于CIDR 地址不在 VPC 的 CIDR 地址内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-24 01:01