> ## 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 NAT Gateway VXC

> This help topic describes how to create Virtual Cross Connects (VXCs) on a Megaport NAT Gateway (NAT) to connect to services on the Megaport network.

export const Anchor = ({name}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Anchor -';
  if (name === undefined || name === null || name === 'undefined') {
    console.error(`${errorPrefix} \`name\` must have a value — rendering an empty string instead`);
    return <></>;
  }
  const raw = typeof name === 'string' ? name : JSON.stringify(name);
  const id = raw.replace(/\s+/g, '-').replace(/[^A-Za-z0-9_-]/g, '').replace(/-+/g, '-').replace(/^-+|-+$/g, '');
  if (!id) {
    console.error(`${errorPrefix} \`name\` "${name}" sanitizes to an empty id — rendering an empty string instead`);
    return <></>;
  }
  return <a style={{
    scrollMarginTop: 'var(--scroll-mt)'
  }} id={id}></a>;
};

export const Gloss = ({term, anchor, langDir = 'en'}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Gloss -';
  if (typeof term !== 'string') {
    term = String(term);
  }
  if (typeof anchor !== 'string') {
    anchor = String(anchor);
  }
  if (!term || term === 'undefined') {
    console.error(`${errorPrefix} the \`term\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (!anchor || anchor === 'undefined') {
    console.error(`${errorPrefix} the \`anchor\` property is required — rendering an empty string instead`);
    return <></>;
  }
  const lang = langDir === 'en' ? '/' : '/' + langDir + '/';
  const glossaryPage = lang + 'glossary/#' + anchor;
  return <a href={glossaryPage}>{term}</a>;
};

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>;
};

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;
};

With a Megaport NAT Gateway (NAT Gateway) configured, you can add a Virtual Cross Connect (VXC) to a cloud service provider, a local port, or a third-party network. You can optionally connect a physical Port to the NAT Gateway using a private VXC or connect to a service provider in the Megaport Marketplace.

A VXC is a point-to-point Layer 2 circuit between two endpoints that is mapped with a VLAN ID on each end. You can order VXCs to reach any destination in the Megaport network just like the VXCs used with the physical Ports. You can connect up to 25 VXCs per NAT Gateway.

<Note>
  The VXC target destination type determines the peering type. The peering type determines which routes are advertised. For more information, see [Megaport NAT Gateway Route Advertisement](/nat/route-advertisement).
</Note>

<Anchor name="connectavxcnat" />

**To create and connect a VXC**

1. Log in to the <Link href="https://portal.megaport.com">Megaport Portal</Link>, select **Services**, then select the NAT Gateway.\
   If you haven't already created a NAT Gateway, see [Creating a NAT Gateway](/nat/creating-nat-gateway).

2. If this is the first connection for the NAT Gateway, click the tile that matches the VXC type. The tile is a shortcut to the configuration page.\
   Alternatively, click **+Connection** and select a destination type:

   <Image src="/images/nat/create-vxc-choose-destination.png" shadow={true} width={700} />

   * **Cloud** -- Provision a dedicated interconnect to a public cloud service provider. After selecting Cloud, select a provider. Some providers require a service key.

     For specific CSP configuration details:

     * Latitude.sh -- See [Creating NAT Gateway Connections to Latitude.sh](/cloud/nat/latitude-sh)

   * **Private VXC** -- Connect to other Ports local to the current company account. After selecting Private VXC, select a destination Port.\
     For more information, see [Creating a Private VXC](/connections/private-vxc).

   * **Megaport Internet** -- Connect to the internet. After selecting Megaport Internet, select a destination port (internet router).\
     For more information, see [Creating a Megaport Internet Connection for a NAT Gateway](/megaport-internet/nat-gateway).

   * **Megaport Marketplace** -- Connect to any service provider present in the Megaport Marketplace. After selecting Megaport Marketplace, select a provider.\
     For more information, see [Megaport Marketplace](/marketplace/overview).

   * **Enter Service Key** -- Connect to a third-party on the Megaport network that isn’t publicly listed in the Megaport Marketplace. Select this destination if you have been given a service key, and enter the service key.\
     For more information, see [Creating a Connection using a Service Key](/marketplace/create-connection-service-key).

3. Click **Next**.

4. 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. Specify a rate limit that doesn't exceed the total rate limit for the NAT Gateway. Allow enough bandwidth for any connections that you might add later.

   * **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>

   * **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/nat/nat-gateway-vxc-connection-details.png" shadow={true} width={600} />

5. Click **Next**.<Anchor name="interface" />\
   The NAT Gateway A-End Connection Details page appears. For each VXC connected to a NAT Gateway, you can configure one or more interfaces, IP addresses, BGP connections, packet filter lists, and static routes. Most VXCs will use one interface, however, you can configure multiple interfaces by enabling a <Gloss term="Q-in-Q" anchor="qinq" /> connection and specifying an inner VLAN tag for each interface. Each VLAN ID must be unique and you can add up to five VLAN IDs.

   <Note>
     The NAT Gateway A-End Connection Details page is not displayed during NAT Gateway VXC creation in some situations, and is dependent on the VXC destination. The NAT Gateway VXC configuration will be auto-configured in these situations. If you are creating a single-use service key on a NAT Gateway, the configuration is not auto-configured and the page will be displayed. For information about configuring connection details when they are auto-configured, see [Configuring a NAT Gateway](/nat/configuring-nat).
   </Note>

   <Image src="/images/nat/nat-gateway-create-vxc-a-end-connection-details.png" shadow={true} width={800} />

6. Enter a description for the current interface connection.

7. If required, click **Enable Q-in-Q** to enable multiple interfaces or click **+ Add Interface** to add an additional interface, automatically enabling Q-in-Q.

8. Enter one or more interface IP addresses and subnet masks to configure on the A-End (or B-End) interface.

9. (Optional) Enter an <Gloss term="IP MTU (Maximum Transmission Unit)" anchor="ipmtu" /> value (in bytes) for the VXC.\
   The IP MTU can range from 1280 to 9070 (9074 if Q-in-Q is disabled). The default value is 1500.\
   For more information, see [NAT Gateway Features](/nat/nat-gateway-features).

10. Define the NAT Gateway Pools and their rules for this VXC.\
    For more information, see [Using NAT Gateway Pools](/nat/nat-gateway-pools).

11. Enter any details specific to the VXC type, such as:
    * Packet filters
    * BGP connections
    * Static routes

12. Click **Next**.

13. Configure the B-End.\
    The requirements will vary by destination or provider.

14. Click **Next**.\
    The Summary page appears.

    <Image src="/images/nat/create-vxc-summary-page.png" shadow={true} width={500} />

15. Review the Summary details.\
    Click each down arrow to view A-End and B-End configuration details.

16. Click **Add VXC**.

17. Click **Review Order**.

18. Click **Order Now**.

## Helpful references

* [Configuring a NAT Gateway VXC](/nat/configuring-nat-vxc)
* [Configuring BGP for Megaport NAT Gateway](/nat/configure-bgp)
* [Configuring Static Routing on a Megaport NAT Gateway](/nat/static-routing)
* [Creating a NAT Gateway](/nat/creating-nat-gateway)
* [Creating a Private VXC](/connections/private-vxc)
* [Megaport NAT Gateway Overview](/nat)
