Etherchannel on Cisco IOS Catalyst Switch
In this tutorial we‟ll take a look at etherchannel which is also known as link aggregation.
Etherchannel is a technology that lets you bundle multiple physical links into a single logical link.
We”ll take a look at how it works and what the advantages of etherchannel are. Let’s start with
an example of a small network:
Take a look at the picture above. I have two switches and two computers connected to the
switches. The computers are connected with 1000 Mbit interfaces while the link between the
switches is only 100 Mbit. If one of the computers would send traffic that exceeds 100 Mbit of
bandwidth we”ll have congestion and traffic will be dropped.
There are two solutions to this problem:
Replace the link in between the switches with something that has a higher bandwidth,
perhaps a gigabit or 10gigabit link.
Add multiple links and bundle them into an etherchannel.
In the picture above I have added a couple of extra links. The problem with this
setup is that we have a loop so spanning tree would block 3 out of 4 links. Etherchannel
solves this problem because it will create a single virtual link out of these physical links:
By combining 4x 100 Mbit I now have a 400 Mbit link. Spanning tree sees this link as one logical
link so there are no loops! Etherchannel will do load balancing among the different links that
we have and it takes care of redundancy. Once one of the links fails it will keep working and use
the links that we have left.
There’s a maximum to the number of links you can use: 8 physical interfaces.
If you want to configure an Etherchannel there are two protocols you can choose from:
PAgP (Cisco proprietary)
LACP (IEEE standard)
These protocols can dynamically configure an etherchannel. It‟s also possible to configure a
static etherchannel without these protocols doing the negotiation of the link for you. If you are
going to create an etherchannel you need to make sure that all ports have the same
configuration:
Duplex has to be the same.
Speed has to be there same.
Same native AND allowed VLANs.
Same switchport mode (access or trunk).
PAgp and LACP will check if the configuration of the interfaces that you use are the same.
If you want to configure PAgP there are a number of options you can choose from, the interface
can be configured as:
On (interface becomes member of the etherchannel but does not negotiate).
Desirable (interface will actively ask the other side to become an etherchannel).
Auto (interface will wait passively for the other side to ask to become an etherchannel).
Off (no etherchannel configured on the interface).
Let me show you an example how to configure PAgP between two switches. I’ll use SW1 and
SW2 for this demonstration:
SW1 and SW2 each have a FastEthernet 0/13 and 0/14 interface. We’ll bundle these into a
single logical link.
SW1(config)#interface fa0/13
SW1(config-if)#channel-group 1 mode ?
active Enable LACP unconditionally
auto Enable PAgP only if a PAgP device is detected
desirable Enable PAgP unconditionally
on Enable Etherchannel only
passive Enable LACP only if a LACP device is detected
First we go to the interface level where we can create a channel-group. I’m going to use
channel-group number 1. Above you can see the different options that we have for PAgP and
LACP.
SW1(config)#interface fa0/13
SW1(config-if)#channel-group 1 mode desirable
Creating a port-channel interface Port-channel 1
SW1(config)#interface fa0/14
SW1(config-if)#channel-group 1 mode desirable
I configure SW1 for PAgP desirable mode. It will actively ask SW2 to become an Etherchannel
this way.
SW2(config)#interface fa0/13
SW2(config-if)#channel-group 1 mode auto
SW2(config)#interface fa0/14
SW2(config-if)#channel-group 1 mode auto
Here’s the configuration of SW2. I used the PAgP auto mode so it will respond to requests to
become an etherchannel.
SW1 %LINK-3-UPDOWN: Interface Port-channel1, changed state to up
SW2 %LINK-3-UPDOWN: Interface Port-channel1, changed state to up
You’ll see a message on your switches like mine above. The switch will create a port-
channel interface.
SW1(config)#interface port-channel 1
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW2(config)#interface port-channel 1
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
The port-channel interface can be configured. I’ve set mine to use 802.1Q encapsulation and to
become a trunk.
SW1#show etherchannel 1 port-channel
Port-channels in the group:
---------------------------
Port-channel: Po1
------------
Age of the Port-channel = 0d:00h:10m:16s
Logical slot/port = 2/1 Number of ports = 2
GC = 0x00010001 HotStandBy port = null
Port state = Port-channel Ag-Inuse
Protocol = PAgP
Port security = Disabled
Ports in the Port-channel:
Index Load Port EC state No of bits
------+------+------+------------------+-----------
0 00 Fa0/13 Desirable-Sl 0
0 00 Fa0/14 Desirable-Sl 0
Time since last port bundled: 0d:00h:00m:07s Fa0/14
Time since last port Un-bundled: 0d:00h:04m:08s Fa0/13
Here’s one way to verify your configuration. Use the show etherchannel port-channel command
to check if the port-channel is active or not. You can also see that we are using PAgP. Interface
fa0/13 and fa0/14 are both in use for this etherchannel.
SW1#show etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use f - failed to allocate aggregator
M - not in use, minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) PAgP Fa0/13(P) Fa0/14(P)
If you have many etherchannels you can also use the show etherchannel summary command.
It will give you a quick overview of all the etherchannels and the interfaces that are in use.
SW1#show interfaces fa0/14 etherchannel
Port state = Up Mstr In-Bndl
Channel group = 1 Mode = Desirable-Sl Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index =0 Load = 0x00 Protocol = PAgP
Flags: S - Device is sending Slow hello. C - Device is in Consistent state.
A - Device is in Auto mode. P - Device learns on physical port.
d - PAgP is down.
Timers: H - Hello timer is running. Q - Quit timer is running.
S - Switching timer is running. I - Interface timer is running.
Local information:
Hello Partner PAgP Learning Group
Port Flags State Timers Interval Count Priority Method Ifindex
Fa0/14 SC U6/S7 H 30s 1 128 Any 5001
Partner's information:
Partner Partner Partner Partner Group
Port Name Device ID Port Age Flags Cap.
Fa0/14 SW2 0019.569d.5700 Fa0/14 19s SAC 10001
Age of the port in the current state: 0d:00h:02m:37s
The third method to verify your etherchannel is to use the show interfaces
etherchannel command. In my example I am looking at the information of my fa0/14 interface.
Besides information of our local switch you can also see the interface of our neighbor switch
(SW2 in my example).
The last thing I want to share with you about PAgP are the different modes you can choose
from:
On
Desirable
Auto
Off
I have configured SW1 to use desirable and SW2 to use auto mode. Not all the different
combinations work:
On Desirable Auto Off
On Yes No No No
Desirable No Yes Yes No
Auto No Yes No No
Off No No No No
Here’s an overview with all the different options. Keep in mind that configuring your
etherchannel as “on” doesn’t use any negotiation so it will fail if the other side is configured for
auto or desirable.
Configurations
SW1
SW2
Want to take a look for yourself? Here you will find the configuration of each device.
LACP is similar to PAgP. You also have different options to choose from when you configure the
interface:
On (interfaces becomes member of the etherchannel but does not negotiate).
Active (interface will actively ask the other side to become an etherchannel).
Passive (interface will wait passively for the other side to ask to become an
etherchannel).
Off (no etherchannel configured on the interface).
It’s basically the same thing as PAgP but the terminology is different. Let’s configure LACP to
see what it does.
SW1(config)#default interface fa0/13
Interface FastEthernet0/13 set to default configuration
SW1(config)#default interface fa0/14
Interface FastEthernet0/14 set to default configuration
SW2(config)#default interface fa0/13
Interface FastEthernet0/13 set to default configuration
SW2(config)#default interface fa0/14
Interface FastEthernet0/14 set to default configuration
SW1(config)#no interface port-channel1
SW2(config)#no interface port-channel1
Layer 3 Etherchannel on Cisco IOS Switch
In a previous tutorial I explained how Etherchannels work and how to configure them, but I didn’t
write about layer 3 Etherchannels before. In this tutorial, I’ll show you how to configure them.
A layer 3 etherchannel is similar to an interface on a router. The switch won’t “switch” traffic on
this interface but route it. Because it’s a layer 3 interface, we configure an IP address on it.
I’ll be using two switches for this:
Before we configure the port channel settings you need to make sure that all interfaces have
the exact same configuration. Once you use the channel-group command, the port-channel
interface will automatically inherit all settings from your physical interface. If you forget to run
the no switchport command on an interface, your etherchannel will be layer 2 instead of layer
3!
Having said that, let’s configure our switches:
SW1(config)#interface range fastEthernet 0/1 - 2
SW1(config-if-range)#no switchport
SW1(config-if-range)#channel-group 12 mode on
Creating a port-channel interface Port-channel 12
SW2(config)#interface range fa0/1 - 2
SW2(config-if-range)#no switchport
SW2(config-if-range)#channel-group 12 mode on
Creating a port-channel interface Port-channel 12
This creates our Etherchannel, we can verify our work like this:
SW1#show etherchannel 12 summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use f - failed to allocate aggregator
M - not in use, minimum links not met
u - unsuitable for bundling
w - waiting to be aggregated
d - default port
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
12 Po12(RU) - Fa0/1(P) Fa0/2(P)
Above you can see that our port-channel 12 interface is layer 3 and it’s operational. Just like any
other layer 3 interface we can configure an IP address on this port-channel interface:
SW1(config)#interface port-channel 12
SW1(config-if)#ip address 192.168.12.1 255.255.255.0
SW2(config)#interface port-channel 12
SW2(config-if)#ip address 192.168.12.2 255.255.255.0