Sub topic 15
Multi-Chassis Link Aggregation Across Two Switches
This chapter assumes you know how a single-switch port channel works, how LACP negotiates a bundle, and why spanning tree blocks redundant paths. It covers how multi-chassis link aggregation (MLAG) lets one device bundle links that end on two different switches.
The problem MLAG solves
A normal LAG has a hard limit: every member port must sit on the same switch. If that switch fails, the whole bundle goes down with it. Dual-homing a server to two switches avoids this single point of failure. Without MLAG, though, the two uplinks cannot be one bundle.
The usual workaround is two separate links, and spanning tree then blocks one of them. You pay for two links but use one. Failover also waits for spanning tree to reconverge.
MLAG removes this trade-off. The two switches cooperate so that the downstream device sees them as one LACP partner. The server or access switch configures an ordinary LACP bundle. It does not know that its members end on different chassis.
The vendor names differ: Cisco calls it vPC (Nexus) or VSS and StackWise Virtual (Catalyst), Arista calls it MLAG, Juniper calls it MC-LAG or Virtual Chassis, and Cumulus and others call it MLAG or CLAG. The concepts are close, but the implementations are not interoperable. Both switches in a pair must come from the same vendor and run compatible software.
How it works
The two switches form a pair, and each part of the design has a job.
- Peer link. A dedicated link or port channel between the two switches. It carries control traffic and synchronizes state. It also carries data frames in some failure cases.
- Keepalive. A separate, usually out-of-band path, such as the management network. Each switch uses it to check that its peer is alive, independent of the peer link.
- Shared LACP identity. Both switches send the same LACP system ID and a consistent port key to the downstream device. The partner therefore believes it is talking to one switch.
- State synchronization. The pair exchanges MAC address tables, ARP entries, and LACP and VLAN information, so both can forward correctly.
The downstream device runs the same LACP configuration you have already seen. For a Linux server, the bond from the earlier chapter works unchanged:
ip link add bond0 type bond mode 802.3ad miimon 100 lacp_rate fast xmit_hash_policy layer3+4
ip link set eth0 down
ip link set eth0 master bond0
ip link set eth1 down
ip link set eth1 master bond0
ip link set bond0 up
cat /proc/net/bonding/bond0In the status output, both members should report the same partner system ID, even though they connect to different switches. If the IDs differ, the pair is not presenting a shared identity, and the bundle will not form across both links.
Forwarding behavior
Each switch forwards traffic arriving on its local member port toward the network normally. The key rule in most designs is that traffic received on a local MLAG port should leave through a local MLAG port when possible. The peer link is used only when the destination is reachable only through the other switch, for example when the local member link has failed.
This keeps the peer link from becoming a bottleneck in normal operation. It also means the peer link must be sized for failure cases. If one server uplink fails, traffic that would have used it crosses the peer link.
Hashing still applies. The server hashes each flow onto one of its two members, so a single flow still uses one link. The switches do not split a flow between themselves. MLAG adds redundancy and spreads many flows across two chassis, but it does not raise the per-flow speed limit.
Spanning tree and MLAG
Because the downstream device sees one logical bundle, there is no loop between it and the pair, and spanning tree does not need to block either member. The pair itself still takes part in spanning tree toward the rest of the network, and most implementations make the two peers behave as one bridge for that purpose. They send the same bridge ID, or one peer is elected primary for BPDU handling.
Keep spanning tree enabled. MLAG does not protect against a cabling mistake that joins two edge devices outside the pair, and spanning tree is the safety net. Many designs also mark server-facing ports as edge ports so they forward immediately.
Failure scenarios
MLAG is only as safe as its handling of a split between the peers. Consider each failure.
| Failure | What happens |
|---|---|
| One member link fails | The downstream device rehashes flows onto the surviving link. Traffic may cross the peer link if the destination sits behind the other switch. |
| One switch fails | The surviving switch keeps the other member link up and takes over. The downstream device sees one member go down. |
| Peer link fails, keepalive up | Each switch knows the other is alive. By convention the secondary suspends its MLAG member ports, so only the primary forwards. This prevents duplicate forwarding and loops. |
| Peer link and keepalive both fail | Each switch believes the other is dead. Both may act as primary. This is a split brain and can cause duplicate traffic, MAC flapping, or loops. |
The reason for a separate keepalive path is the last row. If the keepalive shares fate with the peer link, a single fault produces split brain. Run the keepalive over a different physical path, such as the management network, not over the peer link.
Configuration consistency
Both peers must agree on settings that affect the shared bundle. Typical items are VLANs allowed on the trunk, the port-channel mode, spanning tree mode, and MTU. A mismatch is called an inconsistency. Depending on the platform, the switch may suspend the affected port channel or VLANs on one peer, or log a warning and continue.
Several practical rules follow.
- Configure each peer with the same member port-channel number and the same VLAN list.
- Match the LACP mode, and keep timers consistent where the platform requires it.
- Use the same software release on both peers, or follow the vendor's documented upgrade order.
- Check the consistency view after every change. Most platforms have a command for it, such as
show vpc consistency-parameterson Nexus orshow mlag config-sanityon Arista.
A one-sided change is the most common cause of a bundle that comes up on one switch and stays down on the other.
Verifying and troubleshooting
Work from the pair outward.
- Confirm the peer is established and the keepalive is healthy. Every platform has a peer status command, for example
show vpcorshow mlag. - Confirm that each MLAG port channel is up on both peers and lists the downstream member as bundled.
- Run the consistency check and fix any difference.
- On the downstream device, run
show lacp neighboror read/proc/net/bonding/bond0. Both members should be in the aggregator and should report the same partner system ID. - If only one link carries traffic, check the hash. One heavy flow, or an unsuitable hash policy, loads one member while the other idles. This is the same effect as in a single-switch bundle.
Design limits
MLAG has costs that a plain LAG does not.
- Vendor lock-in. The pair must be from one vendor, and the protocol is proprietary.
- Operational coupling. Two switches act as one failure domain for configuration and upgrades. A bad change or software bug can affect both.
- Pair size. MLAG joins exactly two switches. Larger fabrics need a different approach, such as routed leaf-spine designs with EVPN multihoming, which standardizes a similar function.
- Peer link sizing. Undersizing it creates a hidden bottleneck during failures.
Exercise
A server is dual-homed with LACP to two MLAG peers. The peer link goes down, but the keepalive path stays up. What should each switch do, and why? Then explain what changes if the keepalive also fails.
Show answer
With the keepalive up, each switch can tell that its peer is still alive, so this is a link failure and not a switch failure. By convention the secondary peer suspends its MLAG member ports, and the primary keeps forwarding. This avoids two switches forwarding the same traffic and causing duplicates or loops. If the keepalive also fails, each switch assumes the other is dead and may act as primary, which is split brain. This is why the keepalive must use a path independent of the peer link.
Exercise
The Linux bond shows two members, but the partner system IDs differ between them, and only one member joins the aggregator. What is the most likely cause on the switch side?
Show answer
The two MLAG peers are not presenting a shared LACP identity. Likely causes are a broken or unestablished MLAG pair, or a configuration mismatch, such as different port-channel numbers or system IDs, that the consistency check would show. Check the peer status and the consistency output, fix the difference, and confirm both members report the same partner ID.