> ## 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 AWS Hosted Connection for an MVE with Palo Alto VM-Series

> This help topic describes how to create a Hosted Connection from an MVE to AWS Direct Connect and integrate the connection with Palo Alto VM-Series.

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

A Hosted Connection can support one private, public, or transit virtual interface. These are dedicated connections and are recommended for production environments.

**To create a connection to an AWS Hosted Connection 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**.

3. Select AWS as the service provider, select Hosted Connection as the AWS Connection Type, select the destination port, then click **Next**.\
   You can use the Select Destination Port search field to narrow the selection.\
   Each destination port has either a blue or red icon to indicate its diversity zone. To achieve diversity, you need to create two connections with each one in a different zone.
   <Image src="/images/cloud/megaport/aws/aws-hosted-connection.png" alt="Add AWS Hosted Connection" shadow={true} width={700} />

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. This value cannot be changed after deployment. The drop-down list displays predefined rate limits available for your MVE, with speeds varying by location and service capabilities.

   * **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/palo-alto/creating-mve#creating-mve).

   * **Preferred A-End VLAN** (optional) -- Specify an unused VLAN ID for this connection.\
     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="Connection details" shadow={true} width={550} />

5. Click **Next**.

6. Specify the connection details for the AWS service.

   * **AWS Connection Name** -- This is a text field and will be the name of your virtual interface that appears in the AWS console. The AWS Connection Name is automatically populated with the name specified in a previous step.

   * **AWS Account ID** -- This is the ID of the account you want to connect. You can find this value in the management section of your AWS console.

   <Image src="/images/cloud/mcr/aws-hc-service-details.png" alt="AWS connection details" shadow={true} width={450} />

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

Once the VXC connection is deployed successfully, it appears on the Megaport Portal Services page and is associated with the MVE. Click the VXC name to display the details of this connection. Note that the service status (Layer 2) is up but BGP (Layer 3) will be down because the configuration does not exist yet.

<Image src="/images/cloud/mve/pa-aws-vxc-mve.png" alt="VXC details" shadow={true} width={700} />

Once deployed in the Megaport Portal, you need to accept the connection in the AWS console and create a Virtual Interface for the connection:

**To accept a Hosted Connection**

1. In AWS, go to **Services > AWS Direct Connect > Connections** and click the connection name.
   <Image src="/images/cloud/megaport/aws/aws-hc-connections.png" alt="AWS Connections" shadow={true} width={800} />

2. Click **Accept** at the top right of the window.

   <Image src="/images/cloud/megaport/aws/aws-hc-accept-connection.png" alt="Accept AWS Connections" shadow={true} width={800} />

   The state will be pending for a few minutes while AWS deploys the connection. After it is deployed, the state changes from *ordering* to *available*.

The connection is now available, however you need to create a VIF to connect to AWS services.

<Tip>
  For more information about accepting AWS connections, see the [AWS documentation](https://docs.aws.amazon.com/directconnect/latest/UserGuide/accept-hosted-connection.html).
</Tip>

## Creating a virtual interface

Once you have created and accepted a Hosted Connection, create a VIF and attach the Hosted Connection to a gateway.

<Tip>
  AWS provides [detailed instructions](https://docs.aws.amazon.com/directconnect/latest/UserGuide/create-vif.html) for creating Public, Private, and Transit interfaces.
</Tip>

**To create and attach a VIF**

1. In the AWS console, click **Create Virtual Interface**.
   <Image src="/images/cloud/megaport/aws/aws-hc-create-vif.png" alt="AWS virtual interface" shadow={true} width={800} />

2. Select the interface type.

   The type will vary depending on the type of service you need to access.

   * **Private** -- Access resources running into a VPC using their private IP addresses. You can choose to terminate a private virtual interface on a private virtual gateway (to access a single VPC) or to a Direct Connect gateway (and map up to 10 VPCs to the VIF).
   * **Public** -- Access all AWS public endpoints, as well as all AWS resources that are reachable by a public IP address.
   * **Transit** -- Transport traffic from a Direct Connect gateway to one or more transit gateways.

   <Image src="/images/cloud/megaport/aws/aws-hc-transit-vif-settings.png" alt="AWS interface type" shadow={true} width={800} />

3. Specify the configuration details:

   * **Virtual interface name** -- Enter a name for the virtual interface.
   * **Connection** -- The physical connection where you want this virtual interface to be provisioned. The name you provided for the Hosted Connection in the Megaport Portal appears here.
   * **Virtual interface owner** -- The account that will own the virtual interface. Select My AWS account.
   * **Direct Connect gateway** -- Select the Direct Connect gateway to attach this virtual interface to. A transit VIF is not directly attached to a Transit gateway, but to a Direct Connect gateway.
   * **VLAN** -- The VLAN assigned to the virtual interface. Leave this value as is. The VLAN address is populated and appears to be editable; however, you will get an error if you try to change it.
   * **BGP ASN** -- Enter the Border Gateway Protocol (BGP) autonomous system number (ASN) for the MVE side of the BGP session.

   The following BGP details can be filled out or left blank. When left blank, they are auto-populated by AWS.

   <Image src="/images/cloud/megaport/aws/aws-hc-bgp-settings.png" alt="AWS BGP details" shadow={true} width={800} />

   You can also choose whether you want the virtual interface to support Jumbo frames. Enable Jumbo MTU to support an Ethernet packet of 8500 bytes.

4. Click **Create virtual interface**.

   To view the VIF details and state, navigate to **Services > AWS Direct Connect > Connections > Name of the Megaport-Created-Hosted Connection**.

   <Image src="/images/cloud/megaport/aws/aws-hc-vif-state.png" alt="VIF details" shadow={true} width={800} />

   BGP hasn't been configured, so the interface state appears as *down*.

Once you accept the connection and create the VIF in AWS, the VXC state changes to *configured* in the Megaport Portal.

## Adding AWS connection details to VM-Series

After you create the connection from your MVE to AWS and set up the connection in the AWS console, you need to configure it in VM-Series. This involves creating an interface and configuring BGP settings.

**To add the AWS connection in VM-Series**

1. Collect the connection details from the AWS console.\
   Display the details of the Virtual Interface you created in AWS for this Hosted Connection. Note the values for the **BGP ASN**, **BGP Auth Key**, **Your Peer IP**, and **Amazon Peer IP**.
   <Image src="/images/cloud/aws-connection-details.png" alt="Connection Details" shadow={true} width={600} />

2. Collect the connection details from the Megaport Portal.\
   To display the details, click the gear icon for the AWS connection from your MVE and click the Details view.
   Note the value for the **A-End VLAN**.

3. Log in to the VM-Series.

4. Choose Network > Interfaces.

5. Click **Add Subinterface**.

6. Provide these details:

   * **Interface Name** -- Enter a name for the subinterface. In the adjacent field, enter a number to identify the subinterface.

   * **Comment** -- Enter an alternate name, for example, `AWS VIF dxvif-fh9aokej`.

   * **Tag** -- Specify the A-End inner VLAN value associated with the AWS VXC you created in the Megaport Portal.

   * **Virtual Router** -- Select a virtual router to the interface, as required by your network.

7. Select the **IPv4** tab.

8. Select **Static** as the Type.

9. Click **+Add** to add a new IP address.

10. Enter the IPv4 address and netmask.\
    These values are available in the virtual interface details in the AWS console. The IP address and netmask appear in the **Your Peer IP** field.

11. Click **OK**.

12. Click **Commit** in the top right corner.
    <Image src="/images/mve/palo-alto/pa-commit-btn.png" alt="Commit button" shadow={true} width={300} />

13. Review the changes and click **Commit**.
    <Image src="/images/mve/palo-alto/pa-commit.png" alt="Commit changes" shadow={true} width={500} />
    The new VLAN interface appears with your `ethernet1/1` physical interface.

Next, you will create a security zone so the interface can route traffic.

**To create a security zone**

1. Select the `ethernet1/1.1010` subinterface.
2. Select New Zone from the Security Zone drop-down list.
3. Specify a name for the security zone.
   <Image src="/images/mve/palo-alto/sec-zone-connect-mves.png" alt="Security zone settings" shadow={true} width={500} />
4. Click **+Add** under Interfaces and add `ethernet1/1.1010` to the security zone.
5. Specify any additional details as required for your network security.
6. Select New Zone Protection Profile from the Zone Protection Profile drop-down list.
7. Specify any details as required for your network security. This example uses all the defaults.
   <Image src="/images/mve/palo-alto/zone-protect-profile-connecting.png" alt="Zone Protection profile" shadow={true} width={500} />
8. Click **OK**.
9. Click **OK** in the Layer3 Subinterface screen.
10. Click **Commit** in the top right corner.
    <Image src="/images/mve/palo-alto/pa-commit-btn.png" alt="Commit button" shadow={true} width={300} />
11. Review the changes and click **Commit**.
    <Image src="/images/mve/palo-alto/pa-commit.png" alt="Commit changes" shadow={true} width={500} />

At this point, you have created the interface. Next, you will create the BGP session.

**To create the BGP session**

1. In VM-Series, choose Network > Virtual Routers.

2. Select the virtual router.
   <Image src="/images/cloud/mve/palo-alto/aws/select-virtual-router.png" alt="Select virtual router" shadow={true} width={900} />

3. In the left pane, select BGP.

4. Provide the following BGP details:
   * **Enable** -- Select this check box to start the BGP session after committing these changes.
   * **Router ID** -- Enter the IP address that appears in the **Your Peer IP** field for the virtual interface details in the AWS console.
   * **AS Number** -- Provide the ASN for the MVE connection. Use the **BGP ASN** from the virtual interface details in the AWS console.
   <Image src="/images/cloud/mve/palo-alto/bgp-details.png" alt="BGP details" shadow={true} width={600} />

5. Click **+Add** under Auth Profiles.

6. Specify a Profile Name.
   <Image src="/images/cloud/mve/palo-alto/profile-name.png" alt="Profile name" shadow={true} width={500} />

7. Enter and confirm the auth password.

8. Click **OK**.

9. Select the **Peer Group** tab.
   <Image src="/images/cloud/mve/palo-alto/peer-group-tab.png" alt="Peer Group tab" shadow={true} width={500} />

10. Click **+Add** to add a peer group.

11. Specify a name for the peer group. For example, AWS-xxxx.

12. Specify eBGP as the session type.

13. Specify any additional details as required for your network.

14. Click **+Add** to add a new peer.

15. Specify the details for the peer:
    * **Name** -- Specify a name for the peer.
    * **Peer AS** -- Specify the Amazon-side autonomous system number (ASN). By default this is 64512.
    * **Local Address** -- Select the proper subinterface and IP address from the drop-down list.
    * **Peer Address** -- Enter the AWS side IPv4 address. This is the **Amazon Peer IP** from the virtual interface details in the AWS console.
    <Image src="/images/cloud/mve/palo-alto/bgp-peer-group.png" alt="BGP Peer Group screen" shadow={true} width={400} />

16. Select the **Connection Options** tab.
    <Image src="/images/cloud/mve/palo-alto/aws/conn-options-tab.png" alt="Connection Options tab" shadow={true} width={400} />

17. Select the previously created Auth Profile.

18. Click **OK** in the Peer Group - Peer screen.

19. Click **OK** in the BGP - Peer Group/Peer screen.

20. Click **OK** in the Virtual Router screen.

21. Click **Commit** in the top right corner.
    <Image src="/images/mve/palo-alto/pa-commit-btn.png" alt="Commit button" shadow={true} width={300} />

22. Review the changes and click **Commit**.
    <Image src="/images/mve/palo-alto/pa-commit.png" alt="Commit changes" shadow={true} width={500} />

## Validating the AWS connection

**To check the status of the BGP peer**

1. Choose Network > Virtual Routers.
2. Locate your virtual router (default).
3. Click **More Runtime Stats** in the Runtime Stats column on the right.
   <Image src="/images/cloud/mve/palo-alto/runtime-stats.png" alt="Runtime stats" shadow={true} width={1000} />
4. Select the **BGP** tab, and then select the **Peer** tab.
5. Verify that the peer status is *Established*.

   <Image src="/images/cloud/mve/palo-alto/aws/pa-established.png" alt="Established status" shadow={true} width={500} />

   You can also check the status in your AWS Direct Connect portal (this might take a few minutes to refresh).

   <Image src="/images/cloud/mve/palo-alto/aws/aws-bgp-status.png" alt="AWS status" shadow={true} width={900} />
