Setting up an MC-LAG aggregation group
Servers with MC-LAG support use two network adapters to simultaneously connect to each of the networks (public and private). To ensure fault tolerance, each of the network interface pairs connected to the networks must form an aggregation group on the server side. For more information, see Configuring aggregation groups and network interfaces.
Note
When setting up aggregation groups, do not connect to the server via the network interface you are going to include in a group: the connection with be lost when you create the group. The KVM console is the most reliable way to configure MC-LAG groups.
Currently, you can set up MC-LAG groups in Linux Ubuntu 20.04, 22.04, 24.04, and Debian 11. As an example, this guide uses a server with two pairs of network adapters with connection speed of 25 Gbps each.
To set up a link aggregation group:
-
Install
ethtool:apt install ethtool -
Make sure the required network interfaces are installed in the system and active:
ip linkResult:
... 2: etx3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d6 brd ff:ff:ff:ff:ff:ff 3: etx4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d7 brd ff:ff:ff:ff:ff:ff 4: etx1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 58:a2:e1:ad:38:2a brd ff:ff:ff:ff:ff:ff 5: etx2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 58:a2:e1:ad:38:2b brd ff:ff:ff:ff:ff:ffAs you can see from the output, the server has four active network interfaces:
etx3: With theb8:ce:f6:40:12:d6MAC address.etx4: With theb8:ce:f6:40:12:d7MAC address.etx1: With the58:a2:e1:ad:38:2aMAC address.etx2: With the58:a2:e1:ad:38:2bMAC address.
-
Find out which of the interfaces belong to the public network, and which to the private one:
-
In the management console
, select the folder the server belongs to. -
Go to BareMetal and select the server in the list of servers.
On the page that opens, in the
MAC addressfield under Public network and Private network, you can see the MAC addresses of interfaces connected to the public and private networks, respectively. -
Use the information obtained in the two previous steps to identify the server interface pairs connected to the public and private networks. In the example above, the pairs are as follows:
Public network:
etx3: With theb8:ce:f6:40:12:d6MAC address.etx1: With the58:a2:e1:ad:38:2aMAC address.
Private network:
etx4: With theb8:ce:f6:40:12:d7MAC address.etx2: With the58:a2:e1:ad:38:2bMAC address.
-
-
Find out the name of the Netplan
configuration file:ls /etc/netplan/Result:
50-cloud-init.yaml -
Open the Netplan configuration file with a text editor. In this guide, we use nano
:nano /etc/netplan/50-cloud-init.yaml -
Edit the Netplan configuration by adding aggregation groups (the
bondssection):network: bonds: bond1: dhcp4: true interfaces: - <public_interface_1_name> - <public_interface_2_name> macaddress: <public_interface_1_or_2_MAC_address> parameters: lacp-rate: fast mode: 802.3ad transmit-hash-policy: layer3+4 bond2: dhcp4: true interfaces: - <private_interface_1_name> - <private_interface_2_name> macaddress: <private_interface_1_or_2_MAC_address> parameters: lacp-rate: fast mode: 802.3ad transmit-hash-policy: layer3+4 ethernets: etx1: dhcp4: false match: macaddress: 58:a2:e1:ad:38:2a set-name: etx1 etx2: dhcp4: false match: macaddress: 58:a2:e1:ad:38:2b set-name: etx2 etx3: dhcp4: false match: macaddress: b8:ce:f6:40:12:d6 set-name: etx3 etx4: dhcp4: false match: macaddress: b8:ce:f6:40:12:d7 set-name: etx4 version: 2Where:
<public_interface_1_name>,<public_interface_2_name>: Names of the interfaces which belong to the public network, as you found out earlier.<public_interface_1_or_2_MAC_address>: MAC address of an interface which belongs to the public network, as you found out earlier.<private_interface_1_name>,<public_interface_2_name>: Names of the interfaces which belong to the private network, as you found out earlier.<private_interface_1_or_2_MAC_address>: MAC address of an interface which belongs to the private network, as you found out earlier.
Warning
Note that DHCP must be:
- Enabled (
dhcp4: true) for aggregation groups (thebondssection). - Disabled (
dhcp4: false) for individual interfaces (theethernetssection).
Netplan configuration example
network: bonds: bond1: dhcp4: true interfaces: - etx3 - etx1 macaddress: b8:ce:f6:40:12:d6 parameters: lacp-rate: fast mode: 802.3ad transmit-hash-policy: layer3+4 bond2: dhcp4: true interfaces: - etx4 - etx2 macaddress: b8:ce:f6:40:12:d7 parameters: lacp-rate: fast mode: 802.3ad transmit-hash-policy: layer3+4 ethernets: etx1: dhcp4: false match: macaddress: 58:a2:e1:ad:38:2a set-name: etx1 etx2: dhcp4: false match: macaddress: 58:a2:e1:ad:38:2b set-name: etx2 etx3: dhcp4: false match: macaddress: b8:ce:f6:40:12:d6 set-name: etx3 etx4: dhcp4: false match: macaddress: b8:ce:f6:40:12:d7 set-name: etx4 version: 2 -
Apply the new Netplan configuration:
netplan apply -
Make sure the list of network interfaces displays the aggregation groups:
ip linkResult:
... 2: etx3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond1 state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d6 brd ff:ff:ff:ff:ff:ff 3: etx4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond2 state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d7 brd ff:ff:ff:ff:ff:ff 4: etx1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond1 state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d6 brd ff:ff:ff:ff:ff:ff 5: etx2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond2 state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d7 brd ff:ff:ff:ff:ff:ff 6: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d6 brd ff:ff:ff:ff:ff:ff 7: bond2: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:40:12:d7 brd ff:ff:ff:ff:ff:ffAs you can see from the output, the server now has two MC-LAG aggregation groups,
bond1andbond2.Note
If aggregation groups are inactive (
DOWN), activate them:ip link set bond1 up ip link set bond2 up -
View the information about the groups you created. As an example, let’s use the aggregation group connected to the public network:
ethtool bond1Result:
Settings for bond1: Supported ports: [ ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 50000Mb/s Duplex: Full Port: Other PHYAD: 0 Transceiver: internal Auto-negotiation: off Link detected: yesAs you can see from the output, the connection speed for the
bond1group is 50 Gbps. -
Simulate an incident where a link in the
bond1public network aggregation group fails. To do this, disable one of the group’s network interfaces:ip link set etx3 down -
View the group information again:
ethtool bond1Result:
Settings for bond1: Supported ports: [ ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 25000Mb/s Duplex: Full Port: Other PHYAD: 0 Transceiver: internal Auto-negotiation: off Link detected: yesAs you can see from the output, the connection speed for the
bond1group has been reduced to 25 Gbps, but the network connectivity has been maintained. To check this, connect to the server over SSH. -
Activate the interface you disabled earlier and make sure the aggregation group is running again at the maximum speed:
ip link set etx3 up ethtool bond1Result:
Settings for bond1: Supported ports: [ ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 50000Mb/s Duplex: Full Port: Other PHYAD: 0 Transceiver: internal Auto-negotiation: off Link detected: yes