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

# Google VXC Setup

> Step-by-step guide to provisioning a Telnyx Virtual Cross Connect (VXC) to Google Cloud Interconnect, including VLAN attachment and BGP setup.

## Architecture

We will construct the following architecture on Google Cloud.

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-architecture.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=fcfacd63759b5ba8de5fc3b9abf8654d" alt="GCP Architecture" width="1510" height="1008" data-path="img/vxc-gcp-architecture.png" />

## Prerequisites

### VLAN Attachment

This step is performed on Google

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-vlan-attachment.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=8d98795910a7d462aa41e4616a165e67" alt="GCP VLAN Attachment" width="1600" height="559" data-path="img/vxc-gcp-vlan-attachment.png" />

Parameters:

* "Partner Interconnect Connection"
* "Set up unencrypted Interconnect"

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-attach-parameters-1.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=c8847d3a4f7f238d4598ba0e152e856f" alt="GCP VLAN Attachment Parameters" width="1600" height="767" data-path="img/vxc-gcp-attach-parameters-1.png" />

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-attach-parameters-2.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=1eb0a30a9ed468bc5f583e551e79fd13" alt="GCP VLAN Attachment Parameters 2" width="1600" height="240" data-path="img/vxc-gcp-attach-parameters-2.png" />

* "Network": Choose the one you are connecting from
* "Region": Choose the one that there is a Telnyx PoP in proximity
* "MTU": 8896

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-attach-parameters-3.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=834a0f4fb39943d93e334b3a4880bc81" alt="GCP VLAN Attachment Parameters 3" width="1600" height="699" data-path="img/vxc-gcp-attach-parameters-3.png" />

* Create a router or choose an existing one.

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-attach-parameters-4.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=705bb1b7c4f25366882f14777f7edb81" alt="GCP VLAN Attachment Parameters 4" width="1600" height="748" data-path="img/vxc-gcp-attach-parameters-4.png" />

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-attach-parameters-5.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=2f790fad8e52f03a0f9eaf956db92964" alt="GCP VLAN Attachment Parameters 5" width="1600" height="736" data-path="img/vxc-gcp-attach-parameters-5.png" />

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-attach-parameters-6.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=f9d615c9aefbedff31c702b46c7599f9" alt="GCP VLAN Attachment Parameters 6" width="1600" height="367" data-path="img/vxc-gcp-attach-parameters-6.png" />

### Telnyx Network

This step is performed on Telnyx.

If you don't have a network created already, you may follow [this guide](https://developers.telnyx.com/docs/network/networks) to create one.

## Procedure

### Create a VXC resource

This step is performed on Telnyx.

```
POST /v2/virtual_cross_connects HTTP/1.1
Host: api.telnyx.com
Content-Type: application/json
Authorization: Bearer XXX
Content-Length: 286

{
    "network_id": "a843547c-3f08-4a7e-8a4b-270c3ffb13f2",
    "name": "xd-frankfurt-vxc-gcp",
    "cloud_provider": "gce",
    "cloud_provider_region": "europe-west3",
    "primary_cloud_account_id": "xxxx/europe-west3/2",
    "bgp_asn": 16550,
    "bandwidth_mbps": 50
}
```

### Activate Connection

This step is performed on Google.

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-procedure-1.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=f3d0fae2b74f1ec9661712a4222f2f32" alt="GCP Activate Connection" width="1600" height="318" data-path="img/vxc-gcp-procedure-1.png" />

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-procedure-2.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=a9b90a47dc25ebd2fd6160dc882c8d5a" alt="GCP Activate Connection 2" width="1600" height="493" data-path="img/vxc-gcp-procedure-2.png" />

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-procedure-3.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=7cf0dcc2a918425bad78519a28984e2f" alt="GCP Activate Connection 3" width="1600" height="263" data-path="img/vxc-gcp-procedure-3.png" />

“Peer ASN”: 63440 (Telnyx)
“MD5 Authentication”: `primary_bgp_key`

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-procedure-4.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=7ad8f7bd1beaffa824dd4293e0371fb4" alt="GCP Activate Connection 4" width="1600" height="740" data-path="img/vxc-gcp-procedure-4.png" />

### Update BGP Peering

This step is performed on Telnyx.

At this point, the connection is “Down”. We need to take the Google assigned GBP IPs and set them on the VXC.

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-update-bgp-peering-1.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=7a47ad9d7f1d3095874a7c2b9db70a7a" alt="GCP Update BGP Peering 1" width="1600" height="502" data-path="img/vxc-gcp-update-bgp-peering-1.png" />

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-update-bgp-peering-2.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=ff61757620cebaf227dce38c685c782a" alt="GCP Update BGP Peering 2" width="1600" height="527" data-path="img/vxc-gcp-update-bgp-peering-2.png" />

Use the PATCH method.

* `primary_cloud_ip` — “Cloud Router BGP IP” or “Remote IP” in the “Troubleshooting” page
* `primary_telnyx_ip` — “BGP peer IP” or “Local IP”in the “Troubleshooting” page

```
PATCH /v2/virtual_cross_connects/:vxc_uuid HTTP/1.1
Host: api.telnyx.com
Content-Type: application/json
Authorization: Bearer XXX
Content-Length: 31

{
    "primary_enabled": true,
    "primary_cloud_ip": "169.254.131.250/29",
    "primary_telnyx_ip": "169.254.131.249/29"
}
```

At this point, on Google, it will show the “Status” as “Up”

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-update-bgp-peering-3.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=ea682b879e59d9e84995dbb8c55469a3" alt="GCP Update BGP Peering 3" width="1600" height="262" data-path="img/vxc-gcp-update-bgp-peering-3.png" />

### Validate Connection

This step is performed on Google.

* Under VPC networks, you should see the routes advertised over the cloud router created.
* You can also ssh in one of your instances in the same network and perform a traceroute.

<img src="https://mintcdn.com/telnyx/2URMJX3zP3rZ0vDO/img/vxc-gcp-verify-connection.png?fit=max&auto=format&n=2URMJX3zP3rZ0vDO&q=85&s=1f57ccda3c27d65c306e59192062085e" alt="GCP Verify Connection" width="1600" height="504" data-path="img/vxc-gcp-verify-connection.png" />

```bash theme={null}
xxx@instance-20240503-154050:~$ traceroute sip.telnyx.com
traceroute to sip.telnyx.com (192.76.120.10), 30 hops max, 60 byte packets
 1  * * *
 2  100.65.72.1 (100.65.72.1)  4.393 ms  4.367 ms  4.349 ms
 3  64.16.254.51 (64.16.254.51)  114.732 ms  114.715 ms  114.698 ms
 4  64.16.247.105 (64.16.247.105)  114.903 ms  114.877 ms  114.860 ms
 5  192.76.120.160 (192.76.120.160)  114.843 ms  114.825 ms  114.807 ms
 6  sip.telnyx.com (192.76.120.10)  114.857 ms  114.064 ms  114.038 ms
```
