gcloud compute networks create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud compute networks create - create a Compute Engine network
- SYNOPSIS
gcloud compute networks createNAME[--bgp-routing-mode=MODE; default="regional"][--description=DESCRIPTION][--[no-]enable-ula-internal-ipv6][--internal-ipv6-range=INTERNAL_IPV6_RANGE][--mtu=MTU][--network-firewall-policy-enforcement-order=NETWORK_FIREWALL_POLICY_ENFORCEMENT_ORDER][--network-profile=NETWORK_PROFILE][--range=RANGE][--resource-manager-tags=[KEY=VALUE,…]][--subnet-mode=MODE][--bgp-best-path-selection-mode=BGP_BEST_PATH_SELECTION_MODE--[no-]bgp-bps-always-compare-med--bgp-bps-inter-region-cost=BGP_BPS_INTER_REGION_COST][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
gcloud compute networks createis used to create virtual networks.A network performs the same function that a router does in a home network: itdescribes the network range and gateway IP address, handles communicationbetween instances, and serves as a gateway between instances and callers outsidethe network.- EXAMPLES
- To create a regional auto subnet mode network with the name 'network-name', run:
gcloudcomputenetworkscreatenetwork-nameTo create a global custom subnet mode network with the name 'network-name', run:
gcloudcomputenetworkscreatenetwork-name--bgp-routing-mode=global--subnet-mode=custom - POSITIONAL ARGUMENTS
NAME- Name of the network to create.
- FLAGS
--bgp-routing-mode=MODE; default="regional"- The BGP routing mode for this network. If not specified, defaults to regional.
MODEmust be one of:global- Cloud Routers in this network advertise subnetworks from all regions to theirBGP peers, and program instances in all regions with the router's best learnedBGP routes.
regional- Cloud Routers in this network advertise subnetworks from their local region onlyto their BGP peers, and program instances in their local region only with therouter's best learned BGP routes.
--description=DESCRIPTION- An optional, textual description for the network.
--[no-]enable-ula-internal-ipv6- Enable/disable ULA internal IPv6 on this network. Enabling this feature willassign a /48 from google defined ULA prefix fd20::/20.
Use
--enable-ula-internal-ipv6to enable and--no-enable-ula-internal-ipv6to disable. --internal-ipv6-range=INTERNAL_IPV6_RANGE- When enabling ULA internal IPv6, caller can optionally specify the /48 rangethey want from the google defined ULA prefix fd20::/20. ULA_IPV6_RANGE must be avalid /48 ULA IPv6 address and within the fd20::/20. Operation will fail if thespeficied /48 is already in used by another resource. If the field is notspeficied, then a /48 range will be randomly allocated from fd20::/20 andreturned via this field.
--mtu=MTU- Maximum transmission unit (MTU) is the size of the largest IP packet that can betransmitted on this network. Default value is 1460 bytes. The minimum value is1300 bytes and the maximum value is 8896 bytes. The MTU advertised via DHCP toall instances attached to this network.
--network-firewall-policy-enforcement-order=NETWORK_FIREWALL_POLICY_ENFORCEMENT_ORDER- The Network Firewall Policy enforcement order of this network. If not specified,defaults to AFTER_CLASSIC_FIREWALL.
NETWORK_FIREWALL_POLICY_ENFORCEMENT_ORDERmust be oneof:AFTER_CLASSIC_FIREWALL- Network Firewall Policy is enforced after classic firewall.
BEFORE_CLASSIC_FIREWALL- Network Firewall Policy is enforced before classic firewall.
--network-profile=NETWORK_PROFILE- The network profile to apply to this network.
--range=RANGE- Specifies the IPv4 address range of legacy mode networks. The range must bespecified in CIDR format:http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
This flag only works if mode islegacy.
Using legacy networks is **DEPRECATED**, given that many newer Google CloudPlatform features are not supported on legacy networks. Please be advised thatlegacy networks may not be supported in the future.
--resource-manager-tags=[KEY=VALUE,…]- A comma-separated list of Resource Manager tags to apply to the network.
--subnet-mode=MODE- The subnet mode of the network. If not specified, defaults to AUTO.
MODEmust be one of:auto- Subnets are created automatically. This is the recommended selection.
custom- Create subnets manually.
legacy- [Deprecated] Create an old style network that has a range and cannot havesubnets. This is not recommended for new networks.
- BGP Best Path Selection flags
--bgp-best-path-selection-mode=BGP_BEST_PATH_SELECTION_MODE- The BGP best path selection algorithm to be employed.
BGP_BEST_PATH_SELECTION_MODEmust be one of:LEGACY- Dynamic routes are ranked based on the multiple exit-discriminator (MED) BGPattribute. When global routing is enabled, the MED of the routes received fromother regions is the original MED plus the region-to-region cost.
STANDARD- Dynamic routes are ranked based on AS Path, Origin, Neighbor ASN and MED BGPattributes. When global routing is enabled, region-to-region cost is used as atiebreaker. This mode offers customizations to fine-tune BGP best path routingwith additional flags like --bgp-bps-always-compare-med and--bgp-bps-inter-region-cost
--[no-]bgp-bps-always-compare-med- Enables/disables the comparison of MED across routes with different NeighborASNs. This value can only be set if the --bgp-best-path-selection-mode isSTANDARD. Use
--bgp-bps-always-compare-medto enable and--no-bgp-bps-always-compare-medto disable. --bgp-bps-inter-region-cost=BGP_BPS_INTER_REGION_COST- Defines the preferred approach for handling inter-region cost in the selectionprocess. This value can only be set if the --bgp-best-path-selection-mode isSTANDARD.
BGP_BPS_INTER_REGION_COSTmust be one of:ADD_COST_TO_MED- Adds inter-region cost to the MED before comparing the MED value. When multipleroutes have the same value after the Add-cost-to-med comparison, the routeselection continues and prefers the route with lowest cost.
DEFAULT- MED is compared as originally received from peers. When multiple routes have thesame MED, cost is evaluated as the next step.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- These variants are also available:
gcloudalphacomputenetworkscreategcloudbetacomputenetworkscreate
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-21 UTC.