The lagg interface allows aggregation of multiple network interfaces as one virtual lagg interface for the purpose of providing fault-tolerance and high-speed links.
A lagg interface can be created using the ifconfig laggN create command. It can use different link aggregation protocols specified using the laggproto proto option. Child interfaces can be added using the laggport child-iface option and removed using the -laggport child-iface option.
The driver currently supports the aggregation protocols failover (the default), lacp, loadbalance, roundrobin, broadcast, and none. The protocols determine which ports are used for outgoing traffic and whether a specific port accepts incoming traffic. The interface link state is used to validate if the port is active or not.
Each lagg interface is created at runtime using interface cloning. This is most easily done with the ifconfig(8) create command or using the cloned)_interfaces variable in rc.conf(5).
The MTU of the first interface to be added is used as the lagg MTU. All additional interfaces are required to have exactly the same value.
The loadbalance and lacp modes will use the RSS hash from the network card if available to avoid computing one, this may give poor traffic distribution if the hash is invalid or uses less of the protocol header information. Local hash computation can be forced per interface by setting the -use_flowid ifconfig(8) flag. The default for new interfaces is set via the net.link.lagg.default_use_flowid sysctl(8).
Create a link aggregation using LACP with two bge(4) Gigabit Ethernet interfaces:
# ifconfig ie1g0 up # ifconfig ie1g1 up # ifconfig lagg0 laggproto lacp laggport ie1g0 laggport ie1g1 \
192.168.1.1 netmask 255.255.255.0
Create a link aggregation using ROUNDROBIN with two bge(4) Gigabit Ethernet interfaces and set a stride of 500 packets per interface:
# ifconfig ie1g0 up # ifconfig ie1g1 up # ifconfig lagg0 create # ifconfig lagg0 laggproto roundrobin laggport ie1g0 laggport ie1g1 \ 192.168.1.1 netmask 255.255.255.0 # ifconfig lagg0 rr_limit 500
There is no way to configure LACP administrative variables, including system and port priorities. The current implementation always performs active-mode LACP and uses 0x8000 as system and port priorities.