gcloud compute routers create NAME (--ncc-gateway=NCC_GATEWAY | --network=NETWORK) [--advertisement-mode=MODE] [--asn=ASN] [--async] [--bgp-identifier-range=BGP_IDENTIFIER_RANGE] [--description=DESCRIPTION] [--encrypted-interconnect-router] [--keepalive-interval=KEEPALIVE_INTERVAL] [--region=REGION] [--resource-manager-tags=[KEY=VALUE,…]] [--set-advertisement-groups=[GROUP,…]] [--set-advertisement-ranges=[CIDR_RANGE=DESC,…]] [GCLOUD_WIDE_FLAG …]
gcloud compute routers create is used to create a router to provide
dynamic routing to VPN tunnels and interconnects.
NAME--ncc-gateway=NCC_GATEWAY--network=NETWORK--advertisement-mode=MODEMODE must be
one of:
CUSTOMDEFAULT--asn=ASN--asn=64512.
--async--bgp-identifier-range=BGP_IDENTIFIER_RANGE--description=DESCRIPTION--encrypted-interconnect-router--keepalive-interval=KEEPALIVE_INTERVALBGP systems exchange keepalive messages to determine whether a link or host has failed or is no longer available. Hold time is the length of time in seconds that the BGP session is considered operational without any activity. After the hold time expires, the session is dropped.
Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers.--region=REGION
To avoid prompting when this flag is omitted, you can set the
property:
compute/region
gcloud config set compute/region REGIONA list of regions can be fetched by running:
gcloud compute regions listTo unset the property, run:
gcloud config unset compute/regionCLOUDSDK_COMPUTE_REGION.
--resource-manager-tags=[KEY=VALUE,…]--set-advertisement-groups=[GROUP,…]GROUP must be (only one value is supported):
ALL_SUBNETS--set-advertisement-ranges=[CIDR_RANGE=DESC,…]--set-advertisement-ranges=192.168.10.0/24. To store a description
with the range, use
--set-advertisement-ranges=192.168.10.0/24=my-networks. This list
can only be specified in custom advertisement mode.
--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 help for details.
gcloud alpha compute routers creategcloud beta compute routers creategcloud preview compute routers create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-09 UTC.