> ## 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 an MCR VXC

> This help topic describes how to create Virtual Cross Connects (VXCs) on a Megaport Cloud Router (MCR) 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 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 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>;
};

With a Megaport Cloud Router (MCR) configured, you can add a Virtual Cross Connect (VXC) to a CSP, a local port, or a third-party network. You can optionally connect a physical Port to the MCR via 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 MCR.

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

**To create and connect a VXC** <Anchor name="connectavxcmcr" />

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

2. If this is the first connection for the MCR, 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/mcr/new-connection.png" alt="VXC tiles" 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:

     * 3DS Outscale -- See [Creating MCR Connections to 3DS Outscale](/cloud/mcr/outscale).
     * Alibaba -- See [Creating MCR Connections to Alibaba Express](/cloud/mcr/alibaba).
     * AWS -- See [Creating MCR Connections to AWS](/cloud/mcr/aws).
     * Azure -- See [Creating MCR Connections to Azure using ExpressRoute](/cloud/mcr/azure).
     * DigitalOcean -- See [Creating MCR Connections to DigitalOcean Infrastructure](/cloud/mcr/digitalocean).
     * Google -- See [Creating MCR Connections to Google Cloud Services](/cloud/mcr/google).
     * IBM -- See [Creating MCR Connections to IBM Cloud Direct Link](/cloud/mcr/ibm-2.0).
     * Latitude.sh -- See [Creating MCR Connections to Latitude.sh](/cloud/mcr/latitude-sh).
     * Oracle -- See [Creating MCR Connections to Oracle Cloud Infrastructure](/cloud/mcr/oracle).
     * OVHcloud -- See [Creating MCR Connections to OVHcloud Connect](/cloud/mcr/ovhcloud).
     * Salesforce -- See [Creating MCR Connections to Salesforce Express Connect](/cloud/mcr/salesforce).
     * SAP -- See [Creating MCR Connections to SAP HANA Enterprise Cloud](/cloud/mcr/sap).

   * **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 an MCR](/megaport-internet/mcr).

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

   * **Preferred B-End VLAN** -- Specify the 802.1q VLAN tag for this connection that you will receive through the B-End VLAN. This field will show if the configuration requires this information.

   * **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/mcr/vxc-details.png" alt="Add VXC details" shadow={true} width={600} />

5. Click **Next**.<Anchor name="interface" />\
   The MCR A-End Connection Details page appears. For each VXC connected to an MCR, 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 MCR A-End Connection Details page is not displayed during MCR VXC creation in some situations, and is dependent on the VXC destination. The MCR VXC configuration will be auto-configured in these situations. If you are creating a single-use service key on an MCR, 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 an MCR](/mcr/configuring-mcr).
   </Note>

   <Image src="/images/mcr/mcr-a-end-vxc.png" alt="MCR A-End configuration" shadow={true} width={600} />

6. If required, click **Enable Q-in-Q** to enable multiple interfaces and click **+ Add Interface** to add an additional interface.

7. Enter a description for the connection.

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

9. (Optional) Select a NAT source IPv4 address from the **Network Address Translation (NAT)** drop-down list.\
   All packets leaving this interface will have their source NAT rewritten to this address.

   <Gloss term="Network Address Translation (NAT)" anchor="nat" /> allows flexibility in designing a scalable and secure multi-vendor, multicloud, or hybrid cloud scenario. Source NAT translates the source IP address of a packet leaving the MCR. When you assign a NAT IP address in MCR, all packets leaving the interface use that IP address as their source IP address. Enable this feature when NAT is required for a connection, for example, when you need to translate several private IP addresses into a single public IP address to meet Cloud Service Provider (CSP) requirements.

   For more information about how MCR performs NAT to support public peering types to cloud service providers, see [How MCR performs NAT](/mcr/mcr-nat/).

10. (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 [MCR Advanced VLAN and Routing Features](/mcr/mcr-version-two/) and [Using IPsec with MCR](/mcr/ipsec-mcr/).

11. (Optional) If IPsec has been enabled on your MCR, you can configure IPsec tunnels.

    Click **+ Add IPsec Tunnel Interface**.\
    Add the IPsec tunnel details:

    * **Description** -- Enter a description of the IPsec tunnel for your reference.
    * **Source IP Address** -- Click the box and select the address from the drop-down list.\
      This is a list of interface IP addresses defined on this VXC.
    * **Destination IP Address** -- Add the destination IP address.\
      The destination IP address of the tunnel must not be an IP address configured on the same MCR.
    * **Pre-shared key** -- Add a key that is common to both the IKE2 (Internet Key Exchange version 2) initiator and responder. The length must be between 8 and 100 characters.
    * **Local Identifier** (optional) -- Enter the identifier used for IKE authentication. This allows you to override the default source IP address with a non-IP address, which is required for some configurations. By default, the source IP address is used. Valid values include IPv4/IPv6 addresses, domain names, and email addresses (lowercase, 5-100 characters). For example, `megaport.com` or `user@example.com`.
    * **Remote Identifier** (optional) -- Enter the identifier used for IKE authentication. This allows you to override the default destination IP address with a non-IP address, which is required for some configurations. By default, the destination IP address is used. Valid values include IPv4/IPv6 addresses, domain names, and email addresses (lowercase, 5-100 characters). For example, `megaport.com` or `user@example.com`.
    * **Start Action** -- Select either active or passive.	Passive indicates that the local MCR is an IPsec responder waiting for the remote to perform IKE2 initiation.
    * **Phase 1 Lifetime** -- Enter a value between 300 and 604800 seconds. This is the lifetime of IKE2 session in seconds. The default value is 28800 seconds (8 hours). When it expires, rekeying will occur.
    * **Phase 2 Lifetime** -- Enter a value between 300 and 86400 seconds. This is the lifetime in seconds of the IPsec Security Association (SA). The value must be less than the Phase 1 Lifetime. The default value is 3600 seconds (1 hour). When it expires, rekeying will occur.

      <Image src="/images/mcr/ipsec-config.png" alt="IPsec config details" shadow={true} width={800} />

12. Enter any details specific to the VXC type.
    * For more information about configuring IPsec, see [Using IPsec with MCR](/mcr/ipsec-mcr/).
    * For more information about using packet filters, see [Using Packet Filters](/mcr/packet-filters/).
    * For more information about adding a BGP connection, see [Configuring BGP](/mcr/configuring-mcr/#configbgp).
    * For more information about enabling Bidirectional Forwarding Detection (BFD) settings, see [Enabling the BFD protocol](/mcr/mcr-bgp-advanced/#bfd).
    * For more information about adding a static route, see [Configuring static routes](/mcr/configuring-mcr/#static).
    * For more information about configuring a DHCP server, see [Configuring a DHCP pool](/mcr/configuring-mcr/#dhcp).

13. Click **Next**.

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

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

    <Image src="/images/mcr/mcr-vxc-summary.png" alt="MCR VXC summary" shadow={true} width={500} />

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

17. Click **Add VXC** to move this configuration to your cart.

18. Repeat these steps to provision any additional VXCs.

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

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

21. Click **Order Now**.
