netlab

Installation Guides

  • Installation
  • Supported Platforms

Using the Tools

  • Tutorials
  • Lab Topology Overview
  • CLI Overview
  • Addressing Tutorial
  • Defining and Using VRFs
  • External Connectivity

Reference Materials

  • netlab Command Reference
  • Lab Topology Reference
  • List of Configuration Modules
  • netlab Plugins
    • Using Plugins
    • netlab Built-In Plugins
      • BGP Domains Plugin
      • BGP Sessions Plugin
      • BGP Routing Policies Plugin
      • Multihop EBGP
      • BGP Network Origination Plugin
      • OSPF Area Parameters Plugin
      • VRRP version
      • Host-side Link Bonding
      • Zone-Based Firewall plugin
      • Combining MLAG Redundancy with VXLAN VTEP Functionality
      • EVPN Multihoming (EVPN Ethernet Segment)
      • GRE Tunnels
      • WireGuard Tunnels
      • Build a Leaf-and-Spine Fabric
      • Running Multiple Labs on Linux Servers
      • Splitting Topologies Across Multiple Workers
      • Dealing with Large Amounts of Identical Devices
      • Check Custom Configuration Templates
      • Embed Files and Configuration Templates in Lab Topology
      • Kubernetes Cluster in Container Nodes
    • More Information
  • Output Formats
  • Customize netlab

Release Notes

  • Release Notes
  • Platform Caveats

Developers

  • Contributor Guidelines
  • Developing Plugins
  • Implementation Notes
  • Advanced Topics
  • Roadmap Proposals
netlab

Host-side Link Bonding

  • Home
  • netlab Plugins
  • Host-side Link Bonding
  • View page source

Host-side Link Bonding

Linux networking has long supported bonding, the ability to use multiple links simultaneously. Netlab supports bonding with LACP through the lag module; this plugin adds support for the other bonding modes (that don’t require any special configuration on peers).

Warning

You cannot combine this plugin with access- or trunk VLANs on the Linux side. More details…

Table of Contents

  • Using the Plugin

    • Supported attributes

    • Caveats

  • Examples

    • Connect a host to a pair of switches using active-backup bonding

Using the Plugin

  • Add plugin: [ bonding ] to the lab topology.

  • Include the bonding.ifindex attribute in any links that need to be bonded

Supported attributes

The plugin adds the following attributes defined at global, node or interface level:

  • bonding.mode (string, one of active-backup, balance-tlb, or balance-alb) – the bonding mode to use, default active-backup

Additional interface level attributes:

  • bonding.ifindex (int,mandatory) – the interface index for the bonding device; links with matching ifindex are bonded together

  • bonding.primary (bool) – optional flag to mark this interface as primary, default False. If none of the interfaces are marked as primary, the selection is left to the Linux default behavior

Caveats

The plugin uses the ip command to create bond devices and add member links; in case of Linux VMs that are not Ubuntu, the plugin attempts to install this command when not available. This installation uses apt-get which may not work on some Linux VMs

Examples

Connect a host to a pair of switches using active-backup bonding

plugin: [ bonding ]

bonding.mode: active-backup  # Default

vlans:
  v1:

groups:
  _auto_create: True
  hosts:
    members: [ h1 ]
    device: linux
  switches:
    members: [ s1, s2 ]
    module: [ vlan ]

links:
- s1:
  s2:
  vlan.trunk: [ v1 ]

# Bonded interfaces eth1/eth2
- s1:
  h1:
    bonding.ifindex: 1
- s2:
  h1:
    bonding:
      ifindex: 1
      primary: True  # Use this interface as primary

Note how there are no bonding specific modules enabled on the switches

Previous Next

© Copyright 2020–2025 Ivan Pepelnjak, Jeroen van Bemmel, Stefano Sasso, Dan Partelly, and other contributors. Powered by Sphinx, sphinx-rtd-theme and sphinx-rtd-dark-mode. Hosted on Cloudflare Pages.

>