ubuntu:network:configuration:bonding_nic_teaming
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu:network:configuration:bonding_nic_teaming [2020/08/19 14:08] – 192.168.1.1 | ubuntu:network:configuration:bonding_nic_teaming [2021/01/07 11:21] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Ubuntu - Networks - Configuration - 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, | ||
- | |||
- | <WRAP important> | ||
- | **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^Name^Comment^ | ||
- | |Mode 0|balance-rr|Round-robin policy: | ||
- | |::: | ||
- | |Mode 1|active-backup|Active-backup policy: | ||
- | |:::|:::|A different slave becomes active if, and only if, the active slave fails.| | ||
- | |::: | ||
- | |::: | ||
- | |::: | ||
- | |Mode 2|balance-xor|Transmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count].| | ||
- | |::: | ||
- | |Mode 3|broadcast|Broadcast policy: | ||
- | |::: | ||
- | |Mode 4|802.3ad|IEEE 802.3ad Dynamic link aggregation.| | ||
- | |::: | ||
- | |::: | ||
- | |::: | ||
- | |:::|:::|* 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: | ||
- | |::: | ||
- | |::: | ||
- | |:::|:::|If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.| | ||
- | |::: | ||
- | |:::|:::|* Ethtool support in the base drivers for retrieving the speed of each slave.| | ||
- | |Mode 6|balance-alb|Adaptive load balancing: | ||
- | |::: | ||
- | |::: | ||
- | |||
- | ---- | ||
- | |||
- | ==== 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/configuration/bonding_nic_teaming.1597846102.txt.gz · Last modified: 2020/08/19 14:08 by 192.168.1.1