Network

Link aggregation

Link aggregation, which is also known as link bonding, joins multiple network interfaces to form a single, unified interface to:

  • increase throughput, and/or
  • provide redundancy in case one of the links fails.

Configure bonded interfaces Jump to heading

To configure link aggregation, you must add a new service network configuration section to create a new network interface. You can do this either through the UI or through the Network Management CLI. The new interface will join two existing, physical network interfaces, such as eth1 and eth2.

Use the UI Jump to heading

To bond two network interfaces together via the HAProxy ALOHA UI:

  1. In the Services tab, click network setup to display the current configuration of your network interfaces.

    Interface Setup Bonding

  2. Remove any IP configuration from any interfaces you wish to bond together. When a network interface is part of a bond, it cannot have an IP configuration.

    Below, we prepare to bond the eth1 and eth2 interfaces by removing the ip rules from them.

    service network eth1 auto on service network eth2 auto on
    service network eth1 auto on service network eth2 auto on
  3. Add a service network section to create a new interface that will serve as the bonded interface.

    The type of bonding depends on the bonding mode directive. Choose a tab to see different modes, and refer to the bonding modes section for more.

    To enable failover with one active interface at a time, create a bond0 interface in active-passive mode with slave set to the interfaces eth1 and eth2:

    service network eth1 auto on service network eth2 auto on service network bond0 type bonding bonding mode active-backup bonding primary eth1 slave eth1 eth2 ip address 172.16.24.5/24
    service network eth1 auto on service network eth2 auto on service network bond0 type bonding bonding mode active-backup bonding primary eth1 slave eth1 eth2 ip address 172.16.24.5/24

    To set up IEEE 802.3ad (LACP) Dynamic link aggregation, create a bond0 interface in 802.3ad mode with slave set to the interfaces eth1 and eth2:

    service network eth1 auto on service network eth2 auto on service network bond1 type bonding bonding mode 802.3ad slave eth1 eth2 ip address 172.16.24.5/24
    service network eth1 auto on service network eth2 auto on service network bond1 type bonding bonding mode 802.3ad slave eth1 eth2 ip address 172.16.24.5/24
  4. Click OK and Close to return to the Services tab.

  5. Do one of the following:

    • If you updated an existing bond interface, reload the network interface.
    • If you created a new bond interface, restart the network interface.

    Version > 16.0

    In versions greater than 16.0, click the Apply new configuration button on the interface to apply the changes and automatically restart the network interface service.

  6. To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.

Use the Network Management CLI Jump to heading

Available since

  • HAProxy ALOHA 16.5

To bond two network interfaces together via the Network Management CLI:

  1. If you have not already done so, install the Network Management CLI.

  2. Go to the Tools tab and click Launch terminal.

  3. Create a new interface that will serve as the bonded interface. Below, we use the netctl connection add and netctl connection up commands to define a bonded interface having a connection.id of bond0.

    The type of bonding depends on the mode. Choose a tab to see different modes, and refer to the bonding modes section for more.

    To enable failover with one active interface at a time, set the active-backup mode. We set the primary interface to eth1.

    nix
    sudo netctl connection add connection.type bond \
    connection.id bond0 \
    connection.interface-name bond0 \
    bond.options mode=active-backup,primary=eth1 \
    ipv4.addresses 172.16.100.5/24
    sudo netctl connection up bond0
    nix
    sudo netctl connection add connection.type bond \
    connection.id bond0 \
    connection.interface-name bond0 \
    bond.options mode=active-backup,primary=eth1 \
    ipv4.addresses 172.16.100.5/24
    sudo netctl connection up bond0
    output
    text
    Warning: service/instance not found in /var/state/network.rc, using default values.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> modprobe bonding: Done.
    ==> create bonding master bond0: Done.
    ==> start network[bond0] : Done.
    RTNETLINK answers: File exists
    ==> load ip config network[bond0] : Done.
    Connection successfully activated
    output
    text
    Warning: service/instance not found in /var/state/network.rc, using default values.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> modprobe bonding: Done.
    ==> create bonding master bond0: Done.
    ==> start network[bond0] : Done.
    RTNETLINK answers: File exists
    ==> load ip config network[bond0] : Done.
    Connection successfully activated

    To set up IEEE 802.3ad (LACP) Dynamic link aggregation, set the 802.3ad mode.

    nix
    sudo netctl connection add connection.type bond \
    connection.id bond0 \
    connection.interface-name bond0 \
    bond.options mode=802.3ad \
    ipv4.addresses 172.16.100.5/24
    sudo netctl connection up bond0
    nix
    sudo netctl connection add connection.type bond \
    connection.id bond0 \
    connection.interface-name bond0 \
    bond.options mode=802.3ad \
    ipv4.addresses 172.16.100.5/24
    sudo netctl connection up bond0
    output
    text
    Warning: service/instance not found in /var/state/network.rc, using default values.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> modprobe bonding: Done.
    ==> create bonding master bond0: Done.
    ==> start network[bond0] : Done.
    ==> load ip config network[bond0] : Done.
    Connection successfully activated
    output
    text
    Warning: service/instance not found in /var/state/network.rc, using default values.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> modprobe bonding: Done.
    ==> create bonding master bond0: Done.
    ==> start network[bond0] : Done.
    ==> load ip config network[bond0] : Done.
    Connection successfully activated
  4. Indicate which interfaces to bond by replacing their connection profiles with new profiles that set connection.slave-type bond and connection.master bond0. For example, here we use the netctl connection add and netctl connection up commands to replace the eth1 and eth2 profiles:

    nix
    sudo netctl connection add connection.type ethernet \
    connection.id bond0-eth1 \
    connection.interface-name eth1 \
    connection.slave-type bond\
    connection.master bond0
    sudo netctl connection up bond0-eth1
    sudo netctl connection add connection.type ethernet \
    connection.id bond0-eth2 \
    connection.interface-name eth2 \
    connection.slave-type bond \
    connection.master bond0
    sudo netctl connection up bond0-eth2
    nix
    sudo netctl connection add connection.type ethernet \
    connection.id bond0-eth1 \
    connection.interface-name eth1 \
    connection.slave-type bond\
    connection.master bond0
    sudo netctl connection up bond0-eth1
    sudo netctl connection add connection.type ethernet \
    connection.id bond0-eth2 \
    connection.interface-name eth2 \
    connection.slave-type bond \
    connection.master bond0
    sudo netctl connection up bond0-eth2
    output
    text
    Connection 'bond0-eth1' (5bd87600-df4c-4bfe-af1c-2c419c8f435b) successfully added.
    # Stopping network[eth1] ...
    ==> stop network[eth1] : Done.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> start network[bond0] : Done.
    RTNETLINK answers: File exists
    ==> load ip config network[bond0] : Done.
    Connection successfully activated
    Connection 'bond0-eth2' (858f3aae-35f5-4b20-ace0-bdda0282ed30) successfully added.
    # Stopping network[eth2] ...
    ==> stop network[eth2] : Done.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> start network[bond0] : Done.
    RTNETLINK answers: File exists
    ==> load ip config network[bond0] : Done.
    Connection successfully activated
    output
    text
    Connection 'bond0-eth1' (5bd87600-df4c-4bfe-af1c-2c419c8f435b) successfully added.
    # Stopping network[eth1] ...
    ==> stop network[eth1] : Done.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> start network[bond0] : Done.
    RTNETLINK answers: File exists
    ==> load ip config network[bond0] : Done.
    Connection successfully activated
    Connection 'bond0-eth2' (858f3aae-35f5-4b20-ace0-bdda0282ed30) successfully added.
    # Stopping network[eth2] ...
    ==> stop network[eth2] : Done.
    # Stopping network[bond0] ...
    ==> stop network[bond0] : Done.
    # Starting network[bond0] ...
    ==> start network[bond0] : Done.
    RTNETLINK answers: File exists
    ==> load ip config network[bond0] : Done.
    Connection successfully activated
  5. Save the configuration to make your changes persistent after a reboot:

    nix
    sudo config save
    nix
    sudo config save

Verify your setup Jump to heading

To verify, call ip address show to show network interfaces. The bond0 interface should show the MASTER and MULTICAST labels. The eth1 and eth2 interfaces should show the SLAVE and MULTICAST labels.

nix
ip address show
nix
ip address show
output
text
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:a1:4c:5a brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:a1:4c:5a brd ff:ff:ff:ff:ff:ff permaddr 00:0c:29:a1:4c:64
7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:a1:4c:5a brd ff:ff:ff:ff:ff:ff
inet 172.16.100.5/24 scope global bond0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fea1:4c5a/64 scope link
valid_lft forever preferred_lft forever
output
text
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:a1:4c:5a brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:a1:4c:5a brd ff:ff:ff:ff:ff:ff permaddr 00:0c:29:a1:4c:64
7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:a1:4c:5a brd ff:ff:ff:ff:ff:ff
inet 172.16.100.5/24 scope global bond0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fea1:4c5a/64 scope link
valid_lft forever preferred_lft forever

List connection profiles

You can also list connection profiles with the netctl connection command.

Network service reference Jump to heading

Here you will see all available settings related to link aggregation that you can use in a service network section.

Directives Jump to heading

The following settings are available to configure the bonding interface:

Parameter Description
slave <iface> <iface>... interfaces to add in the bond
bonding primary <iface> primary slave for current bond
bonding mode <mode> bonding mode (default: 1 or active-backup)
bonding updelay <ms> bonding delay check in ms (default: 1000)
bonding downdelay <ms> bonding delay check in ms (default: 1000)

Bonding modes Jump to heading

The following table shows which bonding modes are supported.

Mode number Mode code Description
O balance-rr Select output interfaces in a round-robin fashion.
1 active-backup Failover mode with one active interface at a time.
2 balance-xor Transmit based on MAC address. The default policy is a source+destination MAC address algorithm. You can select alternate transmit policies through the xmit-hash-policy directive.
3 broadcast Not supported.
4 802.3ad You can bundle several physical ports to form a single logical channel through the Link Aggregation Control Protocol (LACP), which is part of the IEEE specification 802.3ad.
Prerequisites:
- Ethtool support in drivers to retrieve the speed and duplex of each slave.
- A switch that supports IEEE 802.3ad Dynamic link aggregation.
5 balance-tlb Transmit load balancing. The outgoing interface is selected based on interfaces load.
Prerequisites:
- Ethtool support in drivers to retrieve the speed and duplex of each slave.
6 balance-alb Adaptive load balancing; balance-tlb mode with a reception load balancing mode made using the ARP protocol.

Troubleshooting Jump to heading

When the bonding configuration is correctly set up:

  • The bondX interface has at least the MASTER and MULTICAST labels.
  • The ethX interfaces have at least the SLAVE and MULTICAST labels.
  • Both bondX and associated ethX are UP.
  • The bondX and ethX interfaces have the same MAC address.

Example:

bond0 Link encap:Ethernet HWaddr 00:0D:B9:13:52:2D inet addr:10.0.32.10 Bcast:0.0.0.0 Mask:255.255.0.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) eth1 Link encap:Ethernet HWaddr 00:0D:B9:13:52:2D UP BROADCAST NOARP SLAVE MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:11 Base address:0x2000 eth2 Link encap:Ethernet HWaddr 00:0D:B9:13:52:2D UP BROADCAST NOARP SLAVE MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:12 Base address:0x4000
bond0 Link encap:Ethernet HWaddr 00:0D:B9:13:52:2D inet addr:10.0.32.10 Bcast:0.0.0.0 Mask:255.255.0.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) eth1 Link encap:Ethernet HWaddr 00:0D:B9:13:52:2D UP BROADCAST NOARP SLAVE MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:11 Base address:0x2000 eth2 Link encap:Ethernet HWaddr 00:0D:B9:13:52:2D UP BROADCAST NOARP SLAVE MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:12 Base address:0x4000

Advanced parameter: xmit-hash-policy Jump to heading

When used in active/active mode (that is, bonding mode is set to 802.3ad), the choice of which network interface to use for outbound traffic is made using the destination MAC address.

In some cases, for example when the traffic to your default gateway is higher than a single network interface capacity, you can change the xmit-hash-policy by setting the /sys parameter.

  • Add a xmit-hash-policy directive using the syntax below:

    bonding xmit_hash_policy <policyid>
    bonding xmit_hash_policy <policyid>

The <policyid> argument can have two values and describes the information used to compute the hash algorithm:

Value Description
0 or layer2 Use the destination MAC address
1 or layer3+4 When available, use source and destination IPs and ports

Below, we change xmit_hash_policy to 1 for bonding1:

service network bond1 slave eth1 eth2 bonding primary eth1 bonding mode 802.3ad ip address 172.16.24.237/24 bonding xmit_hash_policy 1
service network bond1 slave eth1 eth2 bonding primary eth1 bonding mode 802.3ad ip address 172.16.24.237/24 bonding xmit_hash_policy 1

If you change the configuration, save the changes. To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.

Do you have any suggestions on how we can improve the content of this page?