20201110_LACP-ubuntu.jpg

Simple LACP Ubuntu 18.04/20.04 configuration

Intro:

I was struggling with the new netplan configuration options under Ubuntu 18.04 LTS or Ubuntu 20.04.1 LTS. In this post I will you will find to production ready configurationexamples. The first with simple LACP and the second with a bit advanced + VLAN on bond. I hope this configuration will help you guys. Works for me like a charm.

First: To set interfaces up and down use

ip a
ip link set INTERFACE_NAME up
ip link set INTERFACE_NAME down

to configure lacp in ubuntu

sudo vim /etc/netplan/01-lacp.yaml
network:
  ethernets:
    eno1:
      dhcp4: true
    switchports:
      match: eno* # for example if your interfaces are named with eno1np0 and eno2np1
  version: 2
 
  bonds:
    bond0:
      dhcp4: false
      addresses:
        - 192.168.1.3/24
      interfaces:
        - switchports
      parameters:
        mode: 802.3ad
        mii-monitor-interval: 5
        lacp-rate: slow
        min-links: 1

or if you want to setup a VLAN too here or close to production configuration:

network:
  bonds:
    bond0:
      addresses:
        192.168.1.5/24 # Server-IP
      gateway4: 192.168.1.1 # Gateway or Router IP
      interfaces: # Interfaces for LACP / Bonding
        eno1np0
	eno2np1
      nameservers:
        addresses:
	  - 192.168.1.2 # first nameserver
	  - 192.168.1.3 # second nameserver
	search:
	  - YOUR.LOCAL.DOMAIN # If you needed
	parameters:
          lacp-rate: fast
	  mode: 802.3ad
	  transmit-hash-policy: layer2
  ethernets:
    eno1np0: {}
    eno2np1: {}
  version: 2
  vlans:
    bond0.455:
      addresses:
      - 10.59.0.1/24
      id: 455
      link: bond0
      nameservers:
        addresses: []
	search: []

to apply enter sudo netplan apply

tags: ubuntu lacp network