• Logo
    Netplan
  • netplan.io
  • More resources
    • Forum
    • GitHub
Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Netplan documentation
Logo
Netplan documentation
  • Tutorial
    • Netplan tutorial
    • Trying Netplan in a virtual machine
    • Running Netplan for the first time
    • Showing current Netplan configuration
    • Showing current network configuration
    • Checking Netplan configuration files
    • Creating and modifying Netplan configuration
    • Applying new Netplan configuration
  • How-to guides
    • Enable DHCP on an interface
    • Configure a static IP address on an interface
    • Configure DNS servers and search domains
    • Connect multiple interfaces with DHCP
    • Connect to an open wireless network
    • Configure your computer to connect to your home Wi-Fi network
    • Connect to a WPA Personal wireless network without DHCP
    • Connect to WPA Enterprise wireless networks with EAP+TTLS
    • Connect to WPA Enterprise wireless networks with EAP+TLS
    • Use multiple addresses on a single interface
    • Use multiple addresses with multiple gateways
    • Use NetworkManager as a renderer
    • Configure interface bonding
    • Configure multiple bonds
    • Configure network bridges
    • Create a bridge with a VLAN for libvirtd
    • Create VLANs
    • Use a directly connected gateway
    • Configure source routing
    • Configure a loopback interface
    • Integrate with Windows DHCP Server
    • Connect to an IPv6 over IPv4 tunnel
    • Configure SR-IOV Virtual Functions
    • Connect two systems with a WireGuard VPN
    • Connect your home computer to a cloud instance with a WireGuard VPN
    • Change Advertised MSS (‘Maximal Segment Size’) in custom route
    • Use static IP addresses
    • Match the interface by MAC address
    • Create link aggregation
    • Use D-Bus configuration API
    • Integrate Netplan with desktop
    • Configure a VM host with a single network interface
    • Configure a VM host with a single network interface and three VLANs
    • Configure a VM host with bonded network interfaces and three VLANs
    • Contribute documentation
  • Reference
    • YAML configuration
    • libnetplan API
      • parse.h
      • parse-nm.h
      • state.h
      • netdef.h
      • util.h
      • types.h
    • Netplan CLI
      • generate
      • apply
      • try
      • get
      • set
      • info
      • ip
      • rebind
      • status
    • Netplan D-Bus
  • Explanation
    • Introduction to Netplan
    • Netplan Generator
    • NetworkManager default configuration
    • Netplan Design
    • Netplan security
    • Netplan FAQs
Back to top
View this page

How to create link aggregation¶

Note

These instructions assume a system setup based on the example configuration outlined in the Netplan tutorial.

Let’s suppose now that you need to configure your system to connect to your ISP links via a link aggregation. On Linux you can do that with a bond virtual interface.

On Netplan, an interface of type bond can be created inside a bonds mapping.

Now that the traffic will flow through the link aggregation, you will move all the addressing configuration to the bond itself.

You can define a list of interfaces that will be attached to the bond. In our simple scenario, we have a single one.

Edit the file /etc/netplan/second-interface.yaml and make the following changes:

network:
  version: 2
  ethernets:
    netplan-isp-interface:
      dhcp4: false
      dhcp6: false
      match:
        macaddress: 00:16:3e:0c:97:8a
      set-name: netplan-isp
  bonds:
    isp-bond0:
      interfaces:
        - netplan-isp-interface
      dhcp4: false
      dhcp6: false
      accept-ra: false
      link-local: []
      addresses:
        - 172.16.0.1/24
      routes:
        - to: default
          via: 172.16.0.254
      nameservers:
        search:
          - netplanlab.local
        addresses:
          - 172.16.0.254
          - 172.16.0.253

Note that you can reference the interface used in the bond by the name you defined for it in the ethernets section.

Now use netplan apply to apply your changes

netplan apply

Now your system has a new interface called isp-bond0. Use the command ip address show isp-bond0 or netplan status to check its state:

netplan status isp-bond0

You should see an output similar to the one below:

     Online state: online
    DNS Addresses: 127.0.0.53 (stub)
       DNS Search: lxd
                   netplanlab.local

●  4: isp-bond0 bond UP (networkd: isp-bond0)
      MAC Address: b2:6b:19:b1:9a:86
        Addresses: 172.16.0.1/24
    DNS Addresses: 172.16.0.254
                   172.16.0.253
       DNS Search: netplanlab.local
           Routes: default via 172.16.0.254 (static)
                   172.16.0.0/24 from 172.16.0.1 (link)

3 inactive interfaces hidden. Use "--all" to show all.
Copyright © 2025, Netplan team
Last updated on Jan 21, 2025
Show source
Ask a question on Discourse
Ask a question on Mattermost
Open a Launchpad issue for this documentation
Edit this page on GitHub
Contents
  • How to create link aggregation