Sub topic 8
Configuring an LACP Port Channel on a Switch
This chapter walks through building an LACP port channel trunk on a Cisco IOS style switch. It assumes you know MAC addresses, VLANs and trunks, what a Layer 2 loop is, how to move around the switch CLI, and how IP addresses and TCP/UDP ports work. You should also know that LACP is the standards-based protocol (IEEE 802.1AX, formerly 802.3ad) that negotiates a bundle. Command names differ between vendors and platforms. The IOS syntax here is a model, so check your platform's documentation for the exact options.
What you are building
Two switches, SW1 and SW2, are joined by two physical links, Gi0/1 and Gi0/2. You want them to act as one trunk that carries VLANs 10 and 20. The switch creates a logical interface, Port-channel1, to represent the bundle. The physical interfaces become members of that bundle.
LACP modes on the channel-group command
You enable LACP on each member port with the channel-group command. The keyword at the end selects the protocol and role.
| Keyword | Protocol | Behavior |
|---|---|---|
| `active` | LACP | Sends LACP packets and starts negotiation |
| `passive` | LACP | Replies to LACP packets but never starts negotiation |
| `on` | None (static) | Forms the bundle unconditionally, with no negotiation |
| `desirable` / `auto` | PAgP | Cisco proprietary equivalent of active / passive |
A bundle forms when at least one side is active. Active with active works, and active with passive works. Passive with passive does not, because neither side sends the first LACP packet. Mixing on with an LACP mode does not work either, because one side expects LACP packets that never arrive.
Step 1: choose the hash
The load-balancing hash is a global setting on most Cisco switches. It decides which fields of a frame feed the calculation that picks a member link. Set it once for the whole switch:
port-channel load-balance src-dst-ipThe options vary by platform. Some switches offer only MAC-based or IP-based choices, while others include Layer 4 ports. The hash only affects traffic that this switch transmits, so SW1 and SW2 can use different settings. Pick the one that gives the best spread for the traffic each switch sends.
Step 2: configure the members
Configure the physical interfaces first. The channel-group command creates Port-channel1 automatically if it does not exist.
interface range GigabitEthernet0/1 - 2
switchport mode trunk
switchport trunk allowed vlan 10,20
channel-group 1 mode activeSome older platforms also need switchport trunk encapsulation dot1q before switchport mode trunk. If the first command is rejected, add it.
The number after channel-group is local to the switch. SW1 can use group 1 while SW2 uses group 5, and the bundle still forms. Using the same number on both ends makes the configuration easier to read, so most teams do that.
Step 3: configure the port channel interface
Settings that apply to the whole bundle go on the logical interface:
interface Port-channel1
switchport mode trunk
switchport trunk allowed vlan 10,20On most platforms, a change you make on Port-channel1 is copied to every member. A change you make on one member only does not propagate. That asymmetry is the source of many problems, covered below.
The complete configuration
This is the full set for SW1. SW2 uses the same commands, with only its own hostname and interfaces differing.
! Global: choose the hash inputs (available options vary by platform)
port-channel load-balance src-dst-ip
!
interface range GigabitEthernet0/1 - 2
switchport mode trunk
switchport trunk allowed vlan 10,20
channel-group 1 mode active
!
interface Port-channel1
switchport mode trunk
switchport trunk allowed vlan 10,20Order of operations on a live link
If the two switches are already connected and you configure one end first, that end's ports may go into an inconsistent state. Spanning tree can also see the physical links as parallel paths before the bundle forms, and block one of them. To avoid a brief outage or a transient loop:
- Shut down the member interfaces on the end you are changing (
shutdown). - Apply the full configuration on both switches.
- Bring the members back up with
no shutdown, on one switch and then the other.
On a link you are not currently relying on, you can skip this. On a production uplink, plan a maintenance window, because the order matters.
What the members must have in common
A port joins the bundle only if its settings match the other members and the port channel. The settings that must match include:
- Speed and duplex.
- Switchport mode (access or trunk).
- Allowed VLAN list and native VLAN, for trunks.
- Access VLAN, for access ports.
- Spanning tree settings such as port cost and PortFast configuration, on most platforms.
If one member disagrees, the switch may suspend that member and keep the others bundled, or it may refuse to bundle at all, depending on the platform and the mismatch. The summary command shows which happened.
A first check
Verification gets its own chapter, but you need one command to confirm the build worked:
show etherchannel summaryTypical output looks like this (illustrative; exact layout varies by software version):
Group Port-channel Protocol Ports
------+-------------+-----------+----------------------------------
1 Po1(SU) LACP Gi0/1(P) Gi0/2(P)Read the flags in parentheses. SU on the port channel means Layer 2 and in use. P on a member means bundled in the port channel. Other flags you may see on members:
| Flag | Meaning |
|---|---|
| `D` | Down |
| `I` | Stand-alone: the port is not bundled and acts as a normal link |
| `s` | Suspended: the port is configured to bundle but was held out |
| `H` | Hot-standby: a spare member, not carrying traffic |
Common mistakes
- Changing a member directly. If you change the allowed VLAN list on Gi0/2 alone, it no longer matches Gi0/1 and the port channel. The member is suspended. Make the change on
Port-channel1instead. - Passive on both ends. Both ports stay
I(stand-alone) because nobody starts negotiation. Change one side toactive. - Mixing
onandactive. Theonside forms a bundle and forwards traffic. Theactiveside keeps the ports stand-alone. This can create a loop or black-hole traffic. Use the same style on both ends. - Expecting one fast flow. A single TCP connection hashes to one member and is limited to that link's speed. Two 1 Gb/s links do not give one transfer 2 Gb/s.
- Mismatched trunk settings between switches. The allowed VLAN list on SW1's port channel should match SW2's. Otherwise the bundle forms but some VLANs do not pass.
Optional tuning
Two LACP settings influence which members are active when more links are present than the bundle can use:
lacp system-priority <value>(global) decides which switch makes the selection decisions. The lower value wins, and the default is 32768.lacp port-priority <value>(per interface) decides which ports are preferred as active. Again, lower wins.
Most designs never change these. They matter when you configure more member ports than the platform allows to be active at once. The extras become hot-standby members.
Summary of the procedure
- Choose a hash and set it globally.
- Configure the member interfaces with identical switchport settings and
channel-group N mode active. - Configure shared settings on
Port-channel N. - Repeat on the other switch.
- Check
show etherchannel summaryforSUon the port channel andPon each member.
Exercise
SW1 has channel-group 1 mode passive on both members. SW2 has channel-group 1 mode passive on both members. The cables are correct and the port settings match. What state do the members end up in, and what is the smallest change that fixes it?
Show answer
The members stay stand-alone (flag I), working as individual links. With both sides passive, neither switch sends the first LACP packet, so no negotiation happens. Changing one side (preferably both) to channel-group 1 mode active fixes it.
Exercise
After the bundle is up, you add VLAN 30 with switchport trunk allowed vlan add 30 on interface Gi0/2 only. What is likely to happen to Gi0/2, and where should you have made the change?
Show answer
Gi0/2 now has an allowed VLAN list that differs from Gi0/1 and from Port-channel1, so the switch will likely suspend it (flag s) and carry traffic only on Gi0/1. The change should have been made on interface Port-channel1, which applies it to all members. Make the same change on the other switch as well.