Hands-on tutorial

Tutorials · Switching

How to Dual-Home Servers to Two Switches With M-LAG

Connect each server to two switches with one LACP bond, so either switch can fail or be upgraded without downtime, and without spanning tree blocking a link.

Advanced11 min6 steps

Before you start

  • Two identical switches that support M-LAG (multi-chassis link aggregation)
  • Servers or hypervisors with two network ports and LACP support
  • Two or more links between the switches for the peer link

Step by step

  1. Understand the design

    With M-LAG, two switches act as one LACP partner to the server. The server bonds one port to each switch. Both links forward traffic, and if one switch fails, the other carries everything.

  2. Build the peer link

    Connect the two switches with at least two high-speed links bundled together. This peer link synchronises MAC tables and carries traffic when a server loses one side.

  3. Add a keepalive

    Configure a separate keepalive path, usually over the management network, so each switch can tell 'my peer is down' from 'the peer link is down'.

  4. Create matching M-LAG interfaces

    On both switches, create the same aggregation group number for each server and add the server-facing port to it. VLANs and settings must match on both sides.

    interface eth-trunk 10
     mode lacp
     m-lag 10
     port link-type trunk
     port trunk allow-pass vlan 10 20
    
  5. Configure the server

    Create an LACP bond (802.3ad) with both ports. Use layer3+4 hashing so different sessions use both links.

  6. Test failure

    Pull one cable, then reload one switch during a maintenance window. Pings to the server should lose at most a packet or two.

Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.

Pro tips

  • Keep switch firmware identical on both M-LAG peers.
  • Upgrade one peer at a time and check the M-LAG state before the second.
  • Monitor peer link utilisation: if it is busy in normal operation, something is single-homed.