Fortinet black logo

Administration Guide

Link aggregation groups

Copy Link
Copy Doc ID f65c09ce-240d-11ed-9eba-fa163e15d75b:352388
Download PDF

Link aggregation groups

This section provides information on how to configure a link aggregation group (LAG). For LAG control, the FortiSwitch unit supports the industry-standard Link Aggregation Control Protocol (LACP). The FortiSwitch unit supports LACP in active and passive modes. In active mode, you can optionally specify the minimum and maximum number of active members in a trunk group.

If the trunk is in LACP mode and has ports with different speeds, the ports of the same negotiated speed are grouped in an aggregator.

If multiple aggregators exist, one and only one of the aggregators is used by the trunk.

You can use the CLI to specify how the aggregator is selected:

  • When the aggregator-mode is set to bandwidth, the aggregator with the largest bandwidth is selected. This mode is the default.
  • When the aggregator-mode is set to count, the aggregator with the largest number of ports is selected.

The FortiSwitch unit supports flap-guard protection for switch ports in a LAG.

Configuring the trunk and LAG ports

It is important to configure the trunk to prevent loops.
Using the GUI:
  1. Go to Switch > Port > Trunk and select Add Trunk.
  2. Give the trunk an appropriate name.
  3. For the mode, select Static, LACP Active, LACP Passive, or Fortinet Trunk.
  4. Add the required ports to the Included list.
  5. Select Create.
Using the CLI:

config switch trunk

edit <trunk name>

set aggregator-mode {bandwidth | count}

set description <description_string>

set members <ports>

set mode {lacp-active | lacp-passive | static}

set member-withdrawal-behavior {block | forward}

set lacp-speed {fast | slow}

set bundle [enable|disable]

set min_bundle <integer>

set max_bundle <integer>

set port-selection-criteria
{src-ip | src-mac | dst-ip |dst-mac | src-dst-ip |src-dst-mac}

end

end

tooltip icon The set auto-isl command (under config switch trunk) is used when a trunk is automatically managed by the system. Do not set this command on trunks that you want to manage, for example, when the FortiSwitch unit is in standalone mode without auto topology (config switch auto-network) enabled.

Example configuration

The following is an example CLI configurations for trunk/LAG ports:

Trunk/LAG ports

To configure Trunk 2 on FortiSwitch 1:
  1. Configure the trunk 2 interface and assign member ports as a LAG group:

    config switch trunk

    edit trunk2

    set members "port4" "port5"

    set description test

    set mode lacp-passive

    set port-selection criteria src-dst-ip

    end

    end

  2. Configure the trunks to allow the VLANs:

    config switch interface

    edit trunk2

    set allowed-vlans 2,8

    next

    end

To configure Trunk 2 on FortiSwitch 2:
  1. Configure the trunk 2 interface and assign member ports as a LAG group:

    config switch trunk

    edit trunk2

    set members "port8" "port10"

    set description test

    set mode lacp-active

    set port-selection criteria src-dst-ip

    end

    end

  2. Configure the trunks to allow the VLANs:

    config switch interface

    edit trunk2

    set allowed-vlans 2,8

    next

    end

Checking the trunk configuration

Using the GUI:

Go to Switch > Port > Trunk or Switch > Monitor > Trunks.

Using the CLI:

diagnose switch trunk list

Link aggregation groups

This section provides information on how to configure a link aggregation group (LAG). For LAG control, the FortiSwitch unit supports the industry-standard Link Aggregation Control Protocol (LACP). The FortiSwitch unit supports LACP in active and passive modes. In active mode, you can optionally specify the minimum and maximum number of active members in a trunk group.

If the trunk is in LACP mode and has ports with different speeds, the ports of the same negotiated speed are grouped in an aggregator.

If multiple aggregators exist, one and only one of the aggregators is used by the trunk.

You can use the CLI to specify how the aggregator is selected:

  • When the aggregator-mode is set to bandwidth, the aggregator with the largest bandwidth is selected. This mode is the default.
  • When the aggregator-mode is set to count, the aggregator with the largest number of ports is selected.

The FortiSwitch unit supports flap-guard protection for switch ports in a LAG.

Configuring the trunk and LAG ports

It is important to configure the trunk to prevent loops.
Using the GUI:
  1. Go to Switch > Port > Trunk and select Add Trunk.
  2. Give the trunk an appropriate name.
  3. For the mode, select Static, LACP Active, LACP Passive, or Fortinet Trunk.
  4. Add the required ports to the Included list.
  5. Select Create.
Using the CLI:

config switch trunk

edit <trunk name>

set aggregator-mode {bandwidth | count}

set description <description_string>

set members <ports>

set mode {lacp-active | lacp-passive | static}

set member-withdrawal-behavior {block | forward}

set lacp-speed {fast | slow}

set bundle [enable|disable]

set min_bundle <integer>

set max_bundle <integer>

set port-selection-criteria
{src-ip | src-mac | dst-ip |dst-mac | src-dst-ip |src-dst-mac}

end

end

tooltip icon The set auto-isl command (under config switch trunk) is used when a trunk is automatically managed by the system. Do not set this command on trunks that you want to manage, for example, when the FortiSwitch unit is in standalone mode without auto topology (config switch auto-network) enabled.

Example configuration

The following is an example CLI configurations for trunk/LAG ports:

Trunk/LAG ports

To configure Trunk 2 on FortiSwitch 1:
  1. Configure the trunk 2 interface and assign member ports as a LAG group:

    config switch trunk

    edit trunk2

    set members "port4" "port5"

    set description test

    set mode lacp-passive

    set port-selection criteria src-dst-ip

    end

    end

  2. Configure the trunks to allow the VLANs:

    config switch interface

    edit trunk2

    set allowed-vlans 2,8

    next

    end

To configure Trunk 2 on FortiSwitch 2:
  1. Configure the trunk 2 interface and assign member ports as a LAG group:

    config switch trunk

    edit trunk2

    set members "port8" "port10"

    set description test

    set mode lacp-active

    set port-selection criteria src-dst-ip

    end

    end

  2. Configure the trunks to allow the VLANs:

    config switch interface

    edit trunk2

    set allowed-vlans 2,8

    next

    end

Checking the trunk configuration

Using the GUI:

Go to Switch > Port > Trunk or Switch > Monitor > Trunks.

Using the CLI:

diagnose switch trunk list