Cloud Router dynamically advertises subnets and propagates learned routes in the region where the router is configured or throughout the entire Virtual Private Cloud (VPC) network.
Whether Cloud Routers in a VPC network are regional or global depends on the VPC network's dynamic routing mode. When creating or editing a VPC network, you can set the dynamic routing mode to be regional or global.
Viewing a VPC network's dynamic routing mode
To view the current dynamic routing mode of a VPC network:
Console
- Go to the VPC networks page in the Google Cloud Console.
Go to the VPC networks page - Select the name of a network to view its details page.
- In the Dynamic routing mode section, the value indicates the dynamic routing mode, either Regional or Global.
gcloud
gcloud compute networks describe [NETWORK_NAME]
- In the output, the
routingMode
field indicates the dynamic routing mode of the VPC network, eitherREGIONAL
orGLOBAL
.
API
To view the dynamic routing mode of a VPC network, use the
networks.get
method.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/networks/NETWORK
Replace the following values:
PROJECT_ID
: the ID of the project that contains the VPC networkNETWORK
: the name of the VPC network
In the output, the routingMode
field indicates the dynamic routing mode
of the VPC network, either REGIONAL
or GLOBAL
.
Changing the dynamic routing mode of a VPC network
To change the dynamic routing mode of a VPC network:
Console
- Go to the VPC networks page in the Google Cloud Console.
Go to the VPC networks page - Select the name of a network to view its details page.
- Click Edit to modify the network.
- In the Dynamic routing mode section, select Regional or Global.
- Click Save to confirm.
gcloud
gcloud compute networks update [NETWORK_NAME] \ --bgp-routing-mode [ROUTING-MODE]
--bgp-routing-mode
— Specifyregional
orglobal
. The default isregional
.
API
To change the dynamic routing mode of an existing VPC
network, use the
networks.patch
method.
PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/networks/NETWORK { "routingConfig": { "routingMode": "ROUTING_MODE" } }
Replace the following values:
PROJECT_ID
: the ID of the project that contains the VPC network to modifyNETWORK
: the name of the VPC network to modifyROUTING_MODE
: eitherGLOBAL
orREGIONAL
What's next?
- For more information about specifying the dynamic routing mode when creating a VPC network, see Using VPC networks in the VPC documentation.
- For more information about the dynamic routing mode, see Dynamic routing mode.