> ## 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.

# Connecting MVEs Integrated with Versa Secure SD-WAN

> This help topic describes how to connect two Megaport Virtual Edges (MVEs) integrated 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>;
};

This topic describes how to connect a Megaport Virtual Edge (MVE) integrated with Versa Secure SD-WAN to another MVE.

This deployment uses the Megaport private software-defined network (SDN) to reduce reliance on the internet and connect enterprise branch locations.

<Image src="/images/mve/branch-to-branch.png" alt="Branch to branch" width={800} />

With two MVEs configured, you can create a private VXC to connect them on the Megaport network without the need for any physical infrastructure. A VXC is essentially a private point-to-point Ethernet connection between an A-End MVE and a B-End MVE.

<Note>
  The internet-facing interface on an MVE can reach the internet-facing interface on another MVE over the public internet. That is, you can exchange traffic from MVE to MVE in different metros over the internet. The basic connection model consists of an MVE at one metro connecting via a Megaport Internet connection to an MVE at another metro. Connectivity consists of a customer/SD-WAN partner-managed connection, not Megaport managed. For more information, see [Megaport Internet Overview](/megaport-internet).
</Note>

## Before you begin

Provision two MVEs in different locations. If you haven't already created MVEs, see [Creating an MVE Integrated with Versa](/mve/versa/creating-mve).

## Creating a VXC between two MVEs

A private VXC deployment between two MVEs integrated with Versa starts in the Megaport Portal where you create the VXC (choose A-End and B-End devices, IP addressing, VLANs, and optional BGP parameters). Then, you configure the A-End and B-End MVE devices in Director.

**To create a VXC**

1. In the <Link href="https://portal.megaport.com">Megaport Portal</Link>, go to the **Services** page and click **+Connection** next to the originating A-End MVE.

2. Select **Private VXC** and click **Next**.

   <Image src="/images/mve/mve-to-mve-private.png" alt="Private VXC" shadow={true} width={600} />

3. Select the destination B-End MVE and location.\
   You can use the Select Destination Port search field to narrow the selection.

4. Click **Next**.

5. 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>. Specify a name for the VXC that is easily identifiable, for example, `LA MVE 2 to Dallas MVE 4`. You can change the name later, if you like.

   * **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. The maximum speed is displayed. Although the rate limit for a VXC can be up to several Gbps, the compute capacity of the A-End or B-End MVE can influence the circuit throughput. Consult Versa’s documentation for more information.

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

   * **vNIC selection** -- Depending on the definition of the MVEs you are using, you might have to specify A-End and B-End vNICs.

     * **A-End vNIC** -- Specify a vNIC by using the pre-populated default, or select from the drop-down list.

     * **B-End vNIC** -- Specify a vNIC by using the pre-populated default, or select from the drop-down list.

       For more information about vNIC selection when connecting MVEs with different services, see [Types of vNIC Connections](/mve/vnic-connections).

   * **Preferred A-End VLAN** -- Specify the 802.1q VLAN tag for this connection for the A-End. To specify a VLAN ID, select **Tagged** and enter the ID in the **Specify VLAN ID** field.\
     Each VXC is delivered as a separate VLAN on the MVE. The VLAN ID must be unique 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.

   * **Preferred B-End VLAN** -- Specify the 802.1q VLAN tag for this connection that you will receive through the B-End VLAN.

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

6. Click **Next** to view the Summary page.

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

8. Repeat these steps to provision any additional VXCs.

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

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

    <Note>
      In addition to entering a promotion code manually, there are two other ways to apply promotion codes.

      * **Auto-apply** -- Megaport automatically applies the promotion code to your order. It appears automatically on the Checkout page.
      * **Manual list** -- Eligible promotion codes appear at checkout for any applicable services in your cart. You can then select and apply them.
    </Note>

11. Click **Order Now**.

Once the VXC is deployed, you can view it in the Megaport Portal Services page. The Services page displays the VXC under the A-End MVE and the B-End MVE. Note that the service identifier number is the same for the VXC at both ends of the connection.

The next step is to configure the A-End and B-End MVEs in Versa Director.

<Note>
  The next procedure configures IP connectivity with BGP, providing just one solution out of many. Consult your SD-WAN vendor documentation for specific network design and configuration options before configuring interfaces for the MVEs.
</Note>

## Adding MVE details to Director

After you create the VXC between your MVEs, you need to configure it in Versa Director. This involves configuring subinterfaces, IP addresses, next hops, and BGP settings for each Versa MVE.

**To configure the A-End MVE**

1. Collect the connection details from the Megaport Portal.

   To display the details, click the gear icon for the VXC connection from your MVE and click the **Details** view.

2. Log in to Versa Director.

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

4. Select Template > Templates in the left navigation.

   <Image src="/images/cloud/mve/versa-choose-template.png" alt="Connection details" shadow={true} width={800} />

5. Click the template you want to edit, then select the **Interfaces** tab.

6. In the WAN Interfaces section, locate the Sub Interface column and click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add) to add a subinterface.

   <Image src="/images/mve/versa/director-add-subint.png" alt="Add subinterface" shadow={true} width={800} />

   A new row appears in the table.

7. Specify these values for the new subinterface.

   * **VLAN ID** -- Enter the VLAN value from the Megaport Portal.

   * **Network Name** -- Choose **+ Create WAN Network** from the drop-down menu 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 menu.

   <Image src="/images/mve/versa/director-interface-tab.png" alt="Inteface details" shadow={true} width={800} />

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

9. In the BGP section, select the network name you previously created in the Network column.

   <Image src="/images/mve/versa/director-routing-tab.png" alt="Routing details" shadow={true} width={800} />

10. Specify the following values according to your MVE configuration:

    * **Local AS** -- This is the A-End MVE.
    * **Neighbor IP Address** -- This is the B-End MVE.
    * **Peer AS** -- This is the B-End ASN.
    * Optionally, you can enable BFD (as appropriate for your network).

    <Note>
      The values for Local AS and Peer AS come from your network design. They are not part of the Megaport MVE/VXC.
    </Note>

11. Click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add) to the right of the settings.

12. Click **Recreate** (at the bottom of the page).

    A window opens that shows the differences of the configuration. The auto-merged version is recommended, and selected by default.

13. Click **Deploy**.

You can use variables in the template to specify values per device for these fields: **Router ID**, **Local AS**, **Peer AS**, and **Password**.

<Note>
  The Instance ID cannot be modified (the system automatically specifies a value) and the Static IP address is parameterized by default.
</Note>

**To parameterize Router ID, BGP Local AS, Peer AS, and Password**

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/versa/aws/aws-director-config-templates-devicetemps.png" alt="Device Templates" shadow={true} width={700} />

3. Click your template.

   By default, the Interfaces column appears.

4. In the left navigation, select **Virtual Routers** and click your network to open the Edit window.

   <Image src="/images/mve/versa/director-virtual-routers.png" alt="Virtual routers" shadow={true} width={800} />

5. In the Edit window, select BGP, then click the Instance ID to open the Edit BGP Instance window.

   <Image src="/images/mve/versa/director-edit-bgp.png" alt="BGP details" shadow={true} width={800} />

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/mve/versa/director-parameterize-bgp.png" alt="Edit BGP Instance" shadow={true} width={800} />

7. Click **OK** two times to update.

8. Select the **Workflows** tab in the top menu bar, then select Devices > Devices in the left navigation.

9. Click your device to specify values for the variables you just created.

   <Image src="/images/cloud/mve/versa/aws/aws-director-devices-devices.png" alt="Versa devices" shadow={true} width={800} />

   The Add Device window opens.

10. Select the **Bind Data** tab.

    <Image src="/images/mve/versa/director-bind-data.png" alt="Bind data" shadow={true} width={800} />

11. Specify values for the variables.

    * **Local AS** -- Enter the A-End ASN.
    * **Password** -- Enter the MD5 password.
    * **Peer AS** -- Enter the B-End ASN.
    * **Router ID** -- Enter the A-End IP address.
    * **Hop Address** -- Enter the B-End IP address.
    * **Static Address** -- Enter the A-End IP address, including the mask value.

12. Click **Redeploy** when finished.

    When the new configurations for the device are prepared successfully, a green checkmark appears at the bottom of the Versa Director window.

13. To push the changes to the device, click **Commit Template** (on the upper right).

    <Image src="/images/cloud/mve/versa/aws/aws-director-committemplate.png" alt="Commit template" shadow={true} width={800} />

    The Commit Template to Devices window opens.

    <Image src="/images/cloud/mve/versa/aws/aws-director-commit-dialog.png" alt="Commit Template to Devices window" shadow={true} width={800} />

14. Specify the following in the Commit Template to Devices window:

    * **Organization** -- Select your organization from the drop-down menu.

    * **Select Template** -- Select the template to push to the device from the drop-down menu.

    Note that the Template State is OUT\_OF\_SYNC.

15. Click the eye icon in the Differences column to verify your configuration changes.

16. Click **Commit to Device**.

    A green checkmark appears at the bottom right of the screen when the push is successful. The Template State is now IN\_SYNC.

Next, configure the B-End MVE.

There are multiple ways to configure A-End and B-End MVEs using Versa templates and workflows. The steps depend on how you have grouped devices and assigned templates. For example, if both MVEs are in the same device group and shared the same template, you can make changes to the variables in Bind Data for the B-End device to configure the connection.

These steps describe how to configure them using different templates.

**To configure the B-End MVE**

1. In Director, select the **Workflows** tab in the top menu bar.

2. Select Template > Templates in the left navigation.

3. Click the template you want to edit, then select the **Interfaces** tab.

4. In the WAN Interfaces section, locate the Sub Interface column and click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add) to add a subinterface.

   A new row appears in the table.

5. Specify these values for the new subinterface.

   * **VLAN ID** -- Enter the VLAN value from the Megaport Portal.

   * **Network Name** -- Choose the same network name as the A-End device from the drop-down menu.

   * **IPv4** - Choose Static from the drop-down menu.

   <Image src="/images/mve/versa/director-bend-interface.png" alt="Interface details" shadow={true} width={800} />

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

7. In the BGP section, select the network name for the connection in the Network column.

   <Image src="/images/mve/versa/director-bend-routing.png" alt="Routing details" shadow={true} width={800} />

8. Specify the following values according to your MVE configuration:

   * **Local AS** -- This is your local MVE: B-End.
   * **Neighbor IP Address** -- This is the A-End IP address.
   * **Peer AS** -- This is the A-End ASN.
   * Optionally, you can enable BFD (as appropriate for your network).

9. Click <InlineImage src="/images/mve/versa/add-icon-green.png" alt="Add icon" /> (Add) to the right of the settings.

10. Select the **Management Servers** tab, then click **Recreate** (at the bottom of the page).

    A window opens that shows the differences of the configuration. The auto-merged version is recommended and selected by default.

11. Click **Deploy**.

You can use variables in the template to specify values per device for these fields: **Router ID**, **Local AS**, **Peer AS**, and **Password**.

<Note>
  The Instance ID cannot be modified (the system automatically specifies a value) and the **Static IP address** is parameterized by default.
</Note>

**To parameterize Router ID, BGP Local AS, Peer AS, and Password**

1. Select the **Configuration** tab in the top menu bar.

2. Select **Templates** > **Device Templates** in the horizontal menu bar.

3. Click your template.

   By default, the Interfaces section appears.

4. In the left navigation, select **Virtual Routers** and click your network to open the Edit window.

5. In the Edit window, select BGP, then click the Instance ID to open the Edit BGP Instance window.

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

7. Click **OK** two times to update.

8. Select the **Workflows** tab in the top menu bar, then select Devices > Devices in the left navigation.

9. Click your device to specify values for the variables you just created.\
   The Add Device window opens.

10. Select the **Bind Data** tab.

    <Image src="/images/mve/versa/director-bind-data.png" alt="Bind Data" shadow={true} width={800} />

11. Specify values for the variables.

    * **Local AS** -- Enter the B-End ASN.
    * **Password** -- Enter the MD5 password.
    * **Peer AS** -- Enter the A-End ASN.
    * **Router ID** -- Enter the B-End IP address.
    * **Hop Address** -- Enter the A-End IP address.
    * **Static Address** -- Enter the local IP address, including the mask value.

12. Click **Redeploy** when finished.\
    When the new configurations for the device are prepared successfully, a green checkmark appears at the bottom of the Versa Director window.

13. To push the changes to the device, click **Commit Template** (on the upper right).

    <Image src="/images/cloud/mve/versa/aws/aws-director-committemplate.png" alt="Commit Template" shadow={true} width={800} />

    The Commit Template to Devices window opens.

    <Image src="/images/cloud/mve/versa/aws/aws-director-commit-dialog.png" alt="Commit details" shadow={true} width={800} />

14. Specify the following in the Commit Template to Devices window:

    * **Organization** -- Select your organization from the drop-down menu.

    * **Select Template** -- Select the template to push to the device from the drop-down menu.

    Note that the Template State is OUT\_OF\_SYNC.

15. Click the eye icon in the Differences column to verify your configuration changes.

16. Click **Commit to Device**.\
    A green checkmark appears at the bottom right of the screen when the push is successful. The Template State is now IN\_SYNC.

**To verify the connection**

1. Select the **Monitor** tab in the top navigation bar, select Devices in the horizontal navigation bar, and then select your device to view details in the Summary screen.

   <Image src="/images/cloud/mve/versa/aws/aws-director-monitor-device.png" alt="AWS BGP Session Up" shadow={true} width={800} />

2. 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/aws/aws-director-monitor-details.png" alt="AWS BGP Session Up" shadow={true} width={800} />
