FreeBSD: NIC Bonding / Link Aggregation / Trunking / Link Failover Tutorial

Network Interface Card (NIC) bonding, also known as Link Aggregation, Trunking, or Link Failover, is a method of combining two or more network interfaces into a single logical interface. This can provide increased network bandwidth and redundancy, as well as improve network availability by providing automatic failover in the event of a network link failure.

In FreeBSD, NIC bonding can be achieved using the Link Aggregation Control Protocol (LACP) and the Link Aggregation Control Protocol over Ethernet (LACP over Ethernet or LACP/802.3ad) protocol. LACP is a standardized protocol used to bundle network interfaces together, while LACP/802.3ad is a variant of LACP that uses the 802.3ad standard for Ethernet link aggregation.

Here are the steps to configure NIC bonding on FreeBSD:

  1. Install the LACP and LACP/802.3ad kernel modules by adding the following lines to /boot/loader.conf:
if_lagg_load="YES"
if_lagg_ports_load="YES"
  1. Create a new configuration file for the NIC bonding interface in /etc/rc.conf.d/lagg:
ifconfig_igb0="up"
ifconfig_igb1="up"
ifconfig_lagg0="laggproto lacp laggport igb0 laggport igb1 192.168.1.10/24"

In this example, igb0 and igb1 are the network interfaces to be bonded, lagg0 is the logical interface that will be created, laggproto specifies the LACP protocol, and laggport specifies the network interfaces to be bonded. The IP address 192.168.1.10/24 is also assigned to the lagg0 interface.

  1. Start the NIC bonding interface using the following command:
ifconfig lagg0 up
  1. Verify that the NIC bonding interface is working correctly using the following command:
ifconfig lagg0

This should display information about the lagg0 interface, including the status, the bonded network interfaces, and the IP address.

That’s it! Your FreeBSD system now has a bonded network interface that provides increased network bandwidth and redundancy.

Leave a Comment