Last Updated: [last-modified] (UTC)
To follow on from the Etherchannel/LAG article, have a look at how to configure etherchannel…
The configuration shown here is relevant to a Cisco IOS switch. Similar config is used on a router or Nexus switch. This may be quite different to other vendors.
Each interface is configured by adding it to a particular channel-group, and chosing the mode.
The mode can be:
|On||Static||Turns the channel on unconditionally|
|Active||LACP||Actively attempts to form a channel|
|Passive||LACP||Will only form a channel if the other end is in active mode|
|Desirable||PAgP||Actively attempts to form a channel|
|Auto||PAgP||Will only form a channel if the other end is in desirable mode|
An example of this configuration is:
interface range GigabitEthernet0/1-4 description Member Port channel-group 1 mode active no shutdown
The configuration above uses the range option to configure multiple interfaces at once. This is optional, individual interfaces can be configured one at a time, as long as they’re in the same group.
The channel-group number corresponds to the Administrative Key when LACP is used.
After one or more interfaces have been added to a channel-group, a virtual interface called a port-channel is created:
show running-config interface port-channel 1 Building configuration... Current configuration : 122 bytes ! interface Port-channel1 end
This can be configured just like a normal interface. Much of the configuration on the port-channel will be applied directly to the member interfaces. One exception to this is the description, which can be different on each physical interface and the port-channel.
interface port-channel 1 description EtherChannel switchport trunk encapsulation dot1q switchport mode trunk show running-config interface gigabit 0/1 Building configuration... Current configuration : 122 bytes ! interface gigabit 0/1 description MemberPort switchport trunk encapsulation dot1q switchport mode trunk end
The system priority is 32768 by default, and is changed globally on the switch or router.
lacp system-priority [value]
The port priority is 32768 by default. This can be changed on a per port basis.
interface GigabitEthernet0/1 lacp port-priority [value]
This may be useful in a case where there is an IPS, WAN accelerator, or some other ‘bump in the wire’ installed inline between two switches. In this case, a port-channel could be configured with two links, with a maximum on one active.
If the ‘bump in the wire’ fails, the active link goes down, and the passive link becomes active. This allows the failed device to be bypassed. When the device is fixed or replaced, that link becomes active again (if port priorities are set correctly), and the other link goes back to standby.
Note, not all platforms support changing the maximum number of links in a channel.
interface port-channel 1 lacp max-bundle [value]
The load balancing type specifies the algorithm that is used to spread the traffic across the physical links. Before trying to set a method, check which methods are supported on the platform.
This is set globally on the switch.
! Query the available options m1-catsw01(config)#port-channel load-balance ? dst-ip Dst IP Addr dst-mac Dst Mac Addr src-dst-ip Src XOR Dst IP Addr src-dst-mac Src XOR Dst Mac Addr src-ip Src IP Addr src-mac Src Mac Addr ! Set the method port-channel load-balance [method]
If possible, try to understand the pattern of traffic passing over the etherchannel. This includes knowing whether communication is within a single subnet, or whether routers are involved. Listing endpoints may help with this. Traffic captures may be useful too.
There are several commands to begin troubleshooting the etherchannel. Firstly, show etherchannel summary can be used to get basic information, such as a list of port channels, the physical links they contain, link up/down status, and protocol type.
show etherchannel summary ! Output omitted for brevity Number of channel-groups in use: 1 Number of aggregators: 1 Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SU) LACP Gi0/1(P) Gi0/2(P) Gi0/3(P) Gi0/4(P)
The load-balancing type can be found with show etherchannel load-balance
show etherchannel load-balance EtherChannel Load-Balancing Configuration: src-mac EtherChannel Load-Balancing Addresses Used Per-Protocol: Non-IP: Source MAC address IPv4: Source MAC address IPv6: Source MAC address
More detail can be found with show etherchannel port-channel or show etherchannel detail.
show etherchannel port-channel Channel-group listing: ---------------------- Group: 1 ---------- Port-channels in the group: --------------------------- Port-channel: Po1 (Primary Aggregator) ------------ Age of the Port-channel = 380d:06h:04m:51s Logical slot/port = 2/40 Number of ports = 4 HotStandBy port = null Port state = Port-channel Ag-Inuse Protocol = LACP Port security = Disabled Ports in the Port-channel: Index Load Port EC state No of bits ------+------+------+------------------+----------- 0 00 Gi0/1 Active 0 0 00 Gi0/2 Active 0 0 00 Gi0/3 Active 0 0 00 Gi0/4 Active 0 Time since last port bundled: 380d:06h:04m:27s Gi0/2 Time since last port Un-bundled: 380d:06h:04m:37s Gi0/4
Etherchannel traffic distribution can be tested with the test etherchannel … command. This simulates which link in a port-channel will be used for a particular flow. Below is the example for IP based traffic, however there are other options such as MAC address that can be specified.
The output will show the computed RBH, which is the hash value that would be assigned to the flow. Some switches will show the interface that would be selected.
test etherchannel load-balance interface port-channel [num] ip [src-ip] [dst-ip]
On some switches, the show interfaces port-channel ID etherchannel command has to be used.
In the table, there is a load column. Depending on the switch, this may include Hex values such as 11, 22, 44, and 88.
When these are converted into an 8-bit binary value (for example 0x11 is 0001 0001), the ‘on’ bits refer to the hashes that are allocated to the link. In the case of 0x11, bits 0 and 4 are set, so hashes 1 and 4 are assigned to this link.
Depending on the switch, the load may show as 00 on all links.
show interfaces port-channel 1 etherchannel Port-channel1 (Primary aggregator) Age of the Port-channel = 380d:06h:36m:16s Logical slot/port = 2/40 Number of ports = 4 HotStandBy port = null Port state = Port-channel Ag-Inuse Protocol = LACP Port security = Disabled Ports in the Port-channel: Index Load Port EC state No of bits ------+------+------+------------------+----------- 0 00 Gi0/1 Active 0 0 00 Gi0/2 Active 0 0 00 Gi0/3 Active 0 0 00 Gi0/4 Active 0 Time since last port bundled: 380d:06h:35m:52s Gi0/2 Time since last port Un-bundled: 380d:06h:36m:02s Gi0/4
Cisco – Configuring Etherchannels
WAHLNetwork – Demystifying LACP vs Static Etherchannel For vSphere
Cisco – Configuring a Cluster of ASAs
Cisco Support Forum – How do etherchannel HASH algorithm works and LOAD DISTRIBUTION happen?
Packet Pushers – Understand Etherchannel Load Balancing
PacketLife – EtherChannel considerations
Wikipedia – Link aggregation
How Fantastic – Using LACP to create a backup link