Bonding (LACP) on MikroTik: Aggregating Bandwidth and Enhancing Redundancy Print

  • Mikrotik, Networking
  • 44

Hey there, friends—Emmanuel Corels here from Emmanuel Corels Creatives. We’ve navigated through quite a few MikroTik waters already, tackling bridging, STP, VRRP, and more. Now, let’s explore another fantastic feature for building robust, high-throughput networks: Bonding. Specifically, we’ll look at the Link Aggregation Control Protocol (LACP), which lets you combine multiple links into one logical interface for extra bandwidth and redundancy.


What Is Bonding (a.k.a. Link Aggregation)?

Bonding (or “teaming”) is the practice of bundling two or more physical interfaces to behave as a single logical interface. This can offer:

  1. Higher Throughput: Each interface adds more capacity, so you approach the sum of all links.
  2. Redundancy: If one cable or interface fails, the connection remains up via the remaining links.
  3. Flexible Scalability: You can start with two interfaces, possibly add more if your switch and router support it.

In MikroTik, “bonding” is the RouterOS feature, and LACP (IEEE 802.3ad) is one of the bonding modes that dynamically negotiates and manages these aggregated links.


Common Scenarios for Bonding

  • Connecting to a Switch: If your switch also supports LACP, you can bond, say, 2×1Gbps ports, effectively getting up to ~2Gbps capacity.
  • Server or NAS: Multi-port NICs bonded to a MikroTik router for big data flows or redundancy.
  • Wireless PTP Links: Some people even bond multiple wireless links for higher throughput or reliability.

Bonding Modes on MikroTik

MikroTik supports several bonding modes, but the most popular include:

  • balance-rr (mode=0): Round-robin. Splits packets across each interface in turn.
  • active-backup (mode=1): One interface is active, the other is backup—simpler redundancy, no load balancing.
  • balance-xor (mode=2): Distributes traffic based on a hash (e.g., MAC, IP).
  • 802.3ad (mode=802.3ad or lacp in older GUIs): The LACP standard. Dynamically negotiates link aggregation with the switch.

We’ll focus on 802.3ad because it’s widely used and works with many managed switches from other vendors.


Setting Up LACP on MikroTik

Let’s assume you have two physical ports on your MikroTik—ether2 and ether3—and you want to bond them using LACP. You’ll also configure the other side (a managed switch) with an LACP trunk.

  1. Create a Bonding Interface

    • In WinBox, go to Interfaces, click the “+” and choose “Bonding.”
    • Name it something like bond-lacp.
    • Set Mode to 802.3ad.
    • Hit OK (or Apply first, then OK).
  2. Add Slave Interfaces

    • In the bonding interface settings, or in CLI:
      /interface bonding set bond-lacp slaves=ether2,ether3
      
      or you can do it from the WinBox “Slave” field.
    • This tells MikroTik that ether2 and ether3 are part of bond-lacp.
  3. Adjust LACP Settings (Optional)

    • You can tweak the transmit-hash-policy if you want. By default, it might be layer-2-and-3, meaning it hashes traffic using MAC + IP addresses to distribute flows across links. That’s usually fine.
    • You might also see lacp-rate as slow or fast. “Slow” sends LACP packets every 30 seconds, “fast” every 1 second. Faster detection is helpful but can be chattier.
  4. Assign IP or Bridge

    • If this bond is your LAN gateway, you’d assign an IP to bond-lacp (just like any normal interface).
    • Or if you’re bridging it with other ports, add bond-lacp into the bridge as a port.
    • Example:
      /ip address add address=192.168.50.1/24 interface=bond-lacp
      
  5. Switch-Side Configuration

    • On your managed switch, group the same physical ports (corresponding to ether2 and ether3) into an LACP trunk. The exact steps vary by vendor (Cisco, HP, Ubiquiti, etc.).
    • Ensure the port channel or LAG is set to use 802.3ad (LACP).
  6. Confirm Status

    • On MikroTik, go to Interfaces → Bonding and look for Running or “R” flags on each slave. WinBox or CLI:
      /interface bonding monitor bond-lacp
      
      You’ll see if both links are active, the LACP partner MAC, etc.

Verifying Throughput and Redundancy

Once configured, do some tests:

  • Redundancy: Unplug ether2. Traffic should continue flowing via ether3 (maybe a split-second interruption if LACP needs to update). Replug ether2, watch the bond rebuild.
  • Throughput: If you have multiple flows (e.g., multiple PCs or multiple TCP sessions), you can saturate near 2×(link speed). However, note that a single TCP flow typically uses only one link based on hashing, so you don’t see double speed for a single flow (that’s a limitation of how LACP load-balances by flow).

Optional Fine-Tuning

  1. Transmit Hash Policy

    • Default is often layer-2-and-3, which uses source/dest MAC + IP for hashing. If you want it purely by MAC or layer 3+4 (including ports), pick a different policy. This can affect how well load balancing works across multiple flows.
  2. LACP Rate

    • If you’re particularly concerned about quick link failure detection, set lacp-rate=fast. This consumes more control packets but detects link issues in ~1 second vs. 30 seconds.
  3. Bonding Queue

    • Some older RouterOS references mention a “queue” setting. Typically, only-hardware-queue or ethernet-default is used, but you can experiment if you see performance issues.

Common Pitfalls

  • Switch Not Configured for LACP: The most frequent mistake. If the switch is just doing static trunking or no trunking at all, the bond might not form, or you’ll get weird flapping.
  • Mismatched LACP Settings: Switch might be in “active” mode, while MikroTik is in some other mode. Usually both sides are “active” for negotiation.
  • Link Speed / Duplex: If your cables or hardware cause one interface to drop to 100Mbps while the other is 1Gbps, you might see subpar performance.
  • Single Flow Limitations: As mentioned, one flow won’t magically get 2 Gbps. LACP load-balances by flow. Keep that in mind for testing or real-world expectations.
  • VLAN / Bridge Confusion: If you have VLANs or bridging on top of the bond, make sure the bridging or VLAN settings are consistent across your devices.

Real-World Use Cases

  1. Core-to-Access Switch Links: Many networks use 2 or 4 ports bonded from access switches to the core for more bandwidth and resiliency.
  2. Server Connectivity: Bond multiple NIC ports from a server or NAS to increase available throughput to the network, helpful for heavy file transfers or virtualization.
  3. Router to Router: If you’re building a direct link between two MikroTiks, you can bond multiple cables for more capacity. Possibly combine it with VRRP or dynamic routing for even more resilience.
  4. Wireless Aggregation: Sometimes folks bond two PtP wireless links if they want double capacity or failover. Just confirm both links can carry similar traffic patterns.

Wrapping Up

LACP bonding is a must-have in modern networks where throughput and uptime are vital. Setting it up on MikroTik is straightforward: create the bond interface, set mode to 802.3ad, add your slave interfaces, and do the matching config on the switch side. Then watch your traffic seamlessly spread across the links.

Experiment with different hashing policies, test link failures, and see how your network reacts. After all, it’s about building confidence that if one cable gets yanked or a port fails, your users hardly notice.

Feel free to reach out if you hit snags with your bonding adventures. As always, I’m thrilled to see your MikroTik skills expanding. Onward to ever faster and more robust networks!


Typed with a dash of enthusiasm by
Emmanuel Corels – Admin, Emmanuel Corels Creatives


Does this help?

« Back