> ## 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 Link Aggregation Group

> This help topic describes how to work with Link Aggregation Groups within the Megaport network.

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

This topic describes Port link aggregation groups (LAGs), steps through how to add a Port to a LAG, and how to convert a non-LAG Port to a LAG Port.

A LAG bundles physical ports to create a single data path, where the traffic load is distributed among the ports to increase overall connection reliability. This feature provides aggregate bandwidth, enhanced resiliency, and efficient use of resources. Other terms used to describe a LAG include *port trunking*, *link bundling*, and *channel bonding*.

When you create a new Port that is 10 Gbps or higher, enabling the <Gloss term="Link Aggregation Control Protocol (LACP)" anchor="lacp" /> allows you to use it in a LAG. We recommend that you enable LACP even if you only require a single Port at that time. This prevents service interruption if later you decide to enable LACP on the Port. You can combine up to 8 physical Ports into a single LAG, and the Port price will update dynamically based on any additional Ports. All Ports within the LAG use the same Layer 2 MAC address. For more information about how to create a Port, see [Creating a Port](/connections/creating-port).

Multiple Ports in a LAG configuration with multiple physical cross-connects reduce potential single points of failure that will stop the network from working if they go down. For example, networks using small form-factor pluggable (SFP) ports or optics.

This image shows the overall design of a LAG configuration:

<Image src="/images/connections/lag-overview.png" alt="LAG configuration" width={750} />

## Port LAG specifications

| **Specification**                            | **Port**                                               |
| -------------------------------------------- | ------------------------------------------------------ |
| Protocol                                     | LACP (IEEE 802.1AX or previous IEEE 802.3ad standards) |
| Interface                                    | 10GBASE-LR (10 Gbps) or 100GBASE-LR4 (100 Gbps)        |
| Maximum number of interfaces in a single LAG | 8                                                      |

## Port LAG restrictions

* Multi-Chassis Link Aggregation (MC-LAG) across multiple devices is not supported.
* The LAG speed must be 10 Gbps or higher. 1 Gbps Ports are not supported in LAGs.
* LACP System Priority must be set to a value higher than 0 on your equipment for LACP to function correctly.

### Bandwidth limitations

The available total bandwidth of a LAG is the sum of all Ports in the LAG. Virtual Cross Connect (VXC) bandwidth is still limited to the maximum bandwidth of any single Port in the LAG. However, local Ports within the same metro area as Internet Exchange (IX) services don't have this limitation. You can configure IX services to use the total amount of bandwidth capacity from all members in a LAG.

## Configuring a LAG pair for diversity

When you create a new LAG, you can make it diverse from an existing LAG or create a diverse pair of LAGs at the same time, with one in each diversity zone. For more information about Port diversity, see [Port Diversity](/connections/port-diversity).

<Note>
  It is not possible to change a LAG diversity zone after placing the order. To do this, you must cancel and re-order the LAG.
</Note>

**To configure a LAG pair for diversity**

1. Log in to the <Link href="https://portal.megaport.com">Megaport Portal</Link> and choose **Services**.

2. Click **Add Services**, then select **Port**.
   <Image src="/images/snippets/add-services-button.png" alt="Add Services button" shadow={true} width={150} />

3. Select a data center location for the Port and click **Next**.
   <Image src="/images/connections/create-port-select-location.png" alt="Select location" shadow={true} width={400} />
   You can use the **Search** field to find the Port name, Country, Metro City, or address of your destination Port.

4. Specify the Port details.

   * **Port Speed** -- Select the required Port speed. Port capacity depends on location and service availability. Ensure that your equipment is capable of interfacing with the selected speed. If Port diversity is available at the location and speed you select, Port diversity options are enabled. If Port diversity is not available at your desired location, contact a Megaport Sales representative for more information.

   * **Megaport Marketplace** -- By default, each service is private to your enterprise and consumes services from the Megaport network for your own internal company, team, and resources. When set to private, the service is not searchable in the Megaport Marketplace, however, others can still connect to you using a [service key](/marketplace/service-keys). Megaport Marketplace visibility is controlled on your Megaport Marketplace profile. For more information about how to make your service visible to the Megaport Marketplace, see [Adding services to your profile](/marketplace/profile#adding-services-to-your-profile).

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

   * **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 [Port Pricing and Contract Terms](/finance/port-pricing).

   * **Cross Connect** -- When you have entered a Port speed, the <Gloss term="Cross Connect" anchor="cross-connect" /> section will appear if Cross Connect is available at your chosen location.
     Select **Yes** if you want to include a Cross Connect with your Port order. The price for the Cross Connect will be shown.
     For more information, see [Ordering a Cross Connect](/connections/cross-connect/).

   * **Port Diversity** -- Diversity options are only displayed if diversity is available at this location and speed. Select one of the following options from the drop-down list:
     * **None** -- Select this option if you do not have a preference for a specific diversity zone.
     * **Create Diverse Pair** -- Select this option to create two LAGs, each in its own diversity zone. The system prompts you for the name of the second LAG in the pair, and configures the second LAG using identical settings.
     * **Diverse from Existing Port** -- Select this option to make this LAG diverse from an existing LAG. In the drop-down list, any available purchased LAGs and their corresponding diversity zones are listed.

   * **LACP on Port** -- Click **Enable** to add the Port as a member of a LAG. Specify the number of Ports to include in the LAG, up to a maximum of 8.

   * **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/connections/create-diverse-lag-pair.png" alt="Create diverse LAG pair" shadow={true} width={500} />

5. Click **Next** to view the Summary page.\
   The Summary shows Port Diversity enabled and the diversity zones for the LAGs. The monthly charge in the Summary reflects both LAGs. If a Cross Connect has been ordered, the summary also shows the monthly rate and the One-Time fees for the Cross Connect.
   <Image src="/images/connections/create-diverse-lag-summary.png" alt="Diverse LAG summary" shadow={true} width={450} />

6. Confirm the selected options and click **Create LAG**.\
   The Configured Services pane displays the newly created LAGs, their diversity zones, and the monthly charges.

7. Click **Review Order** on the Configured Services pane to deploy the new LAGs now, or click **Save** to save the configured LAGs before placing the order.

8. Click **Order Now** on the pop-up window to start the provisioning of your new LAGs.

   After the LAGs are provisioned, Megaport generates a Letter of Authorization (LOA) specifying the demarcation point to be applied to your service.

9. Click **Download LOA** next to the new LAGs on the Services page.\
   Megaport will also send you the LOA PDF by email.

10. Provide the LOA to your data center operator to establish the physical cross connect from your network device to your new Port.

<Note>
  The cost of a new cross connection and any related VXC fees are the responsibility of the customer, as outlined in [Megaport's Global Services Agreement](https://www.megaport.com/legal/global-services-agreement/).
</Note>

Once the LAGs have been provisioned and deployed, you have access to the Megaport network and can start adding Virtual Cross Connects (VXCs) to the LAG. For more information about adding VXCs, see [Creating a VXC](/connections/overview#create_vxc).

## Converting a non-LAG Port

To convert a non-LAG Port to a LAG, send a request to Megaport Support to manually convert the Port. Make sure to identify the Port in your request.
