Legacy networks do not support the following. To use any of these features, create a VPC network instead.
- VPC subnets
- Alias IP
- Multiple Network Interfaces
- Shared VPC
- VPC Peering
- Private Google Access
- Most new GCP networking features
Creating a legacy network
You can still create a legacy network, which does not have any subnets. Legacy networks have a single global IP range. You cannot create subnets in a legacy network or switch from legacy to auto or custom VPC networks.
Create a new legacy network in your project.
gcloud compute networks create legacy-network1 \ --subnet-mode legacy \ --range 10.240.0.0/16
Created [https://www.googleapis.com/compute/latest/projects/PROJECT_ID/global/networks/legacy-network1]. NAME MODE IPV4_RANGE GATEWAY_IPV4 legacy-network1 legacy 10.240.0.0/16 10.240.0.1
Deleting a legacy network
For a legacy network, you can explicitly delete the network only if the network is not in use by any resources.
To delete the network:
gcloud compute networks delete my-legacy-network