To complete your NCC Gateway configuration in a greenfield environment, your Google Cloud and on-premises or other cloud environments must be connected through hybrid connectivity by using Cloud Interconnect VLAN attachments with Cloud Router.
This page describes how to create a Cloud Router and a VLAN attachment and connect them to NCC Gateway.
Create a Cloud Router
Before you create and connect the Cloud Router, keep the following considerations in mind:
- The Cloud Router must be associated with an NCC Gateway in the same region.
- At the most, one service, such as a Secure Access Connect attachment, can be attached to an NCC Gateway at a time.
- Only the VLAN attachments whose BGP sessions are managed by the Cloud Router that's associated with the NCC Gateway are part of the NCC Gateway spoke.
For detailed information about Cloud Router, see Cloud Router overview.
To create a Cloud Router, do the following:
Console
To create a Cloud Router and associate it with an NCC Gateway spoke, you must first Create an NCC Gateway spoke.
In the Google Cloud console, go to the Network Connectivity Center page.
In the project menu, select a project in which you want to create the spoke.
Click the Spokes tab.
Click the spoke that you want to associate with the Cloud Router.
On the Spoke details page, click Add Cloud Router. This step automatically preselects Associated with to NCC Gateway.
Specify the Cloud Router's details:
Name: The name of the Cloud Router. This name is displayed in the Google Cloud console and is used by Google Cloud CLI to reference the Cloud Router—for example,
my-router.Description: Optional. A description of the Cloud Router.
Region: The region where you want to locate the Cloud Router—for example,
asia-east1.Google ASN: Any private ASN (
64512-65534,4200000000-4294967294) that you aren't already using in the on-premises network.Cloud Router requires that you use a private ASN, but your on-premises ASN can be public or private.
BGP peer keepalive interval: The interval between two successive BGP keepalive messages that are sent to the peer router. This value must be an integer between 20 and 60 that specifies the number of seconds for the interval. The default is 20 seconds. For more information, see Manage BGP timers.
BGP identifier: Optional. The BGP identifier, sometimes called a router ID, that uniquely identifies a Cloud Router in a network. If omitted, Cloud Routers with IPv4 BGP sessions use one of the IPv4 BGP addresses as the BGP identifier, and adding the first IPv6 interface to this Cloud Router populates the field automatically.
For more information, see Configure the BGP identifier range for a Cloud Router.
Optional: To specify custom advertised routes, go to the Advertised routes section. For more information, see Advertised routes.
To specify custom Routes, select Create custom routes.
Choose whether to advertise the subnets visible to the Cloud Router. Enabling this option mimics the Cloud Router's default behavior.
To add an advertised route, select Add a custom route, and then configure it.
To save your settings and create a Cloud Router, click Create.
Your new Cloud Router appears on the Cloud Router page under Routers associated with NCC Gateway.
gcloud
Use the gcloud compute routers create
command. Cloud Routers
in gateway spokes must use the custom advertisement mode. In this example,
the router-level advertisement mode is set to CUSTOM.
For information about the effect of the router-level advertisement mode on individual BGP session advertisements, see Effective advertisements.
gcloud compute routers create ROUTER_NAME \
--project=PROJECT_ID \
--ncc-gateway=NCC_GATEWAY_URI \
--region=REGION\
--asn=ASN_NUMBER \
--advertisement-mode=CUSTOM \
--set-advertisement-ranges=CUSTOM_ADVERTISED_RANGES \
[--bgp-identifier-range=ROUTER_IDENTIFIER_RANGE] \
[--keepalive-interval=KEEPALIVE_TIMER] \
Replace the following:
ROUTER_NAME: the name of the Cloud RouterPROJECT_ID: the project ID for the project that contains the Cloud RouterNCC_GATEWAY_URI: the full URI of the NCC Gateway associated with the router. The format of the URI follows this pattern:https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/spokes/GATEWAY_SPOKE_NAMEREGION: the region that contains the Cloud RouterASN_NUMBER: any private ASN (64512-65534,4200000000-4294967294) that you aren't already using in the on-premises networkCloud Router requires you to use a private ASN, but your on-premises ASN can be public or private.
CUSTOM_ADVERTISED_RANGES: the list of custom IP address ranges in CIDR format or individual IP addresses to be included in the router-level advertisementsIndividual IPv4 addresses are interpreted as a CIDR with a
/32subnet mask, and individual IPv6 addresses are interpreted as a CIDR with a/128subnet mask. For information about the maximum number of custom route advertisements, see Limits.ROUTER_IDENTIFIER_RANGE: an optional IPv4 address range that serves as a unique identifier for the Cloud RouterFor more information, see Configure the BGP identifier range for a Cloud Router.
KEEPALIVE_TIMER: an optional time, in seconds, that defines the BGP keepalive timer.Valid values are between
20and60, inclusive. If you omit the--keepalive-intervalflag, Cloud Router uses a 20 second BGP keepalive timer. For more information, see Keepalive timer.
API
Use the compute.router.insert method
with NCC Gateway specified in the payload. To specify
router-level custom route advertisements, set the bgp.advertiseMode
flag to CUSTOM. For information about the effect of the router-level
advertisement mode on individual BGP session advertisements, see Effective
advertisements.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers
{
"name": "ROUTER_NAME",
"ncc_gateway": "NCC_GATEWAY_URI",
"bgp": {
"asn": "ASN_NUMBER",
"advertiseMode": CUSTOM,
"advertisedIpRanges": [
{
"range": CUSTOM_ADVERTISED_RANGE,
"description": CUSTOM_ADVERTISED_RANGE_DESCRIPTION
}, ...
],
"identifierRange": ROUTER_IDENTIFIER_RANGE,
"keepaliveInterval": KEEPALIVE_TIMER
}
}
Replace the following:
PROJECT_ID: the project ID for the project that contains the Cloud RouterREGION: the region that contains the Cloud RouterROUTER_NAME: the name of the Cloud RouterNCC_GATEWAY_URI: the full URI of the NCC Gateway associated with the router. The format of the URI follows this pattern:https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/spokes/GATEWAY_SPOKE_NAMEASN_NUMBER: any private ASN (64512-65534,4200000000-4294967294) that you aren't already using in the on-premises networkCloud Router requires you to use a private ASN, but your on-premises ASN can be public or private.
CUSTOM_ADVERTISED_RANGEandCUSTOM_ADVERTISED_RANGE_DESCRIPTION: keys in a dictionary that specify a router-level custom route advertisementThe
bgp.advertisedIpRangeslist contains each custom route advertisement dictionary. Specifyingbgp.advertisedIpRangesrequiresbgp.advertiseMode: CUSTOM. EachCUSTOM_ADVERTISED_RANGEis an IP address range in CIDR format or an individual IP address. Individual IPv4 addresses are interpreted as a CIDR with a/32subnet mask, and individual IPv6 addresses are interpreted as a CIDR with a/128subnet mask. For information about the maximum number of custom route advertisements, see Limits. EachCUSTOM_ADVERTISED_RANGE_DESCRIPTIONis a string to describe the advertisement.ROUTER_IDENTIFIER_RANGE: defines an IPv4 address range that serves as a unique identifier for the Cloud RouterFor more information, see Configure the BGP identifier range for a Cloud Router.
KEEPALIVE_TIMER: an optional time, in seconds, that defines the BGP keepalive timerValid values are between
20and60, inclusive. If you omitbgp.keepaliveInterval, Cloud Router uses a 20 second BGP keepalive timer. For more information, see Keepalive timer.
Create VLAN attachments
VLAN attachments for Dedicated Interconnect or Partner Interconnect provide the connectivity path between the NCC Gateway and an on-premises network.
The VLAN attachment traffic goes through the NCC Gateway before it reaches the partner service and the hub.
For detailed information about how to create VLAN attachments and set up interface and BGP peering, see Create VLAN attachments.