> ## Documentation Index
> Fetch the complete documentation index at: https://docs.megaport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a Google Cloud Services Connection for an MVE with Versa Secure SD-WAN

> This help topic describes how to provision connections between MVE and Google Cloud Services and integrate the connection with Versa Secure SD-WAN.

export const Image = ({src, alt = '', caption, width, height, shadow}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Image -';
  if (typeof src !== 'string') {
    src = String(src);
  }
  if (!src || src === 'undefined') {
    console.error(`${errorPrefix} \`src\` is required — rendering an empty string instead`);
    return <></>;
  }
  const img = <img className={['mega-image-style', shadow ? 'shadow' : ''].join(' ')} src={src} alt={alt} width={width} height={height} style={{
    display: 'block'
  }} />;
  return caption ? <figure>
      {img}
      <figcaption style={{
    textAlign: 'center',
    width
  }}>{caption}</figcaption>
    </figure> : img;
};

export const InlineImage = ({src, alt, height = 16, shadow, width}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: InlineImage -';
  if (typeof src !== 'string') {
    src = String(src);
  }
  if (!src || src === 'undefined') {
    console.error(`${errorPrefix} \`src\` is required — rendering an empty string instead`);
    return <></>;
  }
  if (typeof alt !== 'string') {
    alt = String(alt);
  }
  if (alt === 'undefined') {
    console.error(`${errorPrefix} \`alt\` is required (use "" for decorative images) — rendering an empty string instead`);
    return <></>;
  }
  if (height) {
    height = height.toString().replaceAll(/\D/g, '');
  }
  if (width) {
    width = width.toString().replaceAll(/\D/g, '');
  }
  return <img className={['inline-icon', shadow ? 'shadow' : null, 'm-0'].filter(Boolean).join(' ')} src={src} alt={alt} height={height} width={width} style={{
    display: 'inline',
    verticalAlign: 'middle',
    maxHeight: height ? `${height}px` : undefined,
    maxWidth: width ? `${width}px` : undefined,
    height: height ? `${height}px` : undefined,
    width: width ? `${width}px` : undefined
  }} />;
};

export const Link = ({href, children}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Link -';
  if (typeof href !== 'string') {
    href = String(href);
  }
  if (!href || href === 'undefined') {
    console.error(`${errorPrefix} the \`href\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (href.includes('{') || href.toUpperCase().includes('%7B')) {
    console.error(`${errorPrefix} could not resolve a variable in href "${href}" — rendering an empty string instead`);
    return <></>;
  }
  const isExternal = (/^https?:\/\//).test(href);
  return <a href={href} className="link" target={isExternal ? '_blank' : undefined} rel={isExternal ? 'noreferrer' : undefined}>
      {children ?? href}
      {isExternal && <span className="sr-only"> (opens in a new tab)</span>}
    </a>;
};

You can create a network connection from an MVE with Versa Secure SD-WAN to Google Cloud through Partner Interconnect.

When connecting to Google Cloud Platform (GCP) through Partner Interconnect with Megaport, the Virtual Cross Connect (VXC) forms the Layer 2 component of the connection and Layer 3 BGP is established directly between the customer and GCP.

<Callout icon="triangle-exclamation" color="red">
  Before you begin, create an MVE in Versa Director. For more information, see [Creating an MVE](/mve/versa/creating-mve). The MVE needs to be in the active state.
</Callout>

There are three parts to adding a Google Cloud connection to your MVE and Versa Director.

1. Create a Partner Interconnect attachment in Google Cloud Console or gcloud CLI. Copy the pairing key that is provided as part of the attachment creation. For additional details, see the Google documentation on
   [Google Partner Interconnects](https://cloud.google.com/interconnect/docs/how-to/partner/provisioning-overview).

2. In the Megaport Portal, create a VXC from your MVE to connect to your Google Cloud attachment.

3. In Versa Director, create a new interface and add the details of the Google Cloud connection.

These instructions step through the second and third parts.

<Note>
  MVE for Versa Secure SD-WAN requires configuration steps in both Versa Director and the Megaport Portal for all cloud connections.
</Note>

## Adding the Google Cloud connection in the Megaport Portal

To set up the Google Cloud Platform connection, you need to create the connection in the Megaport Portal.

**To create a connection to GCP from the Megaport Portal**

1. In the <Link href="https://portal.megaport.com">Megaport Portal</Link>, go to the **Services** page and select the MVE for the connection.

2. Click **+Connection** then click **Cloud**.
   <Image src="/images/cloud/mve/add-connection.png" alt="Add connection" shadow={true} width={700} />

3. Select Google as the provider.

   <Image src="/images/cloud/megaport/google/gc-vxc-config.png" alt="Google as the provider" shadow={true} width={700} />

   <Tip>
     To check the latency and price of connecting to a particular Google location, click **View all Google Partner locations**. You can proceed to the Connection Details page without a pairing key and review the pricing of the selected port. To place an order for a Google connection, you need to provide a pairing key.
   </Tip>

4. Copy and paste the pairing key from the Google Cloud console into the Google Partner Pairing Key field.\
   The relevant Google targets appear based on the region of your GCI Partner connection.

5. Select the target location for your connection then click **Next**.

6. Specify the connection details:

   * **Connection Name** -- The name of your VXC to be shown in the <Link href="https://portal.megaport.com">Megaport Portal</Link>.

   * **Service Level Reference** (optional) -- Specify a unique identifying number for your Megaport service to be used for billing purposes, such as a cost center number, unique customer ID, or purchase order number. The service level reference number appears for each service under the Product section of the invoice. You can also edit this field for an existing service.

   * **Rate Limit** -- The speed of your connection in Mbps. Enter the same rate you selected for your Google port speed.

   * **VXC State** -- Select **Enabled** or **Shut Down** to define the initial state of the connection. For more information, see [Shutting Down a VXC for Failover Testing](/connections/shut-down-vxc).

     <Note>
       If you select **Shut Down**, traffic will not flow through this service and it will behave as if it was down on the Megaport network. Billing for this service will remain active and you will still be charged for this connection.
     </Note>

   * **A-End vNIC** -- Select an A-End vNIC from the drop-down list. For more information about vNICs, see [Creating an MVE in the Megaport Portal](/mve/versa/creating-mve#creating-mve).

   * **Preferred A-End VLAN** -- The VLAN for this connection that you will receive through the MVE. This must be a unique VLAN ID on this MVE and can range from 2 to 4093. If you specify a VLAN ID that is already in use, the system displays the next available VLAN number. The VLAN ID must be unique to proceed with the order. If you don't specify a value, Megaport will assign one.

   * **Minimum Term** -- Select No Minimum Term, 12 Months, 24 Months, 36 Months, 48 Months, or 60 Months. Longer terms result in a lower monthly rate. *12 Months* is selected by default. Take note of the information on the screen to avoid early termination fees (ETF).

     Enable the [Minimum Term Renewal](/portal-admin/auto-renew/#auto-renew) option for services with a 12, 24, 36, 48 or 60-month term to automatically renew the contract at the same discounted price and term length at the end of the contract. If you don't renew the contract, at the end of the term,  the contract will automatically roll over to month-to-month contract for the following billing period, at the same price, without term discounts.

     For more information, see [VXC Pricing and Contract Terms](/finance/vxc-pricing) and [VXC, Megaport Internet, and IX Billing](/finance/billing-details).

   * **Resource Tags** -- You can use resource tags to add your own reference metadata to a Megaport service.\
     To add a tag:
     1. Click **Add Tags**.
     2. Click  **Add New Tag**.
     3. Enter details into the fields:
        * **Key** -- string maximum length 128. Valid values are a-z 0-9 \_ : . / \ -
        * **Value** -- string maximum length 256. Valid values are a-z A-Z 0-9 \_ : . @ / + \ - (space)
     4. Click **Save**.
        If you already have resource tags for that service, you can manage them by clicking **Manage Tags**.
     <Warning>
       Never include sensitive information in a resource tag. Sensitive information includes commands that return existing tag definitions and information that will identify a person or company.
     </Warning>

   <Image src="/images/cloud/mve/portal-cloud-create-details.png" alt="Google connection details" shadow={true} width={550} />

7. Click **Next** to proceed to the connection detail summary, then click **Add VXC**.

8. Click **Review Order** to proceed through the checkout process, or click **Save** to save the configured services before placing the order.

9. Review the Important Information section and confirm agreement with the Service Agreements.

   If you do not have a promotion code, skip to the **Order Now** step. If you do have a promotion code, enter it into the **Enter discount code** field then click **Apply**. Alternatively, if a code already appears in the **Discounts** field, verify it is correct and click **Apply**.

   The promotional discount appears below the Standard Term discount.  This discount is not reflected in the Monthly Rate shown here, it is applied at the time of billing.  If an invalid or expired code causes an error with your order, contact your Megaport Account Manager for a replacement code.

   <Image src="/images/snippets/add-promo-code.png" alt="Add Promo Code" shadow={true} width={750} />

   If you entered an incorrect promotion code, you can remove it by clicking **Remove**.

10. Click **Order Now**.

11. Once you have deployed the VXC, go back to your attachment in the Google Cloud Console and accept the attachment.\
    You will be provided your private IP address from Google to configure BGP.\
    Ensure that you pre-activate the attachment or mark the attachment as active after configuring the VXC. Otherwise, you cannot set up BGP with your SD-WAN instance.

<Note>
  The Google ASN will always be 16550.
</Note>

## Adding the Google Cloud connection to Versa Director

After you create the connection from your MVE to Google Cloud and set up the connection in the Google console, you need to configure it in Versa Director. This involves configuring BGP settings, ASNs, and VLANs.

**To add the Google Cloud connection in Versa Director**

1. Collect the connection details from the Google console.\
   Display the details of the connection you created in Google Cloud for this connection. Note the values for the **Peer ASN**, **Cloud Router BGP IP**, and **BGP Peer IP**.
   <Image src="/images/cloud/mve/google-connection-settings.png" alt="Google connection details" shadow={true} width={800} />

2. Collect the connection details from the Megaport Portal.\
   Click the gear icon for the Google connection from your MVE and click the Details view.
   Note the value for the **A-End VLAN**.\
   Next, you will add a subinterface to your Versa MVE instance.

3. Log in to Versa Director.

4. Select the **Workflows** tab in the top menu bar.

5. Select Template > Templates in the left menu bar.
   <Image src="/images/cloud/mve/versa-choose-template.png" alt="Choose template" shadow={true} width={900} />

6. Select the template you want to edit, then select the **Interfaces** tab.

7. Under WAN Interfaces, click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add) to add a subinterface.
   <Image src="/images/cloud/mve/versa/google/versa-addsubint.png" alt="Add subinterface" shadow={true} width={900} />

8. Provide the following information:
   * **VLAN ID** -- Enter the A-End VLAN value for this Google connection in the Megaport Portal. Click the Details icon for the connection in the Portal to find this value.
   * **Network Name** -- Choose **+Create WAN Network** from the drop-down to open the Create WAN Network window. Specify a meaningful name for the network, click **OK**, and then select the WAN network you created. (Or, if appropriate for your environment, select an existing network name.)
   * **IPv4** -- Choose **Static** from the drop-down to assign a static IP address to this subinterface.
   <Image src="/images/cloud/mve/versa/google/versa-int-tab.png" alt="Interfaces tab" shadow={true} width={900} />
   We have finished creating the interface. Next we need to create the BGP session.

9. Select the **Routing** tab to add the BGP configuration information.

10. In the BGP section, choose the network created earlier.

11. Enter the following values for your connection:
    * **Local AS** -- This is the **Peer ASN** value from the VLAN attachment details in the Google Cloud console.
    * **Neighbor IP** -- This is the local Google Cloud IP address. This value is available in the VLAN attachment details in the Google Cloud console. The IP address appears in the **Cloud Router BGP IP** field.
    * **Peer AS** -- This is the Google Cloud ASN of 16550. This is a fixed value, and appears in the connection details on the Google console.
    * Optionally, enable BFD (as appropriate for your network).

12. Click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add).
    <Image src="/images/cloud/mve/versa/google/versa-bgp.png" alt="Director BGP values" shadow={true} width={900} />

13. Click **Recreate**.\
    A screen appears that shows the differences in the configuration. The auto-merged version is recommended, and selected by default.

14. Click **Deploy**.

At this point, we have updated the template assigned to the device group. Next, we will parameterize variables to generate routing information dynamically.

**To parameterize the configuration variables**

1. Select the **Configuration** tab in the top menu bar.
2. Select Templates > Device Templates in the horizontal menu bar.
   <Image src="/images/cloud/mve/director-device-templates.png" alt="Device Templates" shadow={true} width={700} />
3. Click the template you want to modify.\
   By default, the Interfaces column appears.
4. In the side navigation, select Virtual Routers, and click the link for the subinterface network to open the Edit window.
   <Image src="/images/cloud/mve/versa/google/versa-virtual-routers.png" alt="Virtual Routers" shadow={true} width={900} />
5. In the side navigation, select BGP, then click the Instance ID for your network.
6. In the Edit BGP Instance window, click <InlineImage src="/images/mve/versa/parameterize-icon.png" alt="Parameterize icon" /> (Parameterize) next to each of the following fields: **Router ID**, **Local AS**, **Peer AS**, and **Password**.
   <Image src="/images/cloud/mve/versa/google/versa-edit-bgpinstance.png" alt="Edit BGP Instance window" shadow={true} width={700} />
7. Click **OK** two times to update.

Next we need to configure the device and create the BGP session.

**To update parameterized variables for a device**

1. Select the **Workflows** tab in the top menu bar.
2. Select Devices > Devices in the horizontal menu bar.
   <Image src="/images/cloud/mve/versa/google/versa-devices.png" alt="Versa devices list" shadow={true} width={700} />
3. Click the device to modify.
4. Select the **Bind Data** tab.\
   All parameterized values are displayed here.
   <Image src="/images/cloud/mve/versa/google/versa-bind-data.png" alt="Bind Data tab" shadow={true} width={700} />
5. Enter the following values for the variables:
   * **Local AS number** -- The Customer ASN in the Megaport Portal.
   * **MD5 password** -- The BGP Auth Key in the Megaport Portal.
   * **BGP Peer AS** -- 16550, the Google Cloud ASN.
   * **BGP Router ID** -- The Customer IP address (your local IP address) from the MVE details.
   * **Next Hop Address** -- The Cloud Router BGP IP from the VLAN attachment details in the Google Cloud console.
   * **Interfaces with Mask** -- The static IP address of the interface on the Megaport side of the connection, including the mask value.
6. Click **Deploy** to create the new configuration for the device.
   When the new configuration for the device has completed successfully, a green checkmark appears at the bottom of the Director window.
7. In the upper right of the screen under your username, click **Commit Template** to push the changes to the device.
   <Image src="/images/cloud/mve/versa/google/versa-commit-template.png" alt="Commit Template" shadow={true} width={700} />
8. Specify the following values:
   * **Organization** -- Select your organization from the drop-down.
   * **Select Template** -- Select your template to display its associated devices in the table.
   * **Differences** -- Click the eye icon in the Differences column to view the configuration to be applied to the device.
     <Image src="/images/cloud/mve/versa/google/versa-commit-dialog.png" alt="Commit window" shadow={true} width={700} />
9. If you are satisfied with the configuration, click **Commit to Device**.\
   A green checkmark appears at the bottom right of the screen when the push is successful. The Template State and Appliance State are now IN\_SYNC with the device.
10. Close the window.

## Validating your Google Cloud connection

You can review device status, including the connection state, from the Monitor tab in Director.

1. Select the **Monitor** tab in the top menu bar.
2. Select Devices in the horizontal menu bar.
3. Click the device to view status and activity.
   <Image src="/images/cloud/mve/versa/google/versa-monitor-device.png" alt="Select device to monitor" shadow={true} width={700} />
   In the Summary screen you can review your subinterface in the Interface column, and the Operational and Admin Status.
   <Image src="/images/cloud/mve/versa/google/versa-monitor-details.png" alt="Monitoring details" shadow={true} width={700} />
4. Return to Google Cloud Platform and refresh to see the new virtual interface.
