Example 29-1. LACP aggregation with a Cisco switch
This example connects two interfaces on a FreeBSD machine to the switch as a single
load balanced and fault tolerant link. More interfaces can be added to increase
throughput and fault tolerance. Since frame ordering is mandatory on Ethernet links then
any traffic between two stations always flows over the same physical link limiting the
maximum speed to that of one interface. The transmit algorithm attempts to use as much
information as it can to distinguish different traffic flows and balance across the
available interfaces.
On the Cisco switch add the interfaces to the channel group.
interface FastEthernet0/1
channel-group 1 mode active
channel-protocol lacp
!
interface FastEthernet0/2
channel-group 1 mode active
channel-protocol lacp
!
On the FreeBSD machine create the lagg interface.
# ifconfig lagg0 create
# ifconfig lagg0 up laggproto lacp laggport fxp0 laggport fxp1
View the interface status from ifconfig; ports marked as ACTIVE are part of the active aggregation group that has been
negotiated with the remote switch and traffic will be transmitted and received. Use the
verbose output of ifconfig(8) to view
the LAG identifiers.
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 00:05:5d:71:8d:b8
media: Ethernet autoselect
status: active
laggproto lacp
laggport: fxp1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
laggport: fxp0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
The switch will show which ports are active. For more detail use show lacp neighbor detail.
switch# show lacp neighbor
Flags: S - Device is requesting Slow LACPDUs
F - Device is requesting Fast LACPDUs
A - Device is in Active mode P - Device is in Passive mode
Channel group 1 neighbors
Partner's information:
LACP port Oper Port Port
Port Flags Priority Dev ID Age Key Number State
Fa0/1 SA 32768 0005.5d71.8db8 29s 0x146 0x3 0x3D
Fa0/2 SA 32768 0005.5d71.8db8 29s 0x146 0x4 0x3D
Example 29-2. Failover mode
Failover mode can be used to switch over to another interface if the link is lost on
the master.
# ifconfig lagg0 create
# ifconfig lagg0 up laggproto failover laggport fxp0 laggport fxp1
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 00:05:5d:71:8d:b8
media: Ethernet autoselect
status: active
laggproto failover
laggport: fxp1 flags=0<>
laggport: fxp0 flags=5<MASTER,ACTIVE>
Traffic will be transmitted and received on fxp0. If the
link is lost on fxp0 then fxp1
will become the active link. If the link is restored on the master interface then it will
once again become the active link.