gcloud compute routers update Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud compute routers update - update a Compute Engine router
- SYNOPSIS
gcloud compute routers updateNAME[--advertisement-mode=MODE][--asn=ASN][--async][--bgp-identifier-range=BGP_IDENTIFIER_RANGE][--keepalive-interval=KEEPALIVE_INTERVAL][--region=REGION][--set-advertisement-groups=[GROUP,…]][--set-advertisement-ranges=[CIDR_RANGE=DESC,…]][--add-advertisement-groups=[GROUP,…] |--add-advertisement-ranges=[CIDR_RANGE=DESC,…] |--remove-advertisement-groups=[GROUP,…] |--remove-advertisement-ranges=[CIDR_RANGE,…]][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
gcloud compute routers updateis used to update a Compute Enginerouter.- POSITIONAL ARGUMENTS
NAME- Name of the router to update.
- FLAGS
--advertisement-mode=MODE- The new advertisement mode for this router.
MODEmust beone of:CUSTOM- Custom (user-configured) BGP advertisements.
DEFAULT- Default (Google-managed) BGP advertisements.
--asn=ASN- The optional BGP autonomous system number (ASN) for this router. Must be a16-bit or 32-bit private ASN as defined in https://tools.ietf.org/html/rfc6996,for example
--asn=64512. --async- Return immediately, without waiting for the operation in progress to complete.
--bgp-identifier-range=BGP_IDENTIFIER_RANGE- The range of valid BGP Identifiers for this Router. Must be a link-local IPv4range from 169.254.0.0/16, of size at least /30, even if the BGP sessions areover IPv6. It must not overlap with any IPv4 BGP session ranges. This iscommonly called "router ID" by other vendors.
--keepalive-interval=KEEPALIVE_INTERVAL- The interval between BGP keepalive messages that are sent to the peer. If set,this value must be between 20 and 60 seconds. The default is 20 seconds. See $gcloud topic datetimes forinformation on duration formats.
BGP systems exchange keepalive messages to determine whether a link or host hasfailed or is no longer available. Hold time is the length of time in secondsthat the BGP session is considered operational without any activity. After thehold time expires, the session is dropped.
Hold time is three times the interval at which keepalive messages are sent, andthe hold time is the maximum number of seconds allowed to elapse betweensuccessive keepalive messages that BGP receives from a peer. BGP will use thesmaller of either the local hold time value or the peer's hold time value as thehold time for the BGP connection between the two peers.
--region=REGION- Region of the router to update. If not specified, you might be prompted toselect a region (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
property:compute/regiongcloudconfigsetcompute/regionREGIONA list of regions can be fetched by running:
gcloudcomputeregionslistTo unset the property, run:
gcloudconfigunsetcompute/regionAlternatively, the region can be stored in the environment variable
.CLOUDSDK_COMPUTE_REGION --set-advertisement-groups=[GROUP,…]- The list of pre-defined groups of IP ranges to dynamically advertise on thisrouter. This list can only be specified in custom advertisement mode.
GROUPmust be (only one value is supported):ALL_SUBNETS- Automatically advertise all available subnets. This excludes any routes learnedfor subnets that use VPC Network Peering.
--set-advertisement-ranges=[CIDR_RANGE=DESC,…]- The list of individual IP ranges, in CIDR format, to dynamically advertise onthis router. Each IP range can (optionally) be given a text description DESC.For example, to advertise a specific range, use
--set-advertisement-ranges=192.168.10.0/24. To store a descriptionwith the range, use--set-advertisement-ranges=192.168.10.0/24=my-networks. This listcan only be specified in custom advertisement mode. - At most one of these can be specified:
--add-advertisement-groups=[GROUP,…]- A list of pre-defined groups of IP ranges to dynamically advertise on thisrouter. This list is appended to any existing advertisements. This field canonly be specified in custom advertisement mode.
GROUPmust be (only one value is supported):ALL_SUBNETS- Automatically advertise all available subnets. This excludes any routes learnedfor subnets that use VPC Network Peering.
--add-advertisement-ranges=[CIDR_RANGE=DESC,…]- A list of individual IP ranges, in CIDR format, to dynamically advertise on thisrouter. This list is appended to any existing advertisements. Each IP range can(optionally) be given a text description DESC. For example, to advertise aspecific range, use
--advertisement-ranges=192.168.10.0/24. Tostore a description with the range, use--advertisement-ranges=192.168.10.0/24=my-networks. This list canonly be specified in custom advertisement mode. --remove-advertisement-groups=[GROUP,…]- A list of pre-defined groups of IP ranges to remove from dynamic advertisementon this router. Each group in the list must exist in the current set of customadvertisements. This field can only be specified in custom advertisement mode.
GROUPmust be (only one value is supported):ALL_SUBNETS- Automatically advertise all available subnets. This excludes any routes learnedfor subnets that use VPC Network Peering.
--remove-advertisement-ranges=[CIDR_RANGE,…]- A list of individual IP ranges, in CIDR format, to remove from dynamicadvertisement on this router. Each IP range in the list must exist in thecurrent set of custom advertisements. This field can only be specified in customadvertisement mode.
- 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:
gcloudalphacomputeroutersupdategcloudbetacomputeroutersupdate
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 2025-05-07 UTC.