gcloud compute routers create - create a Compute Engine router
gcloud compute routers create NAME --network=NETWORK [--advertisement-mode=MODE] [--asn=ASN] [--async] [--description=DESCRIPTION] [--keepalive-interval=KEEPALIVE_INTERVAL] [--region=REGION] [--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
Name of the router to create.
- --network=NETWORK
The network for this router
- --advertisement-mode=MODE
The new advertisement mode for this router. MODE must be one 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 a 16-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.
- --description=DESCRIPTION
An optional description of this router.
- --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 for information on duration formats.
BGP 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
Region of the router to create. If not specified, you might be prompted to select a region (interactive mode only).
To avoid prompting when this flag is omitted, you can set the compute/region property:
$ gcloud config set compute/region REGION
A list of regions can be fetched by running:
$ gcloud compute regions list
To unset the property, run:
$ gcloud config unset compute/region
Alternatively, 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 this router. This list can only be specified in custom advertisement mode.
GROUP must be (currently only one value is supported):
- ALL_SUBNETS
Automatically advertise all available subnets.
- --set-advertisement-ranges=[CIDR_RANGE=DESC,...]
The list of individual IP ranges, in CIDR format, to dynamically advertise on this 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 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.
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 help for details.
These variants are also available:
$ gcloud alpha compute routers create
$ gcloud beta compute routers create