mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 09:31:50 +00:00
docs: networking: convert bonding.txt to ReST
- add SPDX header; - adjust titles and chapters, adding proper markups; - comment out text-only TOC from html/pdf output; - mark code blocks and literals as such; - mark tables as such; - add notes markups; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b5fcf32d7d
commit
a362032eca
@ -1,10 +1,15 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
===================================
|
||||
Linux Ethernet Bonding Driver HOWTO
|
||||
===================================
|
||||
|
||||
Latest update: 27 April 2011
|
||||
|
||||
Initial release: Thomas Davis <tadavis at lbl.gov>
|
||||
|
||||
Corrections, HA extensions: 2000/10/03-15:
|
||||
|
||||
- Willy Tarreau <willy at meta-x.org>
|
||||
- Constantine Gavrilov <const-g at xpert.com>
|
||||
- Chad N. Tindel <ctindel at ieee dot org>
|
||||
@ -13,6 +18,7 @@ Corrections, HA extensions : 2000/10/03-15 :
|
||||
|
||||
Reorganized and updated Feb 2005 by Jay Vosburgh
|
||||
Added Sysfs information: 2006/04/24
|
||||
|
||||
- Mitch Williams <mitch.a.williams at intel.com>
|
||||
|
||||
Introduction
|
||||
@ -32,8 +38,7 @@ with this version of the driver.
|
||||
For new versions of the driver, updated userspace tools, and
|
||||
who to ask for help, please follow the links at the end of this file.
|
||||
|
||||
Table of Contents
|
||||
=================
|
||||
.. Table of Contents
|
||||
|
||||
1. Bonding Driver Installation
|
||||
|
||||
@ -127,7 +132,7 @@ to the driver or configure more than one bonding device.
|
||||
Build and install the new kernel and modules.
|
||||
|
||||
1.2 Bonding Control Utility
|
||||
-------------------------------------
|
||||
---------------------------
|
||||
|
||||
It is recommended to configure bonding via iproute2 (netlink)
|
||||
or sysfs, the old ifenslave control utility is obsolete.
|
||||
@ -140,7 +145,7 @@ bonding module at load time, or are specified via sysfs.
|
||||
|
||||
Module options may be given as command line arguments to the
|
||||
insmod or modprobe command, but are usually specified in either the
|
||||
/etc/modprobe.d/*.conf configuration files, or in a distro-specific
|
||||
``/etc/modprobe.d/*.conf`` configuration files, or in a distro-specific
|
||||
configuration file (some of which are detailed in the next section).
|
||||
|
||||
Details on bonding support for sysfs is provided in the
|
||||
@ -246,10 +251,13 @@ ad_user_port_key
|
||||
|
||||
In an AD system, the port-key has three parts as shown below -
|
||||
|
||||
===== ============
|
||||
Bits Use
|
||||
===== ============
|
||||
00 Duplex
|
||||
01-05 Speed
|
||||
06-15 User-defined
|
||||
===== ============
|
||||
|
||||
This defines the upper 10 bits of the port key. The values can be
|
||||
from 0 - 1023. If not given, the system defaults to 0.
|
||||
@ -699,7 +707,7 @@ mode
|
||||
swapped with the new curr_active_slave that was
|
||||
chosen.
|
||||
|
||||
num_grat_arp
|
||||
num_grat_arp,
|
||||
num_unsol_na
|
||||
|
||||
Specify the number of peer notifications (gratuitous ARPs and
|
||||
@ -998,7 +1006,7 @@ Determining this is fairly straightforward.
|
||||
If this file is present in your system, then your system use interfaces. See
|
||||
Configuration with Interfaces Support.
|
||||
|
||||
Else, issue the command:
|
||||
Else, issue the command::
|
||||
|
||||
$ rpm -qf /sbin/ifup
|
||||
|
||||
@ -1007,7 +1015,7 @@ $ rpm -qf /sbin/ifup
|
||||
package that provides your network initialization scripts.
|
||||
|
||||
Next, to determine if your installation supports bonding,
|
||||
issue the command:
|
||||
issue the command::
|
||||
|
||||
$ grep ifenslave /sbin/ifup
|
||||
|
||||
@ -1031,7 +1039,7 @@ yast2 sysconfig configuration utility. The goal is for to create an
|
||||
ifcfg-id file for each slave device. The simplest way to accomplish
|
||||
this is to configure the devices for DHCP (this is only to get the
|
||||
file ifcfg-id file created; see below for some issues with DHCP). The
|
||||
name of the configuration file for each device will be of the form:
|
||||
name of the configuration file for each device will be of the form::
|
||||
|
||||
ifcfg-id-xx:xx:xx:xx:xx:xx
|
||||
|
||||
@ -1042,7 +1050,7 @@ the device's permanent MAC address.
|
||||
created, it is necessary to edit the configuration files for the slave
|
||||
devices (the MAC addresses correspond to those of the slave devices).
|
||||
Before editing, the file will contain multiple lines, and will look
|
||||
something like this:
|
||||
something like this::
|
||||
|
||||
BOOTPROTO='dhcp'
|
||||
STARTMODE='on'
|
||||
@ -1050,7 +1058,7 @@ USERCTL='no'
|
||||
UNIQUE='XNzu.WeZGOGF+4wE'
|
||||
_nm_name='bus-pci-0001:61:01.0'
|
||||
|
||||
Change the BOOTPROTO and STARTMODE lines to the following:
|
||||
Change the BOOTPROTO and STARTMODE lines to the following::
|
||||
|
||||
BOOTPROTO='none'
|
||||
STARTMODE='off'
|
||||
@ -1066,7 +1074,7 @@ ifcfg-bond0, the second is ifcfg-bond1, and so on. The sysconfig
|
||||
network configuration system will correctly start multiple instances
|
||||
of bonding.
|
||||
|
||||
The contents of the ifcfg-bondX file is as follows:
|
||||
The contents of the ifcfg-bondX file is as follows::
|
||||
|
||||
BOOTPROTO="static"
|
||||
BROADCAST="10.0.2.255"
|
||||
@ -1086,18 +1094,21 @@ values with the appropriate values for your network.
|
||||
The STARTMODE specifies when the device is brought online.
|
||||
The possible values are:
|
||||
|
||||
onboot: The device is started at boot time. If you're not
|
||||
======== ======================================================
|
||||
onboot The device is started at boot time. If you're not
|
||||
sure, this is probably what you want.
|
||||
|
||||
manual: The device is started only when ifup is called
|
||||
manual The device is started only when ifup is called
|
||||
manually. Bonding devices may be configured this
|
||||
way if you do not wish them to start automatically
|
||||
at boot for some reason.
|
||||
|
||||
hotplug: The device is started by a hotplug event. This is not
|
||||
hotplug The device is started by a hotplug event. This is not
|
||||
a valid choice for a bonding device.
|
||||
|
||||
off or ignore: The device configuration is ignored.
|
||||
off or The device configuration is ignored.
|
||||
ignore
|
||||
======== ======================================================
|
||||
|
||||
The line BONDING_MASTER='yes' indicates that the device is a
|
||||
bonding master device. The only useful value is "yes."
|
||||
@ -1122,7 +1133,7 @@ configurations will choose one or the other for all slave devices.
|
||||
|
||||
When all configuration files have been modified or created,
|
||||
networking must be restarted for the configuration changes to take
|
||||
effect. This can be accomplished via the following:
|
||||
effect. This can be accomplished via the following::
|
||||
|
||||
# /etc/init.d/network restart
|
||||
|
||||
@ -1137,11 +1148,11 @@ devices). It is necessary to edit the configuration file by hand to
|
||||
change the bonding configuration.
|
||||
|
||||
Additional general options and details of the ifcfg file
|
||||
format can be found in an example ifcfg template file:
|
||||
format can be found in an example ifcfg template file::
|
||||
|
||||
/etc/sysconfig/network/ifcfg.template
|
||||
|
||||
Note that the template does not document the various BONDING_
|
||||
Note that the template does not document the various ``BONDING_*``
|
||||
settings described above, but does describe many of the other options.
|
||||
|
||||
3.1.1 Using DHCP with Sysconfig
|
||||
@ -1167,7 +1178,7 @@ ifcfg-bondX files.
|
||||
|
||||
Because the sysconfig scripts supply the bonding module
|
||||
options in the ifcfg-bondX file, it is not necessary to add them to
|
||||
the system /etc/modules.d/*.conf configuration files.
|
||||
the system ``/etc/modules.d/*.conf`` configuration files.
|
||||
|
||||
3.2 Configuration with Initscripts Support
|
||||
------------------------------------------
|
||||
@ -1191,7 +1202,7 @@ a bondX link. Network script files are located in the directory:
|
||||
The file name must be prefixed with "ifcfg-eth" and suffixed
|
||||
with the adapter's physical adapter number. For example, the script
|
||||
for eth0 would be named /etc/sysconfig/network-scripts/ifcfg-eth0.
|
||||
Place the following text in the file:
|
||||
Place the following text in the file::
|
||||
|
||||
DEVICE=eth0
|
||||
USERCTL=no
|
||||
@ -1212,7 +1223,7 @@ second is bond1, and so on.
|
||||
script will be /etc/sysconfig/network-scripts/ifcfg-bondX where X is
|
||||
the number of the bond. For bond0 the file is named "ifcfg-bond0",
|
||||
for bond1 it is named "ifcfg-bond1", and so on. Within that file,
|
||||
place the following text:
|
||||
place the following text::
|
||||
|
||||
DEVICE=bond0
|
||||
IPADDR=192.168.1.1
|
||||
@ -1229,7 +1240,7 @@ NETMASK, NETWORK and BROADCAST) to match your network configuration.
|
||||
For later versions of initscripts, such as that found with Fedora
|
||||
7 (or later) and Red Hat Enterprise Linux version 5 (or later), it is possible,
|
||||
and, indeed, preferable, to specify the bonding options in the ifcfg-bond0
|
||||
file, e.g. a line of the format:
|
||||
file, e.g. a line of the format::
|
||||
|
||||
BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=192.168.1.254"
|
||||
|
||||
@ -1239,12 +1250,13 @@ except for the arp_ip_target field when using versions of initscripts older
|
||||
than and 8.57 (Fedora 8) and 8.45.19 (Red Hat Enterprise Linux 5.2). When
|
||||
using older versions each target should be included as a separate option and
|
||||
should be preceded by a '+' to indicate it should be added to the list of
|
||||
queried targets, e.g.,
|
||||
queried targets, e.g.,::
|
||||
|
||||
arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2
|
||||
|
||||
is the proper syntax to specify multiple targets. When specifying
|
||||
options via BONDING_OPTS, it is not necessary to edit /etc/modprobe.d/*.conf.
|
||||
options via BONDING_OPTS, it is not necessary to edit
|
||||
``/etc/modprobe.d/*.conf``.
|
||||
|
||||
For even older versions of initscripts that do not support
|
||||
BONDING_OPTS, it is necessary to edit /etc/modprobe.d/*.conf, depending upon
|
||||
@ -1305,7 +1317,7 @@ the global init script differs; for sysconfig, it is
|
||||
For example, if you wanted to make a simple bond of two e100
|
||||
devices (presumed to be eth0 and eth1), and have it persist across
|
||||
reboots, edit the appropriate file (/etc/init.d/boot.local or
|
||||
/etc/rc.d/rc.local), and add the following:
|
||||
/etc/rc.d/rc.local), and add the following::
|
||||
|
||||
modprobe bonding mode=balance-alb miimon=100
|
||||
modprobe e100
|
||||
@ -1319,11 +1331,11 @@ values for your configuration.
|
||||
|
||||
Unfortunately, this method will not provide support for the
|
||||
ifup and ifdown scripts on the bond devices. To reload the bonding
|
||||
configuration, it is necessary to run the initialization script, e.g.,
|
||||
configuration, it is necessary to run the initialization script, e.g.,::
|
||||
|
||||
# /etc/init.d/boot.local
|
||||
|
||||
or
|
||||
or::
|
||||
|
||||
# /etc/rc.d/rc.local
|
||||
|
||||
@ -1335,7 +1347,7 @@ enabled without re-running the entire global init script.
|
||||
To shut down the bonding devices, it is necessary to first
|
||||
mark the bonding device itself as being down, then remove the
|
||||
appropriate device driver modules. For our example above, you can do
|
||||
the following:
|
||||
the following::
|
||||
|
||||
# ifconfig bond0 down
|
||||
# rmmod bonding
|
||||
@ -1372,7 +1384,7 @@ network initialization scripts.
|
||||
specify a different name for each instance (the module loading system
|
||||
requires that every loaded module, even multiple instances of the same
|
||||
module, have a unique name). This is accomplished by supplying multiple
|
||||
sets of bonding options in /etc/modprobe.d/*.conf, for example:
|
||||
sets of bonding options in ``/etc/modprobe.d/*.conf``, for example::
|
||||
|
||||
alias bond0 bonding
|
||||
options bond0 -o bond0 mode=balance-rr miimon=100
|
||||
@ -1388,7 +1400,7 @@ bond1 device in balance-alb mode with an miimon of 50.
|
||||
In some circumstances (typically with older distributions),
|
||||
the above does not work, and the second bonding instance never sees
|
||||
its options. In that case, the second options line can be substituted
|
||||
as follows:
|
||||
as follows::
|
||||
|
||||
install bond1 /sbin/modprobe --ignore-install bonding -o bond1 \
|
||||
mode=balance-alb miimon=50
|
||||
@ -1426,16 +1438,21 @@ example paths accordingly.
|
||||
|
||||
Creating and Destroying Bonds
|
||||
-----------------------------
|
||||
To add a new bond foo:
|
||||
To add a new bond foo::
|
||||
|
||||
# echo +foo > /sys/class/net/bonding_masters
|
||||
|
||||
To remove an existing bond bar:
|
||||
To remove an existing bond bar::
|
||||
|
||||
# echo -bar > /sys/class/net/bonding_masters
|
||||
|
||||
To show all existing bonds:
|
||||
To show all existing bonds::
|
||||
|
||||
# cat /sys/class/net/bonding_masters
|
||||
|
||||
NOTE: due to 4K size limitation of sysfs files, this list may be
|
||||
.. note::
|
||||
|
||||
due to 4K size limitation of sysfs files, this list may be
|
||||
truncated if you have more than a few hundred bonds. This is unlikely
|
||||
to occur under normal operating conditions.
|
||||
|
||||
@ -1445,11 +1462,13 @@ Adding and Removing Slaves
|
||||
/sys/class/net/<bond>/bonding/slaves. The semantics for this file
|
||||
are the same as for the bonding_masters file.
|
||||
|
||||
To enslave interface eth0 to bond bond0:
|
||||
To enslave interface eth0 to bond bond0::
|
||||
|
||||
# ifconfig bond0 up
|
||||
# echo +eth0 > /sys/class/net/bond0/bonding/slaves
|
||||
|
||||
To free slave eth0 from bond bond0:
|
||||
To free slave eth0 from bond bond0::
|
||||
|
||||
# echo -eth0 > /sys/class/net/bond0/bonding/slaves
|
||||
|
||||
When an interface is enslaved to a bond, symlinks between the
|
||||
@ -1477,30 +1496,46 @@ current setting, simply cat the appropriate file.
|
||||
guidelines for each parameter, see the appropriate section in this
|
||||
document.
|
||||
|
||||
To configure bond0 for balance-alb mode:
|
||||
To configure bond0 for balance-alb mode::
|
||||
|
||||
# ifconfig bond0 down
|
||||
# echo 6 > /sys/class/net/bond0/bonding/mode
|
||||
- or -
|
||||
# echo balance-alb > /sys/class/net/bond0/bonding/mode
|
||||
NOTE: The bond interface must be down before the mode can be
|
||||
changed.
|
||||
|
||||
To enable MII monitoring on bond0 with a 1 second interval:
|
||||
.. note::
|
||||
|
||||
The bond interface must be down before the mode can be changed.
|
||||
|
||||
To enable MII monitoring on bond0 with a 1 second interval::
|
||||
|
||||
# echo 1000 > /sys/class/net/bond0/bonding/miimon
|
||||
NOTE: If ARP monitoring is enabled, it will disabled when MII
|
||||
|
||||
.. note::
|
||||
|
||||
If ARP monitoring is enabled, it will disabled when MII
|
||||
monitoring is enabled, and vice-versa.
|
||||
|
||||
To add ARP targets:
|
||||
To add ARP targets::
|
||||
|
||||
# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||
# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||
NOTE: up to 16 target addresses may be specified.
|
||||
|
||||
To remove an ARP target:
|
||||
.. note::
|
||||
|
||||
up to 16 target addresses may be specified.
|
||||
|
||||
To remove an ARP target::
|
||||
|
||||
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||
|
||||
To configure the interval between learning packet transmits:
|
||||
To configure the interval between learning packet transmits::
|
||||
|
||||
# echo 12 > /sys/class/net/bond0/bonding/lp_interval
|
||||
NOTE: the lp_interval is the number of seconds between instances where
|
||||
|
||||
.. note::
|
||||
|
||||
the lp_interval is the number of seconds between instances where
|
||||
the bonding driver sends learning packets to each slaves peer switch. The
|
||||
default interval is 1 second.
|
||||
|
||||
@ -1512,7 +1547,7 @@ executed with sysfs, and without using ifenslave.
|
||||
To make a simple bond of two e100 devices (presumed to be eth0
|
||||
and eth1), and have it persist across reboots, edit the appropriate
|
||||
file (/etc/init.d/boot.local or /etc/rc.d/rc.local), and add the
|
||||
following:
|
||||
following::
|
||||
|
||||
modprobe bonding
|
||||
modprobe e100
|
||||
@ -1524,7 +1559,7 @@ echo +eth1 > /sys/class/net/bond0/bonding/slaves
|
||||
|
||||
To add a second bond, with two e1000 interfaces in
|
||||
active-backup mode, using ARP monitoring, add the following lines to
|
||||
your init script:
|
||||
your init script::
|
||||
|
||||
modprobe e1000
|
||||
echo +bond1 > /sys/class/net/bonding_masters
|
||||
@ -1544,8 +1579,8 @@ derivatives.
|
||||
|
||||
The ifup and ifdown commands on Debian don't support bonding out of
|
||||
the box. The ifenslave-2.6 package should be installed to provide bonding
|
||||
support. Once installed, this package will provide bond-* options to be used
|
||||
into /etc/network/interfaces.
|
||||
support. Once installed, this package will provide ``bond-*`` options
|
||||
to be used into /etc/network/interfaces.
|
||||
|
||||
Note that ifenslave-2.6 package will load the bonding module and use
|
||||
the ifenslave command when appropriate.
|
||||
@ -1554,7 +1589,7 @@ Example Configurations
|
||||
----------------------
|
||||
|
||||
In /etc/network/interfaces, the following stanza will configure bond0, in
|
||||
active-backup mode, with eth0 and eth1 as slaves.
|
||||
active-backup mode, with eth0 and eth1 as slaves::
|
||||
|
||||
auto bond0
|
||||
iface bond0 inet dhcp
|
||||
@ -1566,7 +1601,7 @@ iface bond0 inet dhcp
|
||||
If the above configuration doesn't work, you might have a system using
|
||||
upstart for system startup. This is most notably true for recent
|
||||
Ubuntu versions. The following stanza in /etc/network/interfaces will
|
||||
produce the same result on those systems.
|
||||
produce the same result on those systems::
|
||||
|
||||
auto bond0
|
||||
iface bond0 inet dhcp
|
||||
@ -1584,8 +1619,8 @@ iface eth1 inet manual
|
||||
bond-master bond0
|
||||
bond-primary eth0 eth1
|
||||
|
||||
For a full list of bond-* supported options in /etc/network/interfaces and some
|
||||
more advanced examples tailored to you particular distros, see the files in
|
||||
For a full list of ``bond-*`` supported options in /etc/network/interfaces and
|
||||
some more advanced examples tailored to you particular distros, see the files in
|
||||
/usr/share/doc/ifenslave-2.6.
|
||||
|
||||
3.6 Overriding Configuration for Special Cases
|
||||
@ -1610,7 +1645,7 @@ tx_queues can be used to change this value. There is no sysfs parameter
|
||||
available as the allocation is done at module init time.
|
||||
|
||||
The output of the file /proc/net/bonding/bondX has changed so the output Queue
|
||||
ID is now printed for each slave:
|
||||
ID is now printed for each slave::
|
||||
|
||||
Bonding Mode: fault-tolerance (active-backup)
|
||||
Primary Slave: None
|
||||
@ -1632,7 +1667,7 @@ Link Failure Count: 0
|
||||
Permanent HW addr: 00:1a:a0:12:8f:cc
|
||||
Slave queue ID: 2
|
||||
|
||||
The queue_id for a slave can be set using the command:
|
||||
The queue_id for a slave can be set using the command::
|
||||
|
||||
# echo "eth1:2" > /sys/class/net/bond0/bonding/queue_id
|
||||
|
||||
@ -1645,12 +1680,12 @@ These queue id's can be used in conjunction with the tc utility to configure
|
||||
a multiqueue qdisc and filters to bias certain traffic to transmit on certain
|
||||
slave devices. For instance, say we wanted, in the above configuration to
|
||||
force all traffic bound to 192.168.1.100 to use eth1 in the bond as its output
|
||||
device. The following commands would accomplish this:
|
||||
device. The following commands would accomplish this::
|
||||
|
||||
# tc qdisc add dev bond0 handle 1 root multiq
|
||||
|
||||
# tc filter add dev bond0 protocol ip parent 1: prio 1 u32 match ip dst \
|
||||
192.168.1.100 action skbedit queue_mapping 2
|
||||
# tc filter add dev bond0 protocol ip parent 1: prio 1 u32 match ip \
|
||||
dst 192.168.1.100 action skbedit queue_mapping 2
|
||||
|
||||
These commands tell the kernel to attach a multiqueue queue discipline to the
|
||||
bond0 interface and filter traffic enqueued to it, such that packets with a dst
|
||||
@ -1689,7 +1724,7 @@ few bonding parameters:
|
||||
(a) ad_actor_system : You can set a random mac-address that can be used for
|
||||
these LACPDU exchanges. The value can not be either NULL or Multicast.
|
||||
Also it's preferable to set the local-admin bit. Following shell code
|
||||
generates a random mac-address as described above.
|
||||
generates a random mac-address as described above::
|
||||
|
||||
# sys_mac_addr=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
|
||||
$(( (RANDOM & 0xFE) | 0x02 )) \
|
||||
@ -1702,7 +1737,7 @@ few bonding parameters:
|
||||
|
||||
(b) ad_actor_sys_prio : Randomize the system priority. The default value
|
||||
is 65535, but system can take the value from 1 - 65535. Following shell
|
||||
code generates random priority and sets it.
|
||||
code generates random priority and sets it::
|
||||
|
||||
# sys_prio=$(( 1 + RANDOM + RANDOM ))
|
||||
# echo $sys_prio > /sys/class/net/bond0/bonding/ad_actor_sys_prio
|
||||
@ -1710,7 +1745,7 @@ few bonding parameters:
|
||||
(c) ad_user_port_key : Use the user portion of the port-key. The default
|
||||
keeps this empty. These are the upper 10 bits of the port-key and value
|
||||
ranges from 0 - 1023. Following shell code generates these 10 bits and
|
||||
sets it.
|
||||
sets it::
|
||||
|
||||
# usr_port_key=$(( RANDOM & 0x3FF ))
|
||||
# echo $usr_port_key > /sys/class/net/bond0/bonding/ad_user_port_key
|
||||
@ -1728,7 +1763,7 @@ about the bonding configuration, options and state of each slave.
|
||||
|
||||
For example, the contents of /proc/net/bonding/bond0 after the
|
||||
driver is loaded with parameters of mode=0 and miimon=1000 is
|
||||
generally as follows:
|
||||
generally as follows::
|
||||
|
||||
Ethernet Channel Bonding Driver: 2.6.1 (October 29, 2004)
|
||||
Bonding Mode: load balancing (round-robin)
|
||||
@ -1760,7 +1795,7 @@ contain information on which slaves are associated with which masters.
|
||||
In the example below, the bond0 interface is the master
|
||||
(MASTER) while eth0 and eth1 are slaves (SLAVE). Notice all slaves of
|
||||
bond0 have the same MAC address (HWaddr) as bond0 for all modes except
|
||||
TLB and ALB that require a unique MAC address for each slave.
|
||||
TLB and ALB that require a unique MAC address for each slave::
|
||||
|
||||
# /sbin/ifconfig
|
||||
bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
|
||||
@ -1907,13 +1942,13 @@ down or have a problem making it unresponsive to ARP requests. Having
|
||||
an additional target (or several) increases the reliability of the ARP
|
||||
monitoring.
|
||||
|
||||
Multiple ARP targets must be separated by commas as follows:
|
||||
Multiple ARP targets must be separated by commas as follows::
|
||||
|
||||
# example options for ARP monitoring with three targets
|
||||
alias bond0 bonding
|
||||
options bond0 arp_interval=60 arp_ip_target=192.168.0.1,192.168.0.3,192.168.0.9
|
||||
|
||||
For just a single target the options would resemble:
|
||||
For just a single target the options would resemble::
|
||||
|
||||
# example options for ARP monitoring with one target
|
||||
alias bond0 bonding
|
||||
@ -1956,7 +1991,7 @@ up.
|
||||
devices not have routes that supersede routes of the master (or,
|
||||
generally, not have routes at all). For example, suppose the bonding
|
||||
device bond0 has two slaves, eth0 and eth1, and the routing table is
|
||||
as follows:
|
||||
as follows::
|
||||
|
||||
Kernel IP routing table
|
||||
Destination Gateway Genmask Flags MSS Window irtt Iface
|
||||
@ -1993,7 +2028,7 @@ that the same physical device always has the same "ethX" name), it may
|
||||
be necessary to add some special logic to config files in
|
||||
/etc/modprobe.d/.
|
||||
|
||||
For example, given a modules.conf containing the following:
|
||||
For example, given a modules.conf containing the following::
|
||||
|
||||
alias bond0 bonding
|
||||
options bond0 mode=some-mode miimon=50
|
||||
@ -2010,7 +2045,7 @@ when the e1000 driver loads, it will receive eth0 and eth1 for its
|
||||
devices, but the bonding configuration tries to enslave eth2 and eth3
|
||||
(which may later be assigned to the tg3 devices).
|
||||
|
||||
Adding the following:
|
||||
Adding the following::
|
||||
|
||||
add above bonding e1000 tg3
|
||||
|
||||
@ -2020,7 +2055,7 @@ modules.conf manual page.
|
||||
|
||||
On systems utilizing modprobe an equivalent problem can occur.
|
||||
In this case, the following can be added to config files in
|
||||
/etc/modprobe.d/ as:
|
||||
/etc/modprobe.d/ as::
|
||||
|
||||
softdep bonding pre: tg3 e1000
|
||||
|
||||
@ -2070,6 +2105,8 @@ with the eth0 interface. This configuration is shown below, the IP
|
||||
address 192.168.1.1 has an interface index of 2 which indexes to eth0
|
||||
in the ifDescr table (ifDescr.2).
|
||||
|
||||
::
|
||||
|
||||
interfaces.ifTable.ifEntry.ifDescr.1 = lo
|
||||
interfaces.ifTable.ifEntry.ifDescr.2 = eth0
|
||||
interfaces.ifTable.ifEntry.ifDescr.3 = eth1
|
||||
@ -2161,7 +2198,7 @@ network changes dramatically. In multiple switch topologies, there is
|
||||
a trade off between network availability and usable bandwidth.
|
||||
|
||||
Below is a sample network, configured to maximize the
|
||||
availability of the network:
|
||||
availability of the network::
|
||||
|
||||
| |
|
||||
|port3 port3|
|
||||
@ -2188,14 +2225,16 @@ broadcast modes are the only useful bonding modes when optimizing for
|
||||
availability; the other modes require all links to terminate on the
|
||||
same peer for them to behave rationally.
|
||||
|
||||
active-backup: This is generally the preferred mode, particularly if
|
||||
active-backup:
|
||||
This is generally the preferred mode, particularly if
|
||||
the switches have an ISL and play together well. If the
|
||||
network configuration is such that one switch is specifically
|
||||
a backup switch (e.g., has lower capacity, higher cost, etc),
|
||||
then the primary option can be used to insure that the
|
||||
preferred link is always used when it is available.
|
||||
|
||||
broadcast: This mode is really a special purpose mode, and is suitable
|
||||
broadcast:
|
||||
This mode is really a special purpose mode, and is suitable
|
||||
only for very specific needs. For example, if the two
|
||||
switches are not connected (no ISL), and the networks beyond
|
||||
them are totally independent. In this case, if it is
|
||||
@ -2249,7 +2288,7 @@ categorize them into either "gatewayed" or "local" configurations.
|
||||
|
||||
In a gatewayed configuration, the "switch" is acting primarily
|
||||
as a router, and the majority of traffic passes through this router to
|
||||
other networks. An example would be the following:
|
||||
other networks. An example would be the following::
|
||||
|
||||
|
||||
+----------+ +----------+
|
||||
@ -2277,7 +2316,7 @@ beyond the gateway.
|
||||
In a local configuration, the "switch" is acting primarily as
|
||||
a switch, and the majority of traffic passes through this switch to
|
||||
reach other stations on the same network. An example would be the
|
||||
following:
|
||||
following::
|
||||
|
||||
+----------+ +----------+ +--------+
|
||||
| |eth0 port1| +-------+ Host B |
|
||||
@ -2313,7 +2352,8 @@ mode is described below.
|
||||
although you will have to decide which bonding mode best suits your
|
||||
needs. The trade offs for each mode are detailed below:
|
||||
|
||||
balance-rr: This mode is the only mode that will permit a single
|
||||
balance-rr:
|
||||
This mode is the only mode that will permit a single
|
||||
TCP/IP connection to stripe traffic across multiple
|
||||
interfaces. It is therefore the only mode that will allow a
|
||||
single TCP/IP stream to utilize more than one interface's
|
||||
@ -2351,7 +2391,8 @@ balance-rr: This mode is the only mode that will permit a single
|
||||
This mode requires the switch to have the appropriate ports
|
||||
configured for "etherchannel" or "trunking."
|
||||
|
||||
active-backup: There is not much advantage in this network topology to
|
||||
active-backup:
|
||||
There is not much advantage in this network topology to
|
||||
the active-backup mode, as the inactive backup devices are all
|
||||
connected to the same peer as the primary. In this case, a
|
||||
load balancing mode (with link monitoring) will provide the
|
||||
@ -2361,7 +2402,8 @@ active-backup: There is not much advantage in this network topology to
|
||||
have value if the hardware available does not support any of
|
||||
the load balance modes.
|
||||
|
||||
balance-xor: This mode will limit traffic such that packets destined
|
||||
balance-xor:
|
||||
This mode will limit traffic such that packets destined
|
||||
for specific peers will always be sent over the same
|
||||
interface. Since the destination is determined by the MAC
|
||||
addresses involved, this mode works best in a "local" network
|
||||
@ -2373,10 +2415,12 @@ balance-xor: This mode will limit traffic such that packets destined
|
||||
As with balance-rr, the switch ports need to be configured for
|
||||
"etherchannel" or "trunking."
|
||||
|
||||
broadcast: Like active-backup, there is not much advantage to this
|
||||
broadcast:
|
||||
Like active-backup, there is not much advantage to this
|
||||
mode in this type of network topology.
|
||||
|
||||
802.3ad: This mode can be a good choice for this type of network
|
||||
802.3ad:
|
||||
This mode can be a good choice for this type of network
|
||||
topology. The 802.3ad mode is an IEEE standard, so all peers
|
||||
that implement 802.3ad should interoperate well. The 802.3ad
|
||||
protocol includes automatic configuration of the aggregates,
|
||||
@ -2404,7 +2448,8 @@ broadcast: Like active-backup, there is not much advantage to this
|
||||
Finally, the 802.3ad mode mandates the use of the MII monitor,
|
||||
therefore, the ARP monitor is not available in this mode.
|
||||
|
||||
balance-tlb: The balance-tlb mode balances outgoing traffic by peer.
|
||||
balance-tlb:
|
||||
The balance-tlb mode balances outgoing traffic by peer.
|
||||
Since the balancing is done according to MAC address, in a
|
||||
"gatewayed" configuration (as described above), this mode will
|
||||
send all traffic across a single device. However, in a
|
||||
@ -2422,7 +2467,8 @@ balance-tlb: The balance-tlb mode balances outgoing traffic by peer.
|
||||
network device driver of the slave interfaces, and the ARP
|
||||
monitor is not available.
|
||||
|
||||
balance-alb: This mode is everything that balance-tlb is, and more.
|
||||
balance-alb:
|
||||
This mode is everything that balance-tlb is, and more.
|
||||
It has all of the features (and restrictions) of balance-tlb,
|
||||
and will also balance incoming traffic from local network
|
||||
peers (as described in the Bonding Module Options section,
|
||||
@ -2446,7 +2492,7 @@ assurance as the ARP monitor).
|
||||
|
||||
Multiple switches may be utilized to optimize for throughput
|
||||
when they are configured in parallel as part of an isolated network
|
||||
between two or more systems, for example:
|
||||
between two or more systems, for example::
|
||||
|
||||
+-----------+
|
||||
| Host A |
|
||||
@ -2551,7 +2597,7 @@ a "ping" to some other host on the network, and noticing that the
|
||||
output from ping flags duplicates (typically one per slave).
|
||||
|
||||
For example, on a bond in active-backup mode with five slaves
|
||||
all connected to one switch, the output may appear as follows:
|
||||
all connected to one switch, the output may appear as follows::
|
||||
|
||||
# ping -n 10.0.4.2
|
||||
PING 10.0.4.2 (10.0.4.2) from 10.0.3.10 : 56(84) bytes of data.
|
||||
@ -2616,8 +2662,8 @@ network topology in order to function; these are detailed below.
|
||||
Additional BladeCenter-specific networking information can be
|
||||
found in two IBM Redbooks (www.ibm.com/redbooks):
|
||||
|
||||
"IBM eServer BladeCenter Networking Options"
|
||||
"IBM eServer BladeCenter Layer 2-7 Network Switching"
|
||||
- "IBM eServer BladeCenter Networking Options"
|
||||
- "IBM eServer BladeCenter Layer 2-7 Network Switching"
|
||||
|
||||
BladeCenter networking configuration
|
||||
------------------------------------
|
||||
@ -2694,11 +2740,13 @@ avoid fail-over delay issues when using bonding.
|
||||
==============================
|
||||
|
||||
1. Is it SMP safe?
|
||||
-------------------
|
||||
|
||||
Yes. The old 2.0.xx channel bonding patch was not SMP safe.
|
||||
The new driver was designed to be SMP safe from the start.
|
||||
|
||||
2. What type of cards will work with it?
|
||||
-----------------------------------------
|
||||
|
||||
Any Ethernet type cards (you can even mix cards - a Intel
|
||||
EtherExpress PRO/100 and a 3com 3c905b, for example). For most modes,
|
||||
@ -2708,16 +2756,19 @@ devices need not be of the same speed.
|
||||
slaves in active-backup mode.
|
||||
|
||||
3. How many bonding devices can I have?
|
||||
----------------------------------------
|
||||
|
||||
There is no limit.
|
||||
|
||||
4. How many slaves can a bonding device have?
|
||||
----------------------------------------------
|
||||
|
||||
This is limited only by the number of network interfaces Linux
|
||||
supports and/or the number of network cards you can place in your
|
||||
system.
|
||||
|
||||
5. What happens when a slave link dies?
|
||||
----------------------------------------
|
||||
|
||||
If link monitoring is enabled, then the failing device will be
|
||||
disabled. The active-backup mode will fail over to a backup link, and
|
||||
@ -2740,10 +2791,12 @@ resulting degradation of performance. The precise performance loss
|
||||
depends upon the bonding mode and network configuration.
|
||||
|
||||
6. Can bonding be used for High Availability?
|
||||
----------------------------------------------
|
||||
|
||||
Yes. See the section on High Availability for details.
|
||||
|
||||
7. Which switches/systems does it work with?
|
||||
---------------------------------------------
|
||||
|
||||
The full answer to this depends upon the desired mode.
|
||||
|
||||
@ -2764,6 +2817,7 @@ switches currently available support 802.3ad.
|
||||
The active-backup mode should work with any Layer-II switch.
|
||||
|
||||
8. Where does a bonding device get its MAC address from?
|
||||
---------------------------------------------------------
|
||||
|
||||
When using slave devices that have fixed MAC addresses, or when
|
||||
the fail_over_mac option is enabled, the bonding device's MAC address is
|
||||
@ -2776,14 +2830,14 @@ slaves and remains persistent (even if the first slave is removed) until
|
||||
the bonding device is brought down or reconfigured.
|
||||
|
||||
If you wish to change the MAC address, you can set it with
|
||||
ifconfig or ip link:
|
||||
ifconfig or ip link::
|
||||
|
||||
# ifconfig bond0 hw ether 00:11:22:33:44:55
|
||||
|
||||
# ip link set bond0 address 66:77:88:99:aa:bb
|
||||
|
||||
The MAC address can be also changed by bringing down/up the
|
||||
device and then changing its slaves (or their order):
|
||||
device and then changing its slaves (or their order)::
|
||||
|
||||
# ifconfig bond0 down ; modprobe -r bonding
|
||||
# ifconfig bond0 .... up
|
||||
@ -2793,7 +2847,7 @@ device and then changing its slaves (or their order):
|
||||
slave that is added.
|
||||
|
||||
To restore your slaves' MAC addresses, you need to detach them
|
||||
from the bond (`ifenslave -d bond0 eth0'). The bonding driver will
|
||||
from the bond (``ifenslave -d bond0 eth0``). The bonding driver will
|
||||
then restore the MAC addresses that the slaves had before they were
|
||||
enslaved.
|
||||
|
||||
@ -2804,7 +2858,7 @@ enslaved.
|
||||
version of the linux kernel, found on http://kernel.org
|
||||
|
||||
The latest version of this document can be found in the latest kernel
|
||||
source (named Documentation/networking/bonding.txt).
|
||||
source (named Documentation/networking/bonding.rst).
|
||||
|
||||
Discussions regarding the usage of the bonding driver take place on the
|
||||
bonding-devel mailing list, hosted at sourceforge.net. If you have questions or
|
||||
@ -2829,9 +2883,8 @@ be found at:
|
||||
http://vger.kernel.org/vger-lists.html#netdev
|
||||
|
||||
Donald Becker's Ethernet Drivers and diag programs may be found at :
|
||||
- http://web.archive.org/web/*/http://www.scyld.com/network/
|
||||
|
||||
- http://web.archive.org/web/%2E/http://www.scyld.com/network/
|
||||
|
||||
You will also find a lot of information regarding Ethernet, NWay, MII,
|
||||
etc. at www.scyld.com.
|
||||
|
||||
-- END --
|
@ -33,7 +33,7 @@ The following features are now available in supported kernels:
|
||||
- SNMP
|
||||
|
||||
Channel Bonding documentation can be found in the Linux kernel source:
|
||||
/Documentation/networking/bonding.txt
|
||||
/Documentation/networking/bonding.rst
|
||||
|
||||
|
||||
Identifying Your Adapter
|
||||
|
@ -37,7 +37,7 @@ The following features are available in this kernel:
|
||||
- SNMP
|
||||
|
||||
Channel Bonding documentation can be found in the Linux kernel source:
|
||||
/Documentation/networking/bonding.txt
|
||||
/Documentation/networking/bonding.rst
|
||||
|
||||
The driver information previously displayed in the /proc filesystem is not
|
||||
supported in this release. Alternatively, you can use ethtool (version 1.6
|
||||
|
@ -44,6 +44,7 @@ Contents:
|
||||
atm
|
||||
ax25
|
||||
baycom
|
||||
bonding
|
||||
|
||||
.. only:: subproject and html
|
||||
|
||||
|
@ -50,7 +50,7 @@ config BONDING
|
||||
The driver supports multiple bonding modes to allow for both high
|
||||
performance and high availability operation.
|
||||
|
||||
Refer to <file:Documentation/networking/bonding.txt> for more
|
||||
Refer to <file:Documentation/networking/bonding.rst> for more
|
||||
information.
|
||||
|
||||
To compile this driver as a module, choose M here: the module
|
||||
|
Loading…
Reference in New Issue
Block a user