3

I upgraded to Ubuntu 18.04 and the new Netplan configuration, but my (2) network cards stopped sharing the load evenly. In my network configuration, I have many connections to many different servers; this configuration worked with previous versions of Ubuntu.

My Netplan configuration is below:

network:
ethernets:
    enp0s31f6:
        dhcp4: false
    enp1s0:
        dhcp4: false
version: 2
bonds:
    bond0:
         interfaces: [enp0s31f6,enp1s0]
         addresses: [10.0.10.10/16]
         gateway4: 10.0.0.1
         mtu: 9000
         nameservers:
              addresses: [10.0.0.1]
              search: [mydomain.example.com]
         parameters:
                 mode: 802.3ad
                 lacp-rate: fast
                 mii-monitor-interval: 100

However, ifconfig shows uneven distribution of the network load:

bond0: flags=5187  mtu 9000
    inet 10.0.10.10  netmask 255.255.0.0  broadcast 10.0.255.255
    inet6 fe80::4876:c7ff:fecc:8a73  prefixlen 64  scopeid 0x20
    ether 4a:76:c7:cc:8a:73  txqueuelen 1000  (Ethernet)
    RX packets 7379403761  bytes 11148965732346 (11.1 TB)
    RX errors 0  dropped 168862  overruns 8554  frame 0
    TX packets 504974341  bytes 37356421339 (37.3 GB)
    TX errors 0  dropped 6 overruns 0  carrier 0  collisions 0

enp0s31f6: flags=6211  mtu 9000
        ether 4a:76:c7:cc:8a:73  txqueuelen 1000  (Ethernet)
        RX packets 1251616  bytes 107128982 (107.1 MB)
        RX errors 0  dropped 83864  overruns 0  frame 0
        TX packets 1120861  bytes 238470225 (238.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0x92f00000-92f20000  

enp1s0: flags=6211  mtu 9000
        ether 4a:76:c7:cc:8a:73  txqueuelen 1000  (Ethernet)
        RX packets 7378152145  bytes 11148858603364 (11.1 TB)
        RX errors 0  dropped 0  overruns 8554  frame 0
        TX packets 503853480  bytes 37117951114 (37.1 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0x92e00000-92e1ffff  

Any idea what is wrong with this configuration? Thank you for your help.

Deltik
  • 314
  • 1
  • 4
  • 15
ensnare
  • 2,212
  • 7
  • 24
  • 40
  • 3
    What `xmit_hash_policy` did you set? According to the [kernel documentation](https://www.kernel.org/doc/Documentation/networking/bonding.txt) `layer2` is the default which could explain the *uneven* distribution. Set this to `layer3+4` and test again. – Thomas May 21 '18 at 15:27
  • 1
    What traffic had been disbalanced? Inbound or outbound from server? – Mikhail Khirgiy May 21 '18 at 16:17

1 Answers1

-1

The following configuration work fine for me. Running Ubuntu 18.04 ppc64el. And BTW, if you want to use the REAL interface name instead of something like enp0s31f6, just do the following.

vi /etc/default/grub and add this:

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

Then rebuilt the boot loader

grub-mkconfig -o /boot/grub/grub.vfg

Reboot the system and You'll get the real nic name like eth0, eth1... When it's done, edit this file and make sure it fit with your IP's !!!

vi /etc/netplan/01-netcfg.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      match:
        macaddress: 'xx:xx:xx:xx:xx:xx'
      wakeonlan: true
    eth1:
      match:
        macaddress: 'xx:xx:xx:xx:xx:xx'
      wakeonlan: true
  bonds:
    bond0:
      interfaces: [eth0, eth1]
      addresses: [192.168.0.10/24]
      gateway4: 192.168.0.1
      parameters:
        mode: 802.3ad
        lacp-rate: fast
        mii-monitor-interval: 100
      mtu: 9000
      nameservers:
        search: [home.lan],
        addresses: [192.168.0.250]

Then, type netplan try to validate your configuration. If successful, run netplan apply and reboot.

GuyP
  • 1
  • You cannot do `netplan try` when using bonding... You'll get: `bond0: reverting custom parameters for bridges and bonds is not supported` – Grogi May 31 '20 at 11:13
  • `enp0s31f6` **is** the real interface name, should you like it or not. The suggestion to switch to "old" interface naming is absolutely out of context in this answer (this is not what was asked), and it makes it opnionated, which is not welcomed here. On the other hand, the answer doesn't address the problem of uneven distribution which was raised in the question, it is absolutely useless. – Nikita Kipriyanov Apr 04 '23 at 05:09