ubuntu:network:bonding_nic_teaming
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ubuntu:network:bonding_nic_teaming [2020/07/15 09:30] – external edit 127.0.0.1 | ubuntu:network:bonding_nic_teaming [2020/08/19 13:49] (current) – removed 192.168.1.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Ubuntu - Networks - Bonding NIC Teaming ====== | ||
- | |||
- | Bonding, also called port trunking or link aggregation means combining several network interfaces (NICs) to a single link, providing either high-availability, | ||
- | |||
- | **WARNING**: | ||
- | |||
- | ---- | ||
- | |||
- | ===== Install required packages ===== | ||
- | |||
- | **ifenslave** is used to attach and detach slave network interfaces to a bonding device. | ||
- | |||
- | <code bash> | ||
- | sudo apt install ifenslave | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Kernel Module ===== | ||
- | |||
- | Before Ubuntu can configure your network cards into a NIC bond, you need to ensure that the correct kernel module **bonding** is present, and loaded at boot time. | ||
- | |||
- | Edit the file: | ||
- | |||
- | <code bash> | ||
- | vim / | ||
- | </ | ||
- | |||
- | Add the word bonding to the file: | ||
- | |||
- | <file bash / | ||
- | bonding | ||
- | </ | ||
- | |||
- | Also, load the module manually for now: | ||
- | |||
- | <code bash> | ||
- | modprobe bonding | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Bonding network config ===== | ||
- | |||
- | Edit the file: | ||
- | |||
- | <code bash> | ||
- | vim / | ||
- | </ | ||
- | |||
- | Example config for an round-robin load balancing setup: | ||
- | |||
- | <file bash / | ||
- | auto lo | ||
- | iface lo inet loopback | ||
- | |||
- | auto eth0 | ||
- | iface eth0 inet manual | ||
- | bond-master bond0 | ||
- | |||
- | auto eth1 | ||
- | iface eth1 inet manual | ||
- | bond-master bond0 | ||
- | |||
- | auto bond0 | ||
- | iface bond0 inet static | ||
- | # For jumbo frames, change mtu to 9000 | ||
- | mtu 1500 | ||
- | address 172.16.20.1 | ||
- | netmask 255.255.255.0 | ||
- | network 172.16.20.0 | ||
- | broadcast 172.16.20.255 | ||
- | gateway 172.16.20.1 | ||
- | dns-nameservers 172.16.20.2 | ||
- | bond-miimon 100 # Specifies the MII link monitoring frequency in milliseconds. This determines how often the link state of each slave is inspected for link failures. | ||
- | bond-downdelay 200 # Specifies the time, in milliseconds, | ||
- | bond-updelay 200 # Specifies the time, in milliseconds, | ||
- | bond-mode 0 | ||
- | bond-slaves none # we already defined the interfaces above with bond-master | ||
- | </ | ||
- | |||
- | For round-robin/ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Bonding modes explained ===== | ||
- | |||
- | ==== Mode 0 - balance-rr ==== | ||
- | |||
- | Round-robin policy: | ||
- | |||
- | ==== Mode 1 - active-backup ==== | ||
- | |||
- | Active-backup policy: | ||
- | |||
- | ==== Mode 2 - balance-xor ==== | ||
- | |||
- | XOR policy: | ||
- | |||
- | ==== Mode 3 - broadcast ==== | ||
- | |||
- | Broadcast policy: | ||
- | |||
- | ==== Mode 4 - 802.3ad ==== | ||
- | |||
- | IEEE 802.3ad Dynamic link aggregation. | ||
- | |||
- | **Prerequisites**: | ||
- | |||
- | * Ethtool support in the base drivers for retrieving the speed and duplex of each slave. | ||
- | * A switch that supports IEEE 802.3ad Dynamic link aggregation (LACP). | ||
- | |||
- | ==== Mode 5 - balance-tlb ==== | ||
- | |||
- | Adaptive transmit load balancing: | ||
- | |||
- | **Prerequisites**: | ||
- | |||
- | * Ethtool support in the base drivers for retrieving the speed of each slave. | ||
- | |||
- | ==== Mode 6 - balance-alb ==== | ||
- | |||
- | Adaptive load balancing: | ||
- | |||
- | ---- | ||
- | |||
- | ===== Sources ===== | ||
- | |||
- | * Documentation on linux network bonding: https:// | ||
- | |||
ubuntu/network/bonding_nic_teaming.1594805433.txt.gz · Last modified: 2020/07/15 09:30 by 127.0.0.1