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
    • Nodes (Network Devices)
    • Links between Network Devices
    • Groups of Lab Objects (Nodes, VLANs, VRFs)
    • Topology Address Pools
    • Optional Configuration Modules
    • Custom Configuration Templates
    • Integrating External Tools
    • netlab Plugins
      • BGP Domains Plugin
      • BGP Sessions Plugin
      • BGP Routing Policies Plugin
      • Host-side Link Bonding
      • Multihop EBGP
      • BGP Network Origination Plugin
      • Check Custom Configuration Templates
      • Build a Leaf-and-Spine Fabric
      • Combining MLAG Redundancy with VXLAN VTEP Functionality
      • Running Multiple Labs on Linux Servers
      • Dealing with Large Amounts of Identical Devices
      • OSPF Area Parameters Plugin
      • VRRP version
      • Zone-Based Firewall plugin
      • Developing Plugins
      • Topology File Transformation
    • Named IP Prefixes
    • Virtualization Providers
    • Topology Components
    • Topology Defaults
    • Hierarchical Dictionaries in netlab YAML files
    • Lab Validation Tests
    • Customize netlab
  • Optional Configuration Modules
  • List of Configuration Modules
  • Virtualization Providers
  • netlab Plugins
    • BGP Domains Plugin
    • BGP Sessions Plugin
    • BGP Routing Policies Plugin
    • Host-side Link Bonding
      • Using the Plugin
      • Examples
    • Multihop EBGP
    • BGP Network Origination Plugin
    • Check Custom Configuration Templates
    • Build a Leaf-and-Spine Fabric
    • Combining MLAG Redundancy with VXLAN VTEP Functionality
    • Running Multiple Labs on Linux Servers
    • Dealing with Large Amounts of Identical Devices
    • OSPF Area Parameters Plugin
    • VRRP version
    • Zone-Based Firewall plugin
    • Developing Plugins
    • Topology File Transformation
  • Topology Defaults
  • 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
  • Lab Topology Reference
  • 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)

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, and other contributors. Powered by Sphinx, sphinx-rtd-theme and sphinx-rtd-dark-mode. Hosted on Cloudflare Pages.

>