How to configure LACP on Cisco switches

In this post, I would like to show you how to configure LACP on Cisco switches. LACP is a dynamic link aggregation protocol which helps create an EtherChannel port on Cisco switches.

An EtherChannel interface is the result of bundling multiple physical links into a logical port. It is recommended to use n links to the power of two (For example 2, 4, 8, 16 physical ports). In other technical documents, you can find references to the same concept by the name port-channel, link aggregation group (LAG), and bonding.

The idea behind this concept is to increase the fault tolerance and speed between switches, routers and/or servers. In case of a link failure, the traffic will be redistributed among the remaining links.

Gulian Technology

How to configure LACP on Cisco switches
How to configure LACP on Cisco switches

Link Aggregation Control Protocol (LACP) was standardized by the Institute of Electrical and Electronics Engineers (IEEE) and is defined in 802.3AD link aggregation specification. It is an open standard as oposed to PAgP which is a Cisco proprietary protocol. It is used for dynamically establishing an EtherChannel port on Cisco switches and/or other devices. This protocol can be used in a mixed environment. It is supported by multiple network equipment vendors.

Check the interface status

Before starting to configure EtherChannel, let’s check the lab network diagram and the interfaces status. I will use 4 interfaces in my lab. All of them are in connected status.

Output SW0:

SW0#show int status

Port      Name               Status       Vlan       Duplex  Speed Type 
Gi0/0                        connected    trunk      a-full   auto RJ45
Gi0/1                        connected    trunk      a-full   auto RJ45
Gi0/2                        connected    trunk      a-full   auto RJ45
Gi0/3                        connected    trunk      a-full   auto RJ45
Gi1/0                        connected    10         a-full   auto RJ45
SW0#

Output SW1:

SW1#show int status

Port      Name               Status       Vlan       Duplex  Speed Type 
Gi0/0                        connected    trunk      a-full   auto RJ45
Gi0/1                        connected    trunk      a-full   auto RJ45
Gi0/2                        connected    trunk      a-full   auto RJ45
Gi0/3                        connected    trunk      a-full   auto RJ45
Gi1/0                        connected    10         a-full   auto RJ45
SW1#
 Lab Network Diagram
Lab Network Diagram

Check spanning-tree

If you add multiple links between two switches, spanning tree will block all the links and leave only one link for traffic forwarding. With EtherChannel this is not the case. Let’s check if all the interfaces are used to forward the traffic.

Output SW0:

SW0#show spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     5254.000b.a5e5
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     5254.000b.a5e5
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Desg FWD 4         128.1    P2p 
Gi0/1               Desg FWD 4         128.2    P2p 
Gi0/2               Desg FWD 4         128.3    P2p 
Gi0/3               Desg FWD 4         128.4    P2p 


SW0#

Output SW1:

SW1#show spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     5254.000b.a5e5
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     5254.0011.9ff1
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Root FWD 4         128.1    P2p 
Gi0/1               Altn BLK 4         128.2    P2p 
Gi0/2               Altn BLK 4         128.3    P2p 
Gi0/3               Altn BLK 4         128.4    P2p 


SW1#
show spanning-tree vlan 1
show spanning-tree vlan 1

As you can see on SW1, from the available 4 ports, only one is in forwarding status. The other 3 are in blocking status. I will share the same output after adding the ports to the EtherChannel bundle.

Configure LACP

After confirming that all ports are up and running, you need to configure LACP by running the below commands.

Output SW0:

SW0#conf term
Enter configuration commands, one per line.  End with CNTL/Z.
SW0(config)#int range gi0/0-3
SW0(config-if-range)#chan
SW0(config-if-range)#channel-gr
SW0(config-if-range)#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

SW0(config-if-range)#channel-group 1 mode ac
SW0(config-if-range)#channel-group 1 mode active 
Creating a port-channel interface Port-channel 1

SW0(config-if-range)#
*Jul 17 11:38:32.097: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down
*Jul 17 11:38:32.130: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
*Jul 17 11:38:32.156: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
*Jul 17 11:38:32.197: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/3, changed state to down
SW0(config-if-range)#
*Jul 17 11:38:39.424: %EC-5-L3DONTBNDL2: Gi0/2 suspended: LACP currently not enabled on the remote port.
*Jul 17 11:38:39.483: %EC-5-L3DONTBNDL2: Gi0/0 suspended: LACP currently not enabled on the remote port.
*Jul 17 11:38:39.632: %EC-5-L3DONTBNDL2: Gi0/3 suspended: LACP currently not enabled on the remote port.
*Jul 17 11:38:39.648: %EC-5-L3DONTBNDL2: Gi0/1 suspended: LACP currently not enabled on the remote port.
SW0(config-if-range)#

Output SW1:

SW1#conf term
*Jul 17 11:37:50.678: %SYS-5-CONFIG_I: Configured from console by console
SW1#conf term
Enter configuration commands, one per line.  End with CNTL/Z.
SW1(config)#int range gi0/0-3
SW1(config-if-range)#channe
SW1(config-if-range)#channel-gr
SW1(config-if-range)#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

SW1(config-if-range)#channel-group 1 mode pass
SW1(config-if-range)#channel-group 1 mode passive 
SW1(config-if-range)#
*Jul 17 11:39:16.235: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down
*Jul 17 11:39:16.260: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
*Jul 17 11:39:16.290: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
*Jul 17 11:39:16.320: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/3, changed state to down
SW1(config-if-range)#
*Jul 17 11:39:19.559: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/3, changed state to up
*Jul 17 11:39:20.516: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
SW1(config-if-range)#
*Jul 17 11:39:20.587: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up
SW1(config-if-range)#
*Jul 17 11:39:22.682: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
SW1(config-if-range)#
*Jul 17 11:39:29.019: %LINK-3-UPDOWN: Interface Port-channel1, changed state to up
SW1(config-if-range)#
*Jul 17 11:39:30.019: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
SW1(config-if-range)#

I used the interface range command in order to configure multiple interfaces at the same time.

Configure LACP
Configure LACP

LACP port modes

LACP port modes:

active – Enable LACP unconditionally. The interface transmits LACP packets out of it and initiates an EtherChannel to be established.

passive – Enable LACP only if a LACP device is detected. The interface does not initiate an EtherChannel to be established and does not transmit LACP packets out of it.

You need to configure at least one end of the interface with the active mode. Otherwise, it will not work and the port channel will remain down.

SW0#show etherchannel summ
SW0#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      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Gi0/0(P)    Gi0/1(P)    Gi0/2(P)    
                                 Gi0/3(P)    
          
SW0#

Check the status of the newly created logical interface

After configuring both switches, you need to check the status of the newly created logical interface.

Run a similar command for finding details about the new interface.

Output SW0:



SW0#show int po1
Port-channel1 is up, line protocol is up (connected)
Hardware is EtherChannel, address is 5254.000b.a5e5 (bia 5254.000b.a5e5)
MTU 1500 bytes, BW 4000000 Kbit/sec, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:28:10, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 1000 bits/sec, 2 packets/sec
245 packets input, 84198 bytes, 0 no buffer
Received 0 broadcasts (0 multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
3443 packets output, 345882 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
SW0#

Output SW1:



SW1#show int po1
Port-channel1 is up, line protocol is up (connected) 
  Hardware is EtherChannel, address is 5254.000d.b77b (bia 5254.000d.b77b)
  MTU 1500 bytes, BW 4000000 Kbit/sec, DLY 10 usec, 
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 1000 bits/sec, 1 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     2698 packets input, 232394 bytes, 0 no buffer
     Received 0 broadcasts (0 multicasts)
     0 runts, 0 giants, 0 throttles 
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 input packets with dribble condition detected
     832 packets output, 170604 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
SW1#

The logical interface on both switches is in up status.

Check the status of the EtherChannel interfaces
Check the status of the EtherChannel interfaces

As you can see, the available bandwith has increased from 1000000 Kbit/sec to 4000000 Kbit/sec.

LACP show commands

By running the show lacp neighbour command, you can find more details about the neighbor device. You can find the priority of the interfaces, the ID of the neighbour device and you can find which mode the neighbour interface is in (active or passive).

SW0#show lacp nei
SW0#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                        Admin  Oper   Port    Port
Port      Flags   Priority  Dev ID          Age    key    Key    Number  State
Gi0/0     SP      32768     5254.0011.8000  19s    0x0    0x1    0x1     0x3C  
Gi0/1     SP      32768     5254.0011.8000  25s    0x0    0x1    0x2     0x3C  
Gi0/2     SP      32768     5254.0011.8000   8s    0x0    0x1    0x3     0x3C  
Gi0/3     SP      32768     5254.0011.8000   0s    0x0    0x1    0x4     0x3C  
SW0#
show lacp neighbor
show lacp neighbor

To find the number of the lacp packets sent and received, run the following command.

SW0#show lacp counters 
             LACPDUs         Marker      Marker Response    LACPDUs
Port       Sent   Recv     Sent   Recv     Sent   Recv      Pkts Err
---------------------------------------------------------------------
Channel group: 1
Gi0/0       92     95       0      0        0      0         0     
Gi0/1       290    287      0      0        0      0         0     
Gi0/2       92     94       0      0        0      0         0     
Gi0/3       92     95       0      0        0      0         0     

SW0#
show lacp counters
show lacp counters

Finally, to find the local system id, run the following command.

SW0#show lacp sys
SW0#show lacp sys-id 
1, 5254.000b.8000
SW0#
show lacp sys-id
show lacp sys-id

Check if STP is blocking the ports

After confirming that the logical interface is up and running, let’s check if STP is blocking any interface. Before configuring EtherChannel, it blocked 3 interfaces.

Output SW0:

SW0#show spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     5254.000b.a5e5
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     5254.000b.a5e5
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po1                 Desg FWD 3         128.65   P2p 


SW0#

Output SW1:

SW1#show spanning-tree vlan 1 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     5254.000b.a5e5
             Cost        3
             Port        65 (Port-channel1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     5254.0011.9ff1
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po1                 Root FWD 3         128.65   P2p 


SW1#

The EtherChannel interface is in forwarding status. The physical interfaces that are part of the logical interface are no longer present in the output.

The speed of the interface is increased to 4000000 Kbit/sec.

SW1#show int po1 | include line|BW
Port-channel1 is up, line protocol is up (connected) 
  MTU 1500 bytes, BW 4000000 Kbit/sec, DLY 10 usec, 
SW1#
EtherChannel interface speed
EtherChannel interface speed

Find more details about the EtherChannel port

Another two useful commands that you can use in order to find more information about the EtherChannel ports are:

SW0#show etherchannel 
                Channel-group listing: 
                ----------------------

Group: 1 
----------
Group state = L2 
Ports: 4   Maxports = 4
Port-channels: 1 Max Port-channels = 4
Protocol:   LACP
Minimum Links: 0



SW0#

In the output of the show etherchannel command, you can find the group number (1 in my case), and group state (L2, it can be also configured as L3). You have the number of ports which are part of the logical interface (4 in my lab). Under the protocol, you see LACP because we configured the EtherChannel dynamically using the Link Aggregation Control Protocol.

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      N - not in use, no aggregation
        f - failed to allocate aggregator

        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

        A - formed by Auto LAG


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Gi0/0(P)    Gi0/1(P)    Gi0/2(P)    
                                 Gi0/3(P)    
          
SW1#

In the output of the show etherchannel summary command, you can find the following information: group number, port-channel name and its status (SU – Layer 2, in use), member ports and their status (P – bundled in port-channel) and the protocol used (LACP in our case).

show etherchannel
show etherchannel

Check the connectivity from PC0 to PC1

The last step is to check the connectivity between the end hosts: PC0 and PC1.

With the ping command, I tested the connectivity between PC0 and PC1.

Alpine-0:~$ ping -c 4 10.1.1.20
PING 10.1.1.20 (10.1.1.20): 56 data bytes
64 bytes from 10.1.1.20: seq=0 ttl=42 time=18.751 ms
64 bytes from 10.1.1.20: seq=1 ttl=42 time=20.956 ms
64 bytes from 10.1.1.20: seq=2 ttl=42 time=16.420 ms
64 bytes from 10.1.1.20: seq=3 ttl=42 time=16.381 ms

--- 10.1.1.20 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 16.381/18.127/20.956 ms
Alpine-0:~$ 
Alpine-0:~$ 
Check the connectivity between PC0 and PC1
Check the connectivity between PC0 and PC1

That’s it! You have learned how to configure LACP on Cisco switches. If you found this blog post helpful, please like and subscribe for more Cisco networking tutorials. Thank you for reading it!

Processing…
Success! You're on the list.

Leave a Reply