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.
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
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.
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.
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'.
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
Configure the server
Create an LACP bond (802.3ad) with both ports. Use layer3+4 hashing so different sessions use both links.
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.
FAQ
Frequently asked questions
Is M-LAG the same as stacking?
No. A stack is one logical switch with one control plane; M-LAG keeps two independent switches, so one can be upgraded while the other runs.
Do I still need spanning tree?
Keep it enabled as a safety net, but M-LAG links are not blocked by it.
Keep learning
Related guides
Link aggregation (LACP)
Read more →Switch stacking basics
Read more →Leaf-spine vs three-tier
Read more →How to Configure VLANs on a Managed Switch
Separate staff, guests, voice and cameras into their own VLANs: create VLANs, set access and trunk ports, and verify traffic separation.
Read more →How to Set Up Inter-VLAN Routing on a Layer 3 Switch
Route between VLANs at wire speed using switch virtual interfaces (SVIs), a DHCP relay and ACLs that control which networks can talk.
Read more →How to Configure Link Aggregation (LACP) Between Switches
Bundle two or more links into one logical link for more bandwidth and redundancy using IEEE 802.3ad LACP.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.