简体   繁体   中英

Multiple subnets in a GCP network

Su.nets are regional resource, while.network are global resource. I am doing a Google LAB and I am facing up this doubt.

There is this kind of.network: networkA with su.net-a and su.net-b both in region us-central1

How is it possible?

I can see no issue with such configuration.

Please have a look at the documentation Networks and su.nets :

Each VPC.network consists of one or more useful IP range partitions called su.nets . Each su.net is associated with a region.

and

A.network must have at least one su.net before you can use it. Auto mode VPC.networks create su.nets in each region automatically. Custom mode VPC.networks start with no su.nets, giving you full control over su.net creation. You can create more than one su.net per region .

So, accordingly to the documentation, it's possible to have a.network test.network with two su.nets su.net-a and su.net-b both in same region us-central1 , for example:

$ 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

In addition have a look at the documentation section 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.

Please update your question if you have other doubts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM