GCP 网络中的多个子网
Multiple subnets in a GCP network
子网是区域资源,网络是全局资源。我正在做一个 Google LAB,我正面临这个疑问。
有这样的网络:
networkA
subnet-a
和 subnet-b
都在 us-central1
地区
怎么可能?
我看不出这样的配置有什么问题。
请查看文档 Networks and subnets:
Each VPC network consists of one or more useful IP range partitions called subnets. Each subnet is associated with a
region.
和
A network must have at least one subnet before you can use it. Auto
mode VPC networks create subnets in each region automatically. Custom
mode VPC networks start with no subnets, giving you full control over
subnet creation. You can create more than one subnet per region.
因此,根据文档,网络 test-network
可能有两个子网 subnet-a
和 subnet-b
都在同一区域 us-central1
,例如:
$ gcloud compute networks create test-network --subnet-mode=custom --mtu=1460 --bgp-routing-mode=regional
$ gcloud compute networks subnets create subnet-a --range=10.0.1.0/24 --network=test-network --region=us-central1
$ gcloud compute networks subnets create subnet-b --range=10.0.2.0/24 --network=test-network --region=us-central1
$ gcloud compute networks list
NAME SUBNET_MODE BGP_ROUTING_MODE IPV4_RANGE GATEWAY_IPV4
test-network CUSTOM REGIONAL
$ gcloud compute networks subnets list
NAME REGION NETWORK RANGE
subnet-a us-central1 test-network 10.0.1.0/24
subnet-b us-central1 test-network 10.0.2.0/24
另外看看文档部分 Communication within the network:
Except for the default network, you must explicitly create higher
priority ingress firewall rules to allow instances to communicate with
one another. The default network includes several firewall rules in
addition to the implied ones, including the default-allow-internal
rule, which permits instance-to-instance communication within the
network. The default network also comes with ingress rules allowing
protocols such as RDP and SSH.
如果您还有其他疑问,请更新您的问题。
子网是区域资源,网络是全局资源。我正在做一个 Google LAB,我正面临这个疑问。
有这样的网络:
networkA
subnet-a
和 subnet-b
都在 us-central1
怎么可能?
我看不出这样的配置有什么问题。
请查看文档 Networks and subnets:
Each VPC network consists of one or more useful IP range partitions called subnets. Each subnet is associated with a region.
和
A network must have at least one subnet before you can use it. Auto mode VPC networks create subnets in each region automatically. Custom mode VPC networks start with no subnets, giving you full control over subnet creation. You can create more than one subnet per region.
因此,根据文档,网络 test-network
可能有两个子网 subnet-a
和 subnet-b
都在同一区域 us-central1
,例如:
$ gcloud compute networks create test-network --subnet-mode=custom --mtu=1460 --bgp-routing-mode=regional
$ gcloud compute networks subnets create subnet-a --range=10.0.1.0/24 --network=test-network --region=us-central1
$ gcloud compute networks subnets create subnet-b --range=10.0.2.0/24 --network=test-network --region=us-central1
$ gcloud compute networks list
NAME SUBNET_MODE BGP_ROUTING_MODE IPV4_RANGE GATEWAY_IPV4
test-network CUSTOM REGIONAL
$ gcloud compute networks subnets list
NAME REGION NETWORK RANGE
subnet-a us-central1 test-network 10.0.1.0/24
subnet-b us-central1 test-network 10.0.2.0/24
另外看看文档部分 Communication within the network:
Except for the default network, you must explicitly create higher priority ingress firewall rules to allow instances to communicate with one another. The default network includes several firewall rules in addition to the implied ones, including the default-allow-internal rule, which permits instance-to-instance communication within the network. The default network also comes with ingress rules allowing protocols such as RDP and SSH.
如果您还有其他疑问,请更新您的问题。