-
Notifications
You must be signed in to change notification settings - Fork 8
Link Aggregation (LAG)
The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical "bonded" interface. The current version of the bonding driver is available in the “drivers/net/bonding” subdirectory of the most recent kernel source. It is recommended to configure bonding via iproute2
(netlink) or sysfs
. The "ifenslave" control utility is no longer supported.
- To create a LAG bond device:
$ ip link add name bond1 type bond mode 802.3ad
$ ip link add name bond1 type bond mode balance-xor miimon 1000
$ ip link add name bond1 type bond mode active-backup miimon 1000
NOTE: These options are supported:802.3ad
(LACP),balance-xor
,active-backup
NOTE: providing MII polling interval withmiimon
is mandatory forbalance-xor
, andactive-backup
to work properly. - To remove a LAG bond device:
$ ip link del dev bond1
- To set operational mode:
In general, the bond device can support different operational modes. The operational mode can be set using following command:
$ ip link set dev bond1 type bond mode 802.3ad
- To add a member to a LAG:
$ ip link set dev sw1p1 master bond1
- To remove a member from a LAG:
$ ip link set dev sw1p1 nomaster
- To show LAG information:
$ cat /proc/net/bonding/bond1
To enable a specific member in a LAG, the appropriate net_dev interface should be enabled:
$ ip link set sw1p1 up
In order to disable a specific member in a LAG, enable the appropriate net_dev interface:
$ ip link set sw1p1 down
In order to bring up/down the LAG interface, run the following command:
$ ip link set [bond1] [up|down]
The MAC address of LAG interface is the address of first member of this LAG.
In order to change it, run the following command:
$ ip link set [bond1] address [XX:XX:XX:XX:XX:XX]
In order to set MTU on the LAG interface, run the following command:
$ ip link set [bond1] mtu [XX]
The speed and auto-negotiation setting are not supported for bond interface.
In order to configure the speed or auto-negotiation, complete the following actions:
- Disable LAG interface (
ip link set [bond1] down
) - Disable LAG members (
ip link set [sw1pX] down
) - Configure speed or auto-negotiation for every LAG member
- Enable LAG members (
ip link set [sw1pX] up
) - Enable LAG interface (
ip link set [bond1] up
)
To add a LAG interface to a bridge, run the following command:
$ ip link set [bond1] master br0
To configure a VLAN on the LAG interface, run the following command:
$ bridge vlan add vid [XX] pvid dev [bond1]
To configure bridge port attributes for a LAG, run the following command:
$ bridge link set dev [bond1] learning off flood off
To configure an IP address for a LAG, run the following command:
$ ip addr add [192.168.1.2/24] dev [bond1]
To set a bond interface as a part of virtual router, run the following command:
$ ip link set dev [bond1] master [vrf_name]
- Up to 62 LAGs are supported.
- Up to 8 port members per LAG.
- Only the bond configuration mechanism is supported.
- These options are supported:
802.3ad
(LACP),balance-xor
,active-backup
. - The switchport
sw1pX
must have admin down state in order to add it to LAG (Linux limitation) - Binding a port to the LAG device that already has an upper device is not supported.
- Changing speed/auto-negotiation on a LAG interface is not supported. The speed should be manually changed on all members. (Linux limitation)
- LAG ACL is not supported.
- Changing the MTU of a port which is part of LAG affects (rewrites) the LAG MTU setting for this port.
Network Configurations
- Switch Port
- Layer 2
- Layer 3
- Dynamic SCT
- Quality of Service (QoS)
- Access Control Lists (ACL)
- Network Address Translation (NAT)
- Debugging Tools and and Methods
- Resources and Releases
- Marvell® Switchdev Slim (Single-CPU) mode guide