Intermediate · Spanning Tree and EtherChannel · topic 30 of 57 · 30 min
EtherChannel: bundling links
Explanation
Why bundle links?
An access switch has many users and a single 1 Gbps uplink is getting full. You add a second cable to the same distribution switch. But spanning tree sees two parallel links between the same two switches, which is a loop, and blocks one of them. You paid for two links and use one.
EtherChannel (also called link aggregation or a port-channel) bundles several physical links into one logical link. Spanning tree sees a single link, so nothing is blocked and every member carries traffic. If one cable fails, traffic moves to the remaining members within a moment, without any spanning tree recalculation.
Three ways to form a bundle
- LACP (Link Aggregation Control Protocol): the open standard, IEEE 802.3ad, now maintained as IEEE 802.1AX. Modes: active (sends LACP messages to start a bundle) and passive (answers but does not start).
- PAgP (Port Aggregation Protocol): Cisco proprietary. Modes: desirable (starts) and auto (answers only).
- Static on: no protocol at all. Both sides must be set to on. Simple, but nothing checks that the other side is set up the same way.
| Side A | Side B | Bundle forms? |
|---|---|---|
| active | active or passive | Yes (LACP) |
| passive | passive | No: both wait |
| desirable | desirable or auto | Yes (PAgP) |
| auto | auto | No: both wait |
| on | on | Yes (static) |
| on | anything else | No |
| LACP mode | PAgP mode | No: different protocols |
The pattern is the same as DTP: at least one side must actively ask. Prefer LACP with active on both ends: it is standard, works with other vendors and servers, and detects cabling mistakes that static on would miss.
Configuring an LACP EtherChannel
SW1(config)# interface range gigabitEthernet 0/1 - 2
SW1(config-if-range)# channel-group 1 mode active
SW1(config-if-range)# exit
SW1(config)# interface port-channel 1
SW1(config-if)# switchport mode trunk
SW1(config-if)# switchport trunk allowed vlan 10,20,30
SW1(config-if)# end
SW1# show etherchannel summaryMembers must match
All member ports must have the same speed and duplex, the same switchport mode (all access or all trunk), the same access VLAN, or the same allowed VLANs and native VLAN on trunks. A port that does not match is suspended or left out of the bundle. The easiest way to stay consistent is to configure the port-channel interface, not the members one by one.
Load balancing: one flow, one link
An EtherChannel does not split a single frame across links. The switch calculates a hash from fields of each frame, such as source and destination IP addresses, and the result picks one member link. All frames of the same conversation (a flow) give the same hash, so they use the same link and arrive in order. Many different flows spread across all links.
Consequence: one big file copy between two servers never goes faster than one member link, even on a 4-link bundle. And if the hash fields are badly chosen (for example only the source MAC, when all traffic comes from one router), most traffic can end up on one link. The default method depends on the platform; check it and change it globally.
SW1(config)# port-channel load-balance src-dst-ip
SW1(config)# end
SW1# show etherchannel load-balanceReading show etherchannel summary
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 ...
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------
1 Po1(SU) LACP Gi0/1(P) Gi0/2(P)Healthy: SU for a layer 2 channel (RU for layer 3), and P on every member. Trouble: SD means the port-channel is down; (I) means a member stands alone because negotiation failed; (s) means suspended, usually a settings mismatch; (D) means the member itself is down.
Layer 3 EtherChannel, briefly
Between two layer 3 switches you can bundle routed ports: put no switchport on the members and the port-channel, and give the port-channel an IP address.
DSW1(config)# interface range gigabitEthernet 1/0/1 - 2
DSW1(config-if-range)# no switchport
DSW1(config-if-range)# channel-group 2 mode active
DSW1(config-if-range)# interface port-channel 2
DSW1(config-if)# no switchport
DSW1(config-if)# ip address 10.0.0.1 255.255.255.252Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
EtherChannel: bundling links · 1/8
In this lesson you will learn how to bundle several cables into one logical link with EtherChannel.
Prefer a video by a teacher? Find free videos on “etherchannel lacp pagp configuration ccna packet tracer” on YouTube ↗
In real life: Full uplinks at a travel booking call centre
A call centre for a travel booking company runs 600 agents on 15 access switches. Every morning at 10 am, when Tatkal bookings open, the 1 Gbps uplinks hit 100% and calls break up. Buying 10 Gbps switches would take months. The network team adds a second cable from each access switch to the distribution switch and configures LACP active on both ends, with port-channel load-balance src-dst-ip. Each uplink now carries 2 Gbps across many agent flows, spanning tree blocks nothing between the pair, and a cut cable just halves the capacity instead of causing an outage.
Practice (0/3 done)
Write channel_forms(a, b) that returns True if an EtherChannel forms between two ports set to modes a and b. Modes are "on", "active", "passive" (LACP), "desirable" and "auto" (PAgP). Rules: on only works with on; LACP works if both are LACP modes and at least one is active; PAgP works if both are PAgP modes and at least one is desirable.
A simplified src-dst-ip hash: take the last octet of the source IP and the last octet of the destination IP, XOR them (the ^ operator), and take the result modulo the number of links. Write pickLink(srcIp, dstIp, links) that returns the member link index (0 to links - 1). Real switches use their own hash, but the idea is the same: the same pair of addresses always gives the same link.
Packet Tracer lab: connect two 2960 switches (SW1, SW2) with two cables, Gi0/1 to Gi0/1 and Gi0/2 to Gi0/2. First look at show spanning-tree: one link is blocked. Then build an LACP EtherChannel (group 1) that is a trunk allowing VLANs 10 and 20, and verify it.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- STP port states, RSTP and Rapid PVST+Spanning Tree and EtherChannel · same module
- Root bridge election, root ports and designated portsSpanning Tree and EtherChannel · same module
- Ethernet frames and MAC addressesEthernet, MAC addresses and the Cisco CLI
- Switch management and interface troubleshootingSwitching and VLANs
- Inter-VLAN routingSwitching and VLANs
- WLAN architectures, CAPWAP and AP modesWireless networking
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
Which pair of modes does NOT form an EtherChannel?
Answer: passive and passive
Passive only answers LACP messages, so with passive on both ends nobody starts.
Which standard defines LACP?
Answer: IEEE 802.3ad (now 802.1AX)
LACP came from IEEE 802.3ad and is now maintained in IEEE 802.1AX.
Why can a single file copy not use the full speed of a 4-link EtherChannel?
Answer: A flow is hashed onto one member link
All frames of one flow give the same hash, so they all use the same member link.
show etherchannel summary shows Gi0/2(s). What does s mean?
Answer: Suspended, usually a settings mismatch
Lower-case s means suspended; check speed, duplex and VLAN settings against the other members.
Where should you configure the trunk settings of an EtherChannel?
Answer: On interface port-channel
Configure the logical port-channel interface; IOS applies the settings to the members so they stay consistent.
Two new switches use dynamic auto on the ports that link them. What forms?Related
Answer: An access link
Both sides wait for the other to ask, so neither asks and the link stays access.
An IP phone and a PC share one switch port. Which command puts the phone traffic in VLAN 50?Related
Answer: switchport voice vlan 50
switchport voice vlan 50 tells the phone to tag voice frames with VLAN 50; the PC stays in the access VLAN.
One end of a 100 Mbps link is set to full duplex by hand, the other is on auto and falls back to half. What will you most likely see?Related
Answer: Late collisions on one side, CRC errors on the other, and a slow link
That is a duplex mismatch: the link is up but slow and full of errors.
A switch log keeps saying a host is "flapping between port Gi0/1 and port Gi0/2". What does this suggest?Related
Answer: A layer 2 loop
MAC flapping means the same source MAC keeps arriving on different ports, a typical sign of a loop.
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- This is the last topic of “Spanning Tree and EtherChannel”. The module exam comes next.
- Module 6 exam: Spanning Tree and EtherChannel · 13 questions · 20 min, without help. 5 topics of this module still to finish first.
- Then the next module, Routing: static routes and OSPF. 57 topics left in the course before the final exam.
← Previous: Protecting spanning tree: PortFast, BPDU Guard, Root Guard and Loop Guard