blob: afac780445cd19a9042a629fa32245d11806e610 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002 Linux Ethernet Bonding Driver HOWTO
3
Auke Kok6224e012006-06-08 11:15:35 -07004 Latest update: 24 April 2006
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
6Initial release : Thomas Davis <tadavis at lbl.gov>
7Corrections, HA extensions : 2000/10/03-15 :
8 - Willy Tarreau <willy at meta-x.org>
9 - Constantine Gavrilov <const-g at xpert.com>
10 - Chad N. Tindel <ctindel at ieee dot org>
11 - Janice Girouard <girouard at us dot ibm dot com>
12 - Jay Vosburgh <fubar at us dot ibm dot com>
13
14Reorganized and updated Feb 2005 by Jay Vosburgh
Auke Kok6224e012006-06-08 11:15:35 -070015Added Sysfs information: 2006/04/24
16 - Mitch Williams <mitch.a.williams at intel.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Jay Vosburgh00354cf2005-07-21 12:18:02 -070018Introduction
19============
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Jay Vosburgh00354cf2005-07-21 12:18:02 -070021 The Linux bonding driver provides a method for aggregating
22multiple network interfaces into a single logical "bonded" interface.
23The behavior of the bonded interfaces depends upon the mode; generally
24speaking, modes provide either hot standby or load balancing services.
25Additionally, link integrity monitoring may be performed.
26
27 The bonding driver originally came from Donald Becker's
28beowulf patches for kernel 2.0. It has changed quite a bit since, and
29the original tools from extreme-linux and beowulf sites will not work
30with this version of the driver.
31
32 For new versions of the driver, updated userspace tools, and
33who to ask for help, please follow the links at the end of this file.
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35Table of Contents
36=================
37
381. Bonding Driver Installation
39
402. Bonding Driver Options
41
423. Configuring Bonding Devices
Auke Kok6224e012006-06-08 11:15:35 -0700433.1 Configuration with Sysconfig Support
443.1.1 Using DHCP with Sysconfig
453.1.2 Configuring Multiple Bonds with Sysconfig
463.2 Configuration with Initscripts Support
473.2.1 Using DHCP with Initscripts
483.2.2 Configuring Multiple Bonds with Initscripts
493.3 Configuring Bonding Manually with Ifenslave
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700503.3.1 Configuring Multiple Bonds Manually
Auke Kok6224e012006-06-08 11:15:35 -0700513.4 Configuring Bonding Manually via Sysfs
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Auke Kok6224e012006-06-08 11:15:35 -0700534. Querying Bonding Configuration
544.1 Bonding Configuration
554.2 Network Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
Auke Kok6224e012006-06-08 11:15:35 -0700575. Switch Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Auke Kok6224e012006-06-08 11:15:35 -0700596. 802.1q VLAN Support
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
Auke Kok6224e012006-06-08 11:15:35 -0700617. Link Monitoring
627.1 ARP Monitor Operation
637.2 Configuring Multiple ARP Targets
647.3 MII Monitor Operation
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
Auke Kok6224e012006-06-08 11:15:35 -0700668. Potential Trouble Sources
678.1 Adventures in Routing
688.2 Ethernet Device Renaming
698.3 Painfully Slow Or No Failed Link Detection By Miimon
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
Auke Kok6224e012006-06-08 11:15:35 -0700719. SNMP agents
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Auke Kok6224e012006-06-08 11:15:35 -07007310. Promiscuous mode
Linus Torvalds1da177e2005-04-16 15:20:36 -070074
Auke Kok6224e012006-06-08 11:15:35 -07007511. Configuring Bonding for High Availability
7611.1 High Availability in a Single Switch Topology
7711.2 High Availability in a Multiple Switch Topology
7811.2.1 HA Bonding Mode Selection for Multiple Switch Topology
7911.2.2 HA Link Monitoring for Multiple Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Auke Kok6224e012006-06-08 11:15:35 -07008112. Configuring Bonding for Maximum Throughput
8212.1 Maximum Throughput in a Single Switch Topology
8312.1.1 MT Bonding Mode Selection for Single Switch Topology
8412.1.2 MT Link Monitoring for Single Switch Topology
8512.2 Maximum Throughput in a Multiple Switch Topology
8612.2.1 MT Bonding Mode Selection for Multiple Switch Topology
8712.2.2 MT Link Monitoring for Multiple Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
Auke Kok6224e012006-06-08 11:15:35 -07008913. Switch Behavior Issues
9013.1 Link Establishment and Failover Delays
9113.2 Duplicated Incoming Packets
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
Auke Kok6224e012006-06-08 11:15:35 -07009314. Hardware Specific Considerations
9414.1 IBM BladeCenter
Jay Vosburgh00354cf2005-07-21 12:18:02 -070095
Auke Kok6224e012006-06-08 11:15:35 -07009615. Frequently Asked Questions
Jay Vosburgh00354cf2005-07-21 12:18:02 -070097
Auke Kok6224e012006-06-08 11:15:35 -07009816. Resources and Links
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
100
1011. Bonding Driver Installation
102==============================
103
104 Most popular distro kernels ship with the bonding driver
105already available as a module and the ifenslave user level control
106program installed and ready for use. If your distro does not, or you
107have need to compile bonding from source (e.g., configuring and
108installing a mainline kernel from kernel.org), you'll need to perform
109the following steps:
110
1111.1 Configure and build the kernel with bonding
112-----------------------------------------------
113
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700114 The current version of the bonding driver is available in the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115drivers/net/bonding subdirectory of the most recent kernel source
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700116(which is available on http://kernel.org). Most users "rolling their
117own" will want to use the most recent kernel from kernel.org.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
119 Configure kernel with "make menuconfig" (or "make xconfig" or
120"make config"), then select "Bonding driver support" in the "Network
121device support" section. It is recommended that you configure the
122driver as module since it is currently the only way to pass parameters
123to the driver or configure more than one bonding device.
124
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700125 Build and install the new kernel and modules, then continue
126below to install ifenslave.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127
1281.2 Install ifenslave Control Utility
129-------------------------------------
130
131 The ifenslave user level control program is included in the
132kernel source tree, in the file Documentation/networking/ifenslave.c.
133It is generally recommended that you use the ifenslave that
134corresponds to the kernel that you are using (either from the same
135source tree or supplied with the distro), however, ifenslave
136executables from older kernels should function (but features newer
137than the ifenslave release are not supported). Running an ifenslave
138that is newer than the kernel is not supported, and may or may not
139work.
140
141 To install ifenslave, do the following:
142
143# gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave
144# cp ifenslave /sbin/ifenslave
145
146 If your kernel source is not in "/usr/src/linux," then replace
147"/usr/src/linux/include" in the above with the location of your kernel
148source include directory.
149
150 You may wish to back up any existing /sbin/ifenslave, or, for
151testing or informal use, tag the ifenslave to the kernel version
152(e.g., name the ifenslave executable /sbin/ifenslave-2.6.10).
153
154IMPORTANT NOTE:
155
156 If you omit the "-I" or specify an incorrect directory, you
157may end up with an ifenslave that is incompatible with the kernel
158you're trying to build it for. Some distros (e.g., Red Hat from 7.1
159onwards) do not have /usr/include/linux symbolically linked to the
160default kernel source include directory.
161
Auke Kok6224e012006-06-08 11:15:35 -0700162SECOND IMPORTANT NOTE:
163 If you plan to configure bonding using sysfs, you do not need
164to use ifenslave.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165
1662. Bonding Driver Options
167=========================
168
169 Options for the bonding driver are supplied as parameters to
170the bonding module at load time. They may be given as command line
171arguments to the insmod or modprobe command, but are usually specified
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700172in either the /etc/modules.conf or /etc/modprobe.conf configuration
173file, or in a distro-specific configuration file (some of which are
174detailed in the next section).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175
176 The available bonding driver parameters are listed below. If a
177parameter is not specified the default value is used. When initially
178configuring a bond, it is recommended "tail -f /var/log/messages" be
179run in a separate window to watch for bonding driver error messages.
180
181 It is critical that either the miimon or arp_interval and
182arp_ip_target parameters be specified, otherwise serious network
183degradation will occur during link failures. Very few devices do not
184support at least miimon, so there is really no reason not to use it.
185
186 Options with textual values will accept either the text name
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700187or, for backwards compatibility, the option value. E.g.,
188"mode=802.3ad" and "mode=4" set the same mode.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
190 The parameters are as follows:
191
192arp_interval
193
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700194 Specifies the ARP link monitoring frequency in milliseconds.
195 If ARP monitoring is used in an etherchannel compatible mode
196 (modes 0 and 2), the switch should be configured in a mode
197 that evenly distributes packets across all links. If the
198 switch is configured to distribute the packets in an XOR
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199 fashion, all replies from the ARP targets will be received on
200 the same link which could cause the other team members to
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700201 fail. ARP monitoring should not be used in conjunction with
202 miimon. A value of 0 disables ARP monitoring. The default
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203 value is 0.
204
205arp_ip_target
206
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700207 Specifies the IP addresses to use as ARP monitoring peers when
208 arp_interval is > 0. These are the targets of the ARP request
209 sent to determine the health of the link to the targets.
210 Specify these values in ddd.ddd.ddd.ddd format. Multiple IP
211 addresses must be separated by a comma. At least one IP
212 address must be given for ARP monitoring to function. The
213 maximum number of targets that can be specified is 16. The
214 default value is no IP addresses.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
216downdelay
217
218 Specifies the time, in milliseconds, to wait before disabling
219 a slave after a link failure has been detected. This option
220 is only valid for the miimon link monitor. The downdelay
221 value should be a multiple of the miimon value; if not, it
222 will be rounded down to the nearest multiple. The default
223 value is 0.
224
225lacp_rate
226
227 Option specifying the rate in which we'll ask our link partner
228 to transmit LACPDU packets in 802.3ad mode. Possible values
229 are:
230
231 slow or 0
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700232 Request partner to transmit LACPDUs every 30 seconds
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233
234 fast or 1
235 Request partner to transmit LACPDUs every 1 second
236
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700237 The default is slow.
238
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239max_bonds
240
241 Specifies the number of bonding devices to create for this
242 instance of the bonding driver. E.g., if max_bonds is 3, and
243 the bonding driver is not already loaded, then bond0, bond1
244 and bond2 will be created. The default value is 1.
245
246miimon
247
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700248 Specifies the MII link monitoring frequency in milliseconds.
249 This determines how often the link state of each slave is
250 inspected for link failures. A value of zero disables MII
251 link monitoring. A value of 100 is a good starting point.
252 The use_carrier option, below, affects how the link state is
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253 determined. See the High Availability section for additional
254 information. The default value is 0.
255
256mode
257
258 Specifies one of the bonding policies. The default is
259 balance-rr (round robin). Possible values are:
260
261 balance-rr or 0
262
263 Round-robin policy: Transmit packets in sequential
264 order from the first available slave through the
265 last. This mode provides load balancing and fault
266 tolerance.
267
268 active-backup or 1
269
270 Active-backup policy: Only one slave in the bond is
271 active. A different slave becomes active if, and only
272 if, the active slave fails. The bond's MAC address is
273 externally visible on only one port (network adapter)
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700274 to avoid confusing the switch.
275
276 In bonding version 2.6.2 or later, when a failover
277 occurs in active-backup mode, bonding will issue one
278 or more gratuitous ARPs on the newly active slave.
Auke Kok6224e012006-06-08 11:15:35 -0700279 One gratuitous ARP is issued for the bonding master
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700280 interface and each VLAN interfaces configured above
281 it, provided that the interface has at least one IP
282 address configured. Gratuitous ARPs issued for VLAN
283 interfaces are tagged with the appropriate VLAN id.
284
285 This mode provides fault tolerance. The primary
286 option, documented below, affects the behavior of this
287 mode.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288
289 balance-xor or 2
290
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700291 XOR policy: Transmit based on the selected transmit
292 hash policy. The default policy is a simple [(source
293 MAC address XOR'd with destination MAC address) modulo
294 slave count]. Alternate transmit policies may be
295 selected via the xmit_hash_policy option, described
296 below.
297
298 This mode provides load balancing and fault tolerance.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299
300 broadcast or 3
301
302 Broadcast policy: transmits everything on all slave
303 interfaces. This mode provides fault tolerance.
304
305 802.3ad or 4
306
307 IEEE 802.3ad Dynamic link aggregation. Creates
308 aggregation groups that share the same speed and
309 duplex settings. Utilizes all slaves in the active
310 aggregator according to the 802.3ad specification.
311
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700312 Slave selection for outgoing traffic is done according
313 to the transmit hash policy, which may be changed from
314 the default simple XOR policy via the xmit_hash_policy
315 option, documented below. Note that not all transmit
316 policies may be 802.3ad compliant, particularly in
317 regards to the packet mis-ordering requirements of
318 section 43.2.4 of the 802.3ad standard. Differing
319 peer implementations will have varying tolerances for
320 noncompliance.
321
322 Prerequisites:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323
324 1. Ethtool support in the base drivers for retrieving
325 the speed and duplex of each slave.
326
327 2. A switch that supports IEEE 802.3ad Dynamic link
328 aggregation.
329
330 Most switches will require some type of configuration
331 to enable 802.3ad mode.
332
333 balance-tlb or 5
334
335 Adaptive transmit load balancing: channel bonding that
336 does not require any special switch support. The
337 outgoing traffic is distributed according to the
338 current load (computed relative to the speed) on each
339 slave. Incoming traffic is received by the current
340 slave. If the receiving slave fails, another slave
341 takes over the MAC address of the failed receiving
342 slave.
343
344 Prerequisite:
345
346 Ethtool support in the base drivers for retrieving the
347 speed of each slave.
348
349 balance-alb or 6
350
351 Adaptive load balancing: includes balance-tlb plus
352 receive load balancing (rlb) for IPV4 traffic, and
353 does not require any special switch support. The
354 receive load balancing is achieved by ARP negotiation.
355 The bonding driver intercepts the ARP Replies sent by
356 the local system on their way out and overwrites the
357 source hardware address with the unique hardware
358 address of one of the slaves in the bond such that
359 different peers use different hardware addresses for
360 the server.
361
362 Receive traffic from connections created by the server
363 is also balanced. When the local system sends an ARP
364 Request the bonding driver copies and saves the peer's
365 IP information from the ARP packet. When the ARP
366 Reply arrives from the peer, its hardware address is
367 retrieved and the bonding driver initiates an ARP
368 reply to this peer assigning it to one of the slaves
369 in the bond. A problematic outcome of using ARP
370 negotiation for balancing is that each time that an
371 ARP request is broadcast it uses the hardware address
372 of the bond. Hence, peers learn the hardware address
373 of the bond and the balancing of receive traffic
374 collapses to the current slave. This is handled by
375 sending updates (ARP Replies) to all the peers with
376 their individually assigned hardware address such that
377 the traffic is redistributed. Receive traffic is also
378 redistributed when a new slave is added to the bond
379 and when an inactive slave is re-activated. The
380 receive load is distributed sequentially (round robin)
381 among the group of highest speed slaves in the bond.
382
383 When a link is reconnected or a new slave joins the
384 bond the receive traffic is redistributed among all
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700385 active slaves in the bond by initiating ARP Replies
Auke Kok6224e012006-06-08 11:15:35 -0700386 with the selected MAC address to each of the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387 clients. The updelay parameter (detailed below) must
388 be set to a value equal or greater than the switch's
389 forwarding delay so that the ARP Replies sent to the
390 peers will not be blocked by the switch.
391
392 Prerequisites:
393
394 1. Ethtool support in the base drivers for retrieving
395 the speed of each slave.
396
397 2. Base driver support for setting the hardware
398 address of a device while it is open. This is
399 required so that there will always be one slave in the
400 team using the bond hardware address (the
401 curr_active_slave) while having a unique hardware
402 address for each slave in the bond. If the
403 curr_active_slave fails its hardware address is
404 swapped with the new curr_active_slave that was
405 chosen.
406
407primary
408
409 A string (eth0, eth2, etc) specifying which slave is the
410 primary device. The specified device will always be the
411 active slave while it is available. Only when the primary is
412 off-line will alternate devices be used. This is useful when
413 one slave is preferred over another, e.g., when one slave has
414 higher throughput than another.
415
416 The primary option is only valid for active-backup mode.
417
418updelay
419
420 Specifies the time, in milliseconds, to wait before enabling a
421 slave after a link recovery has been detected. This option is
422 only valid for the miimon link monitor. The updelay value
423 should be a multiple of the miimon value; if not, it will be
424 rounded down to the nearest multiple. The default value is 0.
425
426use_carrier
427
428 Specifies whether or not miimon should use MII or ETHTOOL
429 ioctls vs. netif_carrier_ok() to determine the link
430 status. The MII or ETHTOOL ioctls are less efficient and
431 utilize a deprecated calling sequence within the kernel. The
432 netif_carrier_ok() relies on the device driver to maintain its
433 state with netif_carrier_on/off; at this writing, most, but
434 not all, device drivers support this facility.
435
436 If bonding insists that the link is up when it should not be,
437 it may be that your network device driver does not support
438 netif_carrier_on/off. The default state for netif_carrier is
439 "carrier on," so if a driver does not support netif_carrier,
440 it will appear as if the link is always up. In this case,
441 setting use_carrier to 0 will cause bonding to revert to the
442 MII / ETHTOOL ioctl method to determine the link state.
443
444 A value of 1 enables the use of netif_carrier_ok(), a value of
445 0 will use the deprecated MII / ETHTOOL ioctls. The default
446 value is 1.
447
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700448xmit_hash_policy
449
450 Selects the transmit hash policy to use for slave selection in
451 balance-xor and 802.3ad modes. Possible values are:
452
453 layer2
454
455 Uses XOR of hardware MAC addresses to generate the
456 hash. The formula is
457
458 (source MAC XOR destination MAC) modulo slave count
459
460 This algorithm will place all traffic to a particular
461 network peer on the same slave.
462
463 This algorithm is 802.3ad compliant.
464
465 layer3+4
466
467 This policy uses upper layer protocol information,
468 when available, to generate the hash. This allows for
469 traffic to a particular network peer to span multiple
470 slaves, although a single connection will not span
471 multiple slaves.
472
473 The formula for unfragmented TCP and UDP packets is
474
475 ((source port XOR dest port) XOR
476 ((source IP XOR dest IP) AND 0xffff)
477 modulo slave count
478
479 For fragmented TCP or UDP packets and all other IP
480 protocol traffic, the source and destination port
481 information is omitted. For non-IP traffic, the
482 formula is the same as for the layer2 transmit hash
483 policy.
484
485 This policy is intended to mimic the behavior of
486 certain switches, notably Cisco switches with PFC2 as
487 well as some Foundry and IBM products.
488
489 This algorithm is not fully 802.3ad compliant. A
490 single TCP or UDP conversation containing both
491 fragmented and unfragmented packets will see packets
492 striped across two interfaces. This may result in out
493 of order delivery. Most traffic types will not meet
494 this criteria, as TCP rarely fragments traffic, and
495 most UDP traffic is not involved in extended
496 conversations. Other implementations of 802.3ad may
497 or may not tolerate this noncompliance.
498
499 The default value is layer2. This option was added in bonding
500version 2.6.3. In earlier versions of bonding, this parameter does
501not exist, and the layer2 policy is the only policy.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502
503
5043. Configuring Bonding Devices
505==============================
506
Auke Kok6224e012006-06-08 11:15:35 -0700507 You can configure bonding using either your distro's network
508initialization scripts, or manually using either ifenslave or the
509sysfs interface. Distros generally use one of two packages for the
510network initialization scripts: initscripts or sysconfig. Recent
511versions of these packages have support for bonding, while older
512versions do not.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700513
514 We will first describe the options for configuring bonding for
515distros using versions of initscripts and sysconfig with full or
516partial support for bonding, then provide information on enabling
517bonding without support from the network initialization scripts (i.e.,
518older versions of initscripts or sysconfig).
519
520 If you're unsure whether your distro uses sysconfig or
521initscripts, or don't know if it's new enough, have no fear.
522Determining this is fairly straightforward.
523
524 First, issue the command:
525
526$ rpm -qf /sbin/ifup
527
528 It will respond with a line of text starting with either
529"initscripts" or "sysconfig," followed by some numbers. This is the
530package that provides your network initialization scripts.
531
532 Next, to determine if your installation supports bonding,
533issue the command:
534
535$ grep ifenslave /sbin/ifup
536
537 If this returns any matches, then your initscripts or
538sysconfig has support for bonding.
539
Auke Kok6224e012006-06-08 11:15:35 -07005403.1 Configuration with Sysconfig Support
Linus Torvalds1da177e2005-04-16 15:20:36 -0700541----------------------------------------
542
543 This section applies to distros using a version of sysconfig
544with bonding support, for example, SuSE Linux Enterprise Server 9.
545
546 SuSE SLES 9's networking configuration system does support
547bonding, however, at this writing, the YaST system configuration
Auke Kok6224e012006-06-08 11:15:35 -0700548front end does not provide any means to work with bonding devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700549Bonding devices can be managed by hand, however, as follows.
550
551 First, if they have not already been configured, configure the
552slave devices. On SLES 9, this is most easily done by running the
553yast2 sysconfig configuration utility. The goal is for to create an
554ifcfg-id file for each slave device. The simplest way to accomplish
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700555this is to configure the devices for DHCP (this is only to get the
556file ifcfg-id file created; see below for some issues with DHCP). The
557name of the configuration file for each device will be of the form:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700558
559ifcfg-id-xx:xx:xx:xx:xx:xx
560
561 Where the "xx" portion will be replaced with the digits from
562the device's permanent MAC address.
563
564 Once the set of ifcfg-id-xx:xx:xx:xx:xx:xx files has been
565created, it is necessary to edit the configuration files for the slave
566devices (the MAC addresses correspond to those of the slave devices).
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700567Before editing, the file will contain multiple lines, and will look
Linus Torvalds1da177e2005-04-16 15:20:36 -0700568something like this:
569
570BOOTPROTO='dhcp'
571STARTMODE='on'
572USERCTL='no'
573UNIQUE='XNzu.WeZGOGF+4wE'
574_nm_name='bus-pci-0001:61:01.0'
575
576 Change the BOOTPROTO and STARTMODE lines to the following:
577
578BOOTPROTO='none'
579STARTMODE='off'
580
581 Do not alter the UNIQUE or _nm_name lines. Remove any other
582lines (USERCTL, etc).
583
584 Once the ifcfg-id-xx:xx:xx:xx:xx:xx files have been modified,
585it's time to create the configuration file for the bonding device
586itself. This file is named ifcfg-bondX, where X is the number of the
587bonding device to create, starting at 0. The first such file is
588ifcfg-bond0, the second is ifcfg-bond1, and so on. The sysconfig
589network configuration system will correctly start multiple instances
590of bonding.
591
592 The contents of the ifcfg-bondX file is as follows:
593
594BOOTPROTO="static"
595BROADCAST="10.0.2.255"
596IPADDR="10.0.2.10"
597NETMASK="255.255.0.0"
598NETWORK="10.0.2.0"
599REMOTE_IPADDR=""
600STARTMODE="onboot"
601BONDING_MASTER="yes"
602BONDING_MODULE_OPTS="mode=active-backup miimon=100"
603BONDING_SLAVE0="eth0"
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700604BONDING_SLAVE1="bus-pci-0000:06:08.1"
Linus Torvalds1da177e2005-04-16 15:20:36 -0700605
606 Replace the sample BROADCAST, IPADDR, NETMASK and NETWORK
607values with the appropriate values for your network.
608
Linus Torvalds1da177e2005-04-16 15:20:36 -0700609 The STARTMODE specifies when the device is brought online.
610The possible values are:
611
612 onboot: The device is started at boot time. If you're not
613 sure, this is probably what you want.
614
615 manual: The device is started only when ifup is called
616 manually. Bonding devices may be configured this
617 way if you do not wish them to start automatically
618 at boot for some reason.
619
620 hotplug: The device is started by a hotplug event. This is not
621 a valid choice for a bonding device.
622
623 off or ignore: The device configuration is ignored.
624
625 The line BONDING_MASTER='yes' indicates that the device is a
626bonding master device. The only useful value is "yes."
627
628 The contents of BONDING_MODULE_OPTS are supplied to the
629instance of the bonding module for this device. Specify the options
630for the bonding mode, link monitoring, and so on here. Do not include
631the max_bonds bonding parameter; this will confuse the configuration
632system if you have multiple bonding devices.
633
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700634 Finally, supply one BONDING_SLAVEn="slave device" for each
635slave. where "n" is an increasing value, one for each slave. The
636"slave device" is either an interface name, e.g., "eth0", or a device
637specifier for the network device. The interface name is easier to
638find, but the ethN names are subject to change at boot time if, e.g.,
639a device early in the sequence has failed. The device specifiers
640(bus-pci-0000:06:08.1 in the example above) specify the physical
641network device, and will not change unless the device's bus location
642changes (for example, it is moved from one PCI slot to another). The
643example above uses one of each type for demonstration purposes; most
644configurations will choose one or the other for all slave devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700645
646 When all configuration files have been modified or created,
647networking must be restarted for the configuration changes to take
648effect. This can be accomplished via the following:
649
650# /etc/init.d/network restart
651
652 Note that the network control script (/sbin/ifdown) will
653remove the bonding module as part of the network shutdown processing,
654so it is not necessary to remove the module by hand if, e.g., the
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700655module parameters have changed.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656
657 Also, at this writing, YaST/YaST2 will not manage bonding
658devices (they do not show bonding interfaces on its list of network
659devices). It is necessary to edit the configuration file by hand to
660change the bonding configuration.
661
662 Additional general options and details of the ifcfg file
663format can be found in an example ifcfg template file:
664
665/etc/sysconfig/network/ifcfg.template
666
667 Note that the template does not document the various BONDING_
668settings described above, but does describe many of the other options.
669
Auke Kok6224e012006-06-08 11:15:35 -07006703.1.1 Using DHCP with Sysconfig
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700671-------------------------------
672
673 Under sysconfig, configuring a device with BOOTPROTO='dhcp'
674will cause it to query DHCP for its IP address information. At this
675writing, this does not function for bonding devices; the scripts
676attempt to obtain the device address from DHCP prior to adding any of
677the slave devices. Without active slaves, the DHCP requests are not
678sent to the network.
679
Auke Kok6224e012006-06-08 11:15:35 -07006803.1.2 Configuring Multiple Bonds with Sysconfig
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700681-----------------------------------------------
682
683 The sysconfig network initialization system is capable of
684handling multiple bonding devices. All that is necessary is for each
685bonding instance to have an appropriately configured ifcfg-bondX file
686(as described above). Do not specify the "max_bonds" parameter to any
687instance of bonding, as this will confuse sysconfig. If you require
688multiple bonding devices with identical parameters, create multiple
689ifcfg-bondX files.
690
691 Because the sysconfig scripts supply the bonding module
692options in the ifcfg-bondX file, it is not necessary to add them to
693the system /etc/modules.conf or /etc/modprobe.conf configuration file.
694
Auke Kok6224e012006-06-08 11:15:35 -07006953.2 Configuration with Initscripts Support
Linus Torvalds1da177e2005-04-16 15:20:36 -0700696------------------------------------------
697
698 This section applies to distros using a version of initscripts
699with bonding support, for example, Red Hat Linux 9 or Red Hat
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700700Enterprise Linux version 3 or 4. On these systems, the network
Linus Torvalds1da177e2005-04-16 15:20:36 -0700701initialization scripts have some knowledge of bonding, and can be
702configured to control bonding devices.
703
704 These distros will not automatically load the network adapter
705driver unless the ethX device is configured with an IP address.
706Because of this constraint, users must manually configure a
707network-script file for all physical adapters that will be members of
708a bondX link. Network script files are located in the directory:
709
710/etc/sysconfig/network-scripts
711
712 The file name must be prefixed with "ifcfg-eth" and suffixed
713with the adapter's physical adapter number. For example, the script
714for eth0 would be named /etc/sysconfig/network-scripts/ifcfg-eth0.
715Place the following text in the file:
716
717DEVICE=eth0
718USERCTL=no
719ONBOOT=yes
720MASTER=bond0
721SLAVE=yes
722BOOTPROTO=none
723
724 The DEVICE= line will be different for every ethX device and
725must correspond with the name of the file, i.e., ifcfg-eth1 must have
726a device line of DEVICE=eth1. The setting of the MASTER= line will
727also depend on the final bonding interface name chosen for your bond.
728As with other network devices, these typically start at 0, and go up
729one for each device, i.e., the first bonding instance is bond0, the
730second is bond1, and so on.
731
732 Next, create a bond network script. The file name for this
733script will be /etc/sysconfig/network-scripts/ifcfg-bondX where X is
734the number of the bond. For bond0 the file is named "ifcfg-bond0",
735for bond1 it is named "ifcfg-bond1", and so on. Within that file,
736place the following text:
737
738DEVICE=bond0
739IPADDR=192.168.1.1
740NETMASK=255.255.255.0
741NETWORK=192.168.1.0
742BROADCAST=192.168.1.255
743ONBOOT=yes
744BOOTPROTO=none
745USERCTL=no
746
747 Be sure to change the networking specific lines (IPADDR,
748NETMASK, NETWORK and BROADCAST) to match your network configuration.
749
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700750 Finally, it is necessary to edit /etc/modules.conf (or
751/etc/modprobe.conf, depending upon your distro) to load the bonding
752module with your desired options when the bond0 interface is brought
753up. The following lines in /etc/modules.conf (or modprobe.conf) will
754load the bonding module, and select its options:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700755
756alias bond0 bonding
757options bond0 mode=balance-alb miimon=100
758
759 Replace the sample parameters with the appropriate set of
760options for your configuration.
761
762 Finally run "/etc/rc.d/init.d/network restart" as root. This
763will restart the networking subsystem and your bond link should be now
764up and running.
765
Auke Kok6224e012006-06-08 11:15:35 -07007663.2.1 Using DHCP with Initscripts
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700767---------------------------------
768
769 Recent versions of initscripts (the version supplied with
770Fedora Core 3 and Red Hat Enterprise Linux 4 is reported to work) do
771have support for assigning IP information to bonding devices via DHCP.
772
773 To configure bonding for DHCP, configure it as described
774above, except replace the line "BOOTPROTO=none" with "BOOTPROTO=dhcp"
775and add a line consisting of "TYPE=Bonding". Note that the TYPE value
776is case sensitive.
777
Auke Kok6224e012006-06-08 11:15:35 -07007783.2.2 Configuring Multiple Bonds with Initscripts
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700779-------------------------------------------------
780
781 At this writing, the initscripts package does not directly
782support loading the bonding driver multiple times, so the process for
783doing so is the same as described in the "Configuring Multiple Bonds
784Manually" section, below.
785
786 NOTE: It has been observed that some Red Hat supplied kernels
John W. Linville4cac0182005-10-18 21:30:59 -0400787are apparently unable to rename modules at load time (the "-o bond1"
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700788part). Attempts to pass that option to modprobe will produce an
789"Operation not permitted" error. This has been reported on some
790Fedora Core kernels, and has been seen on RHEL 4 as well. On kernels
791exhibiting this problem, it will be impossible to configure multiple
792bonds with differing parameters.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793
Auke Kok6224e012006-06-08 11:15:35 -07007943.3 Configuring Bonding Manually with Ifenslave
795-----------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700796
797 This section applies to distros whose network initialization
798scripts (the sysconfig or initscripts package) do not have specific
799knowledge of bonding. One such distro is SuSE Linux Enterprise Server
800version 8.
801
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700802 The general method for these systems is to place the bonding
803module parameters into /etc/modules.conf or /etc/modprobe.conf (as
804appropriate for the installed distro), then add modprobe and/or
805ifenslave commands to the system's global init script. The name of
806the global init script differs; for sysconfig, it is
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807/etc/init.d/boot.local and for initscripts it is /etc/rc.d/rc.local.
808
809 For example, if you wanted to make a simple bond of two e100
810devices (presumed to be eth0 and eth1), and have it persist across
811reboots, edit the appropriate file (/etc/init.d/boot.local or
812/etc/rc.d/rc.local), and add the following:
813
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700814modprobe bonding mode=balance-alb miimon=100
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815modprobe e100
816ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
817ifenslave bond0 eth0
818ifenslave bond0 eth1
819
820 Replace the example bonding module parameters and bond0
821network configuration (IP address, netmask, etc) with the appropriate
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700822values for your configuration.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823
824 Unfortunately, this method will not provide support for the
825ifup and ifdown scripts on the bond devices. To reload the bonding
826configuration, it is necessary to run the initialization script, e.g.,
827
828# /etc/init.d/boot.local
829
830 or
831
832# /etc/rc.d/rc.local
833
834 It may be desirable in such a case to create a separate script
835which only initializes the bonding configuration, then call that
836separate script from within boot.local. This allows for bonding to be
837enabled without re-running the entire global init script.
838
839 To shut down the bonding devices, it is necessary to first
840mark the bonding device itself as being down, then remove the
841appropriate device driver modules. For our example above, you can do
842the following:
843
844# ifconfig bond0 down
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700845# rmmod bonding
Linus Torvalds1da177e2005-04-16 15:20:36 -0700846# rmmod e100
847
848 Again, for convenience, it may be desirable to create a script
849with these commands.
850
851
Jay Vosburgh00354cf2005-07-21 12:18:02 -07008523.3.1 Configuring Multiple Bonds Manually
853-----------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854
855 This section contains information on configuring multiple
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700856bonding devices with differing options for those systems whose network
857initialization scripts lack support for configuring multiple bonds.
858
859 If you require multiple bonding devices, but all with the same
860options, you may wish to use the "max_bonds" module parameter,
861documented above.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700862
863 To create multiple bonding devices with differing options, it
864is necessary to load the bonding driver multiple times. Note that
865current versions of the sysconfig network initialization scripts
866handle this automatically; if your distro uses these scripts, no
867special action is needed. See the section Configuring Bonding
868Devices, above, if you're not sure about your network initialization
869scripts.
870
871 To load multiple instances of the module, it is necessary to
872specify a different name for each instance (the module loading system
873requires that every loaded module, even multiple instances of the same
874module, have a unique name). This is accomplished by supplying
875multiple sets of bonding options in /etc/modprobe.conf, for example:
876
877alias bond0 bonding
878options bond0 -o bond0 mode=balance-rr miimon=100
879
880alias bond1 bonding
881options bond1 -o bond1 mode=balance-alb miimon=50
882
883 will load the bonding module two times. The first instance is
884named "bond0" and creates the bond0 device in balance-rr mode with an
885miimon of 100. The second instance is named "bond1" and creates the
886bond1 device in balance-alb mode with an miimon of 50.
887
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700888 In some circumstances (typically with older distributions),
889the above does not work, and the second bonding instance never sees
890its options. In that case, the second options line can be substituted
891as follows:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700892
John W. Linville4cac0182005-10-18 21:30:59 -0400893install bond1 /sbin/modprobe --ignore-install bonding -o bond1 \
894 mode=balance-alb miimon=50
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700895
896 This may be repeated any number of times, specifying a new and
897unique name in place of bond1 for each subsequent instance.
898
Auke Kok6224e012006-06-08 11:15:35 -07008993.4 Configuring Bonding Manually via Sysfs
900------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -0700901
Auke Kok6224e012006-06-08 11:15:35 -0700902 Starting with version 3.0, Channel Bonding may be configured
903via the sysfs interface. This interface allows dynamic configuration
904of all bonds in the system without unloading the module. It also
905allows for adding and removing bonds at runtime. Ifenslave is no
906longer required, though it is still supported.
907
908 Use of the sysfs interface allows you to use multiple bonds
909with different configurations without having to reload the module.
910It also allows you to use multiple, differently configured bonds when
911bonding is compiled into the kernel.
912
913 You must have the sysfs filesystem mounted to configure
914bonding this way. The examples in this document assume that you
915are using the standard mount point for sysfs, e.g. /sys. If your
916sysfs filesystem is mounted elsewhere, you will need to adjust the
917example paths accordingly.
918
919Creating and Destroying Bonds
920-----------------------------
921To add a new bond foo:
922# echo +foo > /sys/class/net/bonding_masters
923
924To remove an existing bond bar:
925# echo -bar > /sys/class/net/bonding_masters
926
927To show all existing bonds:
928# cat /sys/class/net/bonding_masters
929
930NOTE: due to 4K size limitation of sysfs files, this list may be
931truncated if you have more than a few hundred bonds. This is unlikely
932to occur under normal operating conditions.
933
934Adding and Removing Slaves
935--------------------------
936 Interfaces may be enslaved to a bond using the file
937/sys/class/net/<bond>/bonding/slaves. The semantics for this file
938are the same as for the bonding_masters file.
939
940To enslave interface eth0 to bond bond0:
941# ifconfig bond0 up
942# echo +eth0 > /sys/class/net/bond0/bonding/slaves
943
944To free slave eth0 from bond bond0:
945# echo -eth0 > /sys/class/net/bond0/bonding/slaves
946
947 NOTE: The bond must be up before slaves can be added. All
948slaves are freed when the interface is brought down.
949
950 When an interface is enslaved to a bond, symlinks between the
951two are created in the sysfs filesystem. In this case, you would get
952/sys/class/net/bond0/slave_eth0 pointing to /sys/class/net/eth0, and
953/sys/class/net/eth0/master pointing to /sys/class/net/bond0.
954
955 This means that you can tell quickly whether or not an
956interface is enslaved by looking for the master symlink. Thus:
957# echo -eth0 > /sys/class/net/eth0/master/bonding/slaves
958will free eth0 from whatever bond it is enslaved to, regardless of
959the name of the bond interface.
960
961Changing a Bond's Configuration
962-------------------------------
963 Each bond may be configured individually by manipulating the
964files located in /sys/class/net/<bond name>/bonding
965
966 The names of these files correspond directly with the command-
967line parameters described elsewhere in in this file, and, with the
968exception of arp_ip_target, they accept the same values. To see the
969current setting, simply cat the appropriate file.
970
971 A few examples will be given here; for specific usage
972guidelines for each parameter, see the appropriate section in this
973document.
974
975To configure bond0 for balance-alb mode:
976# ifconfig bond0 down
977# echo 6 > /sys/class/net/bond0/bonding/mode
978 - or -
979# echo balance-alb > /sys/class/net/bond0/bonding/mode
980 NOTE: The bond interface must be down before the mode can be
981changed.
982
983To enable MII monitoring on bond0 with a 1 second interval:
984# echo 1000 > /sys/class/net/bond0/bonding/miimon
985 NOTE: If ARP monitoring is enabled, it will disabled when MII
986monitoring is enabled, and vice-versa.
987
988To add ARP targets:
989# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
990# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
991 NOTE: up to 10 target addresses may be specified.
992
993To remove an ARP target:
994# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
995
996Example Configuration
997---------------------
998 We begin with the same example that is shown in section 3.3,
999executed with sysfs, and without using ifenslave.
1000
1001 To make a simple bond of two e100 devices (presumed to be eth0
1002and eth1), and have it persist across reboots, edit the appropriate
1003file (/etc/init.d/boot.local or /etc/rc.d/rc.local), and add the
1004following:
1005
1006modprobe bonding
1007modprobe e100
1008echo balance-alb > /sys/class/net/bond0/bonding/mode
1009ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
1010echo 100 > /sys/class/net/bond0/bonding/miimon
1011echo +eth0 > /sys/class/net/bond0/bonding/slaves
1012echo +eth1 > /sys/class/net/bond0/bonding/slaves
1013
1014 To add a second bond, with two e1000 interfaces in
1015active-backup mode, using ARP monitoring, add the following lines to
1016your init script:
1017
1018modprobe e1000
1019echo +bond1 > /sys/class/net/bonding_masters
1020echo active-backup > /sys/class/net/bond1/bonding/mode
1021ifconfig bond1 192.168.2.1 netmask 255.255.255.0 up
1022echo +192.168.2.100 /sys/class/net/bond1/bonding/arp_ip_target
1023echo 2000 > /sys/class/net/bond1/bonding/arp_interval
1024echo +eth2 > /sys/class/net/bond1/bonding/slaves
1025echo +eth3 > /sys/class/net/bond1/bonding/slaves
1026
1027
10284. Querying Bonding Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001029=================================
1030
Auke Kok6224e012006-06-08 11:15:35 -070010314.1 Bonding Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001032-------------------------
1033
1034 Each bonding device has a read-only file residing in the
1035/proc/net/bonding directory. The file contents include information
1036about the bonding configuration, options and state of each slave.
1037
1038 For example, the contents of /proc/net/bonding/bond0 after the
1039driver is loaded with parameters of mode=0 and miimon=1000 is
1040generally as follows:
1041
1042 Ethernet Channel Bonding Driver: 2.6.1 (October 29, 2004)
1043 Bonding Mode: load balancing (round-robin)
1044 Currently Active Slave: eth0
1045 MII Status: up
1046 MII Polling Interval (ms): 1000
1047 Up Delay (ms): 0
1048 Down Delay (ms): 0
1049
1050 Slave Interface: eth1
1051 MII Status: up
1052 Link Failure Count: 1
1053
1054 Slave Interface: eth0
1055 MII Status: up
1056 Link Failure Count: 1
1057
1058 The precise format and contents will change depending upon the
1059bonding configuration, state, and version of the bonding driver.
1060
Auke Kok6224e012006-06-08 11:15:35 -070010614.2 Network configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001062-------------------------
1063
1064 The network configuration can be inspected using the ifconfig
1065command. Bonding devices will have the MASTER flag set; Bonding slave
1066devices will have the SLAVE flag set. The ifconfig output does not
1067contain information on which slaves are associated with which masters.
1068
1069 In the example below, the bond0 interface is the master
1070(MASTER) while eth0 and eth1 are slaves (SLAVE). Notice all slaves of
1071bond0 have the same MAC address (HWaddr) as bond0 for all modes except
1072TLB and ALB that require a unique MAC address for each slave.
1073
1074# /sbin/ifconfig
1075bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
1076 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0
1077 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
1078 RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0
1079 TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0
1080 collisions:0 txqueuelen:0
1081
1082eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
Linus Torvalds1da177e2005-04-16 15:20:36 -07001083 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
1084 RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0
1085 TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0
1086 collisions:0 txqueuelen:100
1087 Interrupt:10 Base address:0x1080
1088
1089eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
Linus Torvalds1da177e2005-04-16 15:20:36 -07001090 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
1091 RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0
1092 TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0
1093 collisions:0 txqueuelen:100
1094 Interrupt:9 Base address:0x1400
1095
Auke Kok6224e012006-06-08 11:15:35 -070010965. Switch Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001097=======================
1098
1099 For this section, "switch" refers to whatever system the
1100bonded devices are directly connected to (i.e., where the other end of
1101the cable plugs into). This may be an actual dedicated switch device,
1102or it may be another regular system (e.g., another computer running
1103Linux),
1104
1105 The active-backup, balance-tlb and balance-alb modes do not
1106require any specific configuration of the switch.
1107
1108 The 802.3ad mode requires that the switch have the appropriate
1109ports configured as an 802.3ad aggregation. The precise method used
1110to configure this varies from switch to switch, but, for example, a
1111Cisco 3550 series switch requires that the appropriate ports first be
1112grouped together in a single etherchannel instance, then that
1113etherchannel is set to mode "lacp" to enable 802.3ad (instead of
1114standard EtherChannel).
1115
1116 The balance-rr, balance-xor and broadcast modes generally
1117require that the switch have the appropriate ports grouped together.
1118The nomenclature for such a group differs between switches, it may be
1119called an "etherchannel" (as in the Cisco example, above), a "trunk
1120group" or some other similar variation. For these modes, each switch
1121will also have its own configuration options for the switch's transmit
1122policy to the bond. Typical choices include XOR of either the MAC or
1123IP addresses. The transmit policy of the two peers does not need to
1124match. For these three modes, the bonding mode really selects a
1125transmit policy for an EtherChannel group; all three will interoperate
1126with another EtherChannel group.
1127
1128
Auke Kok6224e012006-06-08 11:15:35 -070011296. 802.1q VLAN Support
Linus Torvalds1da177e2005-04-16 15:20:36 -07001130======================
1131
1132 It is possible to configure VLAN devices over a bond interface
1133using the 8021q driver. However, only packets coming from the 8021q
1134driver and passing through bonding will be tagged by default. Self
1135generated packets, for example, bonding's learning packets or ARP
1136packets generated by either ALB mode or the ARP monitor mechanism, are
1137tagged internally by bonding itself. As a result, bonding must
1138"learn" the VLAN IDs configured above it, and use those IDs to tag
1139self generated packets.
1140
1141 For reasons of simplicity, and to support the use of adapters
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001142that can do VLAN hardware acceleration offloading, the bonding
1143interface declares itself as fully hardware offloading capable, it gets
Linus Torvalds1da177e2005-04-16 15:20:36 -07001144the add_vid/kill_vid notifications to gather the necessary
1145information, and it propagates those actions to the slaves. In case
1146of mixed adapter types, hardware accelerated tagged packets that
1147should go through an adapter that is not offloading capable are
1148"un-accelerated" by the bonding driver so the VLAN tag sits in the
1149regular location.
1150
1151 VLAN interfaces *must* be added on top of a bonding interface
1152only after enslaving at least one slave. The bonding interface has a
1153hardware address of 00:00:00:00:00:00 until the first slave is added.
1154If the VLAN interface is created prior to the first enslavement, it
1155would pick up the all-zeroes hardware address. Once the first slave
1156is attached to the bond, the bond device itself will pick up the
1157slave's hardware address, which is then available for the VLAN device.
1158
1159 Also, be aware that a similar problem can occur if all slaves
1160are released from a bond that still has one or more VLAN interfaces on
1161top of it. When a new slave is added, the bonding interface will
1162obtain its hardware address from the first slave, which might not
1163match the hardware address of the VLAN interfaces (which was
1164ultimately copied from an earlier slave).
1165
1166 There are two methods to insure that the VLAN device operates
1167with the correct hardware address if all slaves are removed from a
1168bond interface:
1169
1170 1. Remove all VLAN interfaces then recreate them
1171
1172 2. Set the bonding interface's hardware address so that it
1173matches the hardware address of the VLAN interfaces.
1174
1175 Note that changing a VLAN interface's HW address would set the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001176underlying device -- i.e. the bonding interface -- to promiscuous
Linus Torvalds1da177e2005-04-16 15:20:36 -07001177mode, which might not be what you want.
1178
1179
Auke Kok6224e012006-06-08 11:15:35 -070011807. Link Monitoring
Linus Torvalds1da177e2005-04-16 15:20:36 -07001181==================
1182
1183 The bonding driver at present supports two schemes for
1184monitoring a slave device's link state: the ARP monitor and the MII
1185monitor.
1186
1187 At the present time, due to implementation restrictions in the
1188bonding driver itself, it is not possible to enable both ARP and MII
1189monitoring simultaneously.
1190
Auke Kok6224e012006-06-08 11:15:35 -070011917.1 ARP Monitor Operation
Linus Torvalds1da177e2005-04-16 15:20:36 -07001192-------------------------
1193
1194 The ARP monitor operates as its name suggests: it sends ARP
1195queries to one or more designated peer systems on the network, and
1196uses the response as an indication that the link is operating. This
1197gives some assurance that traffic is actually flowing to and from one
1198or more peers on the local network.
1199
1200 The ARP monitor relies on the device driver itself to verify
1201that traffic is flowing. In particular, the driver must keep up to
1202date the last receive time, dev->last_rx, and transmit start time,
1203dev->trans_start. If these are not updated by the driver, then the
1204ARP monitor will immediately fail any slaves using that driver, and
1205those slaves will stay down. If networking monitoring (tcpdump, etc)
1206shows the ARP requests and replies on the network, then it may be that
1207your device driver is not updating last_rx and trans_start.
1208
Auke Kok6224e012006-06-08 11:15:35 -070012097.2 Configuring Multiple ARP Targets
Linus Torvalds1da177e2005-04-16 15:20:36 -07001210------------------------------------
1211
1212 While ARP monitoring can be done with just one target, it can
1213be useful in a High Availability setup to have several targets to
1214monitor. In the case of just one target, the target itself may go
1215down or have a problem making it unresponsive to ARP requests. Having
1216an additional target (or several) increases the reliability of the ARP
1217monitoring.
1218
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001219 Multiple ARP targets must be separated by commas as follows:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001220
1221# example options for ARP monitoring with three targets
1222alias bond0 bonding
1223options bond0 arp_interval=60 arp_ip_target=192.168.0.1,192.168.0.3,192.168.0.9
1224
1225 For just a single target the options would resemble:
1226
1227# example options for ARP monitoring with one target
1228alias bond0 bonding
1229options bond0 arp_interval=60 arp_ip_target=192.168.0.100
1230
1231
Auke Kok6224e012006-06-08 11:15:35 -070012327.3 MII Monitor Operation
Linus Torvalds1da177e2005-04-16 15:20:36 -07001233-------------------------
1234
1235 The MII monitor monitors only the carrier state of the local
1236network interface. It accomplishes this in one of three ways: by
1237depending upon the device driver to maintain its carrier state, by
1238querying the device's MII registers, or by making an ethtool query to
1239the device.
1240
1241 If the use_carrier module parameter is 1 (the default value),
1242then the MII monitor will rely on the driver for carrier state
1243information (via the netif_carrier subsystem). As explained in the
1244use_carrier parameter information, above, if the MII monitor fails to
1245detect carrier loss on the device (e.g., when the cable is physically
1246disconnected), it may be that the driver does not support
1247netif_carrier.
1248
1249 If use_carrier is 0, then the MII monitor will first query the
1250device's (via ioctl) MII registers and check the link state. If that
1251request fails (not just that it returns carrier down), then the MII
1252monitor will make an ethtool ETHOOL_GLINK request to attempt to obtain
1253the same information. If both methods fail (i.e., the driver either
1254does not support or had some error in processing both the MII register
1255and ethtool requests), then the MII monitor will assume the link is
1256up.
1257
Auke Kok6224e012006-06-08 11:15:35 -070012588. Potential Sources of Trouble
Linus Torvalds1da177e2005-04-16 15:20:36 -07001259===============================
1260
Auke Kok6224e012006-06-08 11:15:35 -070012618.1 Adventures in Routing
Linus Torvalds1da177e2005-04-16 15:20:36 -07001262-------------------------
1263
1264 When bonding is configured, it is important that the slave
Auke Kok6224e012006-06-08 11:15:35 -07001265devices not have routes that supersede routes of the master (or,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001266generally, not have routes at all). For example, suppose the bonding
1267device bond0 has two slaves, eth0 and eth1, and the routing table is
1268as follows:
1269
1270Kernel IP routing table
1271Destination Gateway Genmask Flags MSS Window irtt Iface
127210.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 eth0
127310.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 eth1
127410.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 bond0
1275127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
1276
1277 This routing configuration will likely still update the
1278receive/transmit times in the driver (needed by the ARP monitor), but
1279may bypass the bonding driver (because outgoing traffic to, in this
1280case, another host on network 10 would use eth0 or eth1 before bond0).
1281
1282 The ARP monitor (and ARP itself) may become confused by this
1283configuration, because ARP requests (generated by the ARP monitor)
1284will be sent on one interface (bond0), but the corresponding reply
1285will arrive on a different interface (eth0). This reply looks to ARP
1286as an unsolicited ARP reply (because ARP matches replies on an
1287interface basis), and is discarded. The MII monitor is not affected
1288by the state of the routing table.
1289
1290 The solution here is simply to insure that slaves do not have
1291routes of their own, and if for some reason they must, those routes do
Auke Kok6224e012006-06-08 11:15:35 -07001292not supersede routes of their master. This should generally be the
Linus Torvalds1da177e2005-04-16 15:20:36 -07001293case, but unusual configurations or errant manual or automatic static
1294route additions may cause trouble.
1295
Auke Kok6224e012006-06-08 11:15:35 -070012968.2 Ethernet Device Renaming
Linus Torvalds1da177e2005-04-16 15:20:36 -07001297----------------------------
1298
1299 On systems with network configuration scripts that do not
1300associate physical devices directly with network interface names (so
1301that the same physical device always has the same "ethX" name), it may
1302be necessary to add some special logic to either /etc/modules.conf or
1303/etc/modprobe.conf (depending upon which is installed on the system).
1304
1305 For example, given a modules.conf containing the following:
1306
1307alias bond0 bonding
1308options bond0 mode=some-mode miimon=50
1309alias eth0 tg3
1310alias eth1 tg3
1311alias eth2 e1000
1312alias eth3 e1000
1313
1314 If neither eth0 and eth1 are slaves to bond0, then when the
1315bond0 interface comes up, the devices may end up reordered. This
1316happens because bonding is loaded first, then its slave device's
1317drivers are loaded next. Since no other drivers have been loaded,
1318when the e1000 driver loads, it will receive eth0 and eth1 for its
1319devices, but the bonding configuration tries to enslave eth2 and eth3
1320(which may later be assigned to the tg3 devices).
1321
1322 Adding the following:
1323
1324add above bonding e1000 tg3
1325
1326 causes modprobe to load e1000 then tg3, in that order, when
1327bonding is loaded. This command is fully documented in the
1328modules.conf manual page.
1329
1330 On systems utilizing modprobe.conf (or modprobe.conf.local),
1331an equivalent problem can occur. In this case, the following can be
1332added to modprobe.conf (or modprobe.conf.local, as appropriate), as
1333follows (all on one line; it has been split here for clarity):
1334
1335install bonding /sbin/modprobe tg3; /sbin/modprobe e1000;
1336 /sbin/modprobe --ignore-install bonding
1337
1338 This will, when loading the bonding module, rather than
1339performing the normal action, instead execute the provided command.
1340This command loads the device drivers in the order needed, then calls
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001341modprobe with --ignore-install to cause the normal action to then take
Linus Torvalds1da177e2005-04-16 15:20:36 -07001342place. Full documentation on this can be found in the modprobe.conf
1343and modprobe manual pages.
1344
Auke Kok6224e012006-06-08 11:15:35 -070013458.3. Painfully Slow Or No Failed Link Detection By Miimon
Linus Torvalds1da177e2005-04-16 15:20:36 -07001346---------------------------------------------------------
1347
1348 By default, bonding enables the use_carrier option, which
1349instructs bonding to trust the driver to maintain carrier state.
1350
1351 As discussed in the options section, above, some drivers do
1352not support the netif_carrier_on/_off link state tracking system.
1353With use_carrier enabled, bonding will always see these links as up,
1354regardless of their actual state.
1355
1356 Additionally, other drivers do support netif_carrier, but do
1357not maintain it in real time, e.g., only polling the link state at
1358some fixed interval. In this case, miimon will detect failures, but
1359only after some long period of time has expired. If it appears that
1360miimon is very slow in detecting link failures, try specifying
1361use_carrier=0 to see if that improves the failure detection time. If
1362it does, then it may be that the driver checks the carrier state at a
1363fixed interval, but does not cache the MII register values (so the
1364use_carrier=0 method of querying the registers directly works). If
1365use_carrier=0 does not improve the failover, then the driver may cache
1366the registers, or the problem may be elsewhere.
1367
1368 Also, remember that miimon only checks for the device's
1369carrier state. It has no way to determine the state of devices on or
1370beyond other ports of a switch, or if a switch is refusing to pass
1371traffic while still maintaining carrier on.
1372
Auke Kok6224e012006-06-08 11:15:35 -070013739. SNMP agents
Linus Torvalds1da177e2005-04-16 15:20:36 -07001374===============
1375
1376 If running SNMP agents, the bonding driver should be loaded
1377before any network drivers participating in a bond. This requirement
Tobias Klauserd533f672005-09-10 00:26:46 -07001378is due to the interface index (ipAdEntIfIndex) being associated to
Linus Torvalds1da177e2005-04-16 15:20:36 -07001379the first interface found with a given IP address. That is, there is
1380only one ipAdEntIfIndex for each IP address. For example, if eth0 and
1381eth1 are slaves of bond0 and the driver for eth0 is loaded before the
1382bonding driver, the interface for the IP address will be associated
1383with the eth0 interface. This configuration is shown below, the IP
1384address 192.168.1.1 has an interface index of 2 which indexes to eth0
1385in the ifDescr table (ifDescr.2).
1386
1387 interfaces.ifTable.ifEntry.ifDescr.1 = lo
1388 interfaces.ifTable.ifEntry.ifDescr.2 = eth0
1389 interfaces.ifTable.ifEntry.ifDescr.3 = eth1
1390 interfaces.ifTable.ifEntry.ifDescr.4 = eth2
1391 interfaces.ifTable.ifEntry.ifDescr.5 = eth3
1392 interfaces.ifTable.ifEntry.ifDescr.6 = bond0
1393 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 5
1394 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
1395 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 4
1396 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
1397
1398 This problem is avoided by loading the bonding driver before
1399any network drivers participating in a bond. Below is an example of
1400loading the bonding driver first, the IP address 192.168.1.1 is
1401correctly associated with ifDescr.2.
1402
1403 interfaces.ifTable.ifEntry.ifDescr.1 = lo
1404 interfaces.ifTable.ifEntry.ifDescr.2 = bond0
1405 interfaces.ifTable.ifEntry.ifDescr.3 = eth0
1406 interfaces.ifTable.ifEntry.ifDescr.4 = eth1
1407 interfaces.ifTable.ifEntry.ifDescr.5 = eth2
1408 interfaces.ifTable.ifEntry.ifDescr.6 = eth3
1409 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 6
1410 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
1411 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 5
1412 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
1413
1414 While some distributions may not report the interface name in
1415ifDescr, the association between the IP address and IfIndex remains
1416and SNMP functions such as Interface_Scan_Next will report that
1417association.
1418
Auke Kok6224e012006-06-08 11:15:35 -0700141910. Promiscuous mode
Linus Torvalds1da177e2005-04-16 15:20:36 -07001420====================
1421
1422 When running network monitoring tools, e.g., tcpdump, it is
1423common to enable promiscuous mode on the device, so that all traffic
1424is seen (instead of seeing only traffic destined for the local host).
1425The bonding driver handles promiscuous mode changes to the bonding
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001426master device (e.g., bond0), and propagates the setting to the slave
Linus Torvalds1da177e2005-04-16 15:20:36 -07001427devices.
1428
1429 For the balance-rr, balance-xor, broadcast, and 802.3ad modes,
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001430the promiscuous mode setting is propagated to all slaves.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001431
1432 For the active-backup, balance-tlb and balance-alb modes, the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001433promiscuous mode setting is propagated only to the active slave.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001434
1435 For balance-tlb mode, the active slave is the slave currently
1436receiving inbound traffic.
1437
1438 For balance-alb mode, the active slave is the slave used as a
1439"primary." This slave is used for mode-specific control traffic, for
1440sending to peers that are unassigned or if the load is unbalanced.
1441
1442 For the active-backup, balance-tlb and balance-alb modes, when
1443the active slave changes (e.g., due to a link failure), the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001444promiscuous setting will be propagated to the new active slave.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001445
Auke Kok6224e012006-06-08 11:15:35 -0700144611. Configuring Bonding for High Availability
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001447=============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -07001448
1449 High Availability refers to configurations that provide
1450maximum network availability by having redundant or backup devices,
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001451links or switches between the host and the rest of the world. The
1452goal is to provide the maximum availability of network connectivity
1453(i.e., the network always works), even though other configurations
1454could provide higher throughput.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001455
Auke Kok6224e012006-06-08 11:15:35 -0700145611.1 High Availability in a Single Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -07001457--------------------------------------------------
1458
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001459 If two hosts (or a host and a single switch) are directly
1460connected via multiple physical links, then there is no availability
1461penalty to optimizing for maximum bandwidth. In this case, there is
1462only one switch (or peer), so if it fails, there is no alternative
1463access to fail over to. Additionally, the bonding load balance modes
1464support link monitoring of their members, so if individual links fail,
1465the load will be rebalanced across the remaining devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001466
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001467 See Section 13, "Configuring Bonding for Maximum Throughput"
1468for information on configuring bonding with one peer device.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001469
Auke Kok6224e012006-06-08 11:15:35 -0700147011.2 High Availability in a Multiple Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -07001471----------------------------------------------------
1472
1473 With multiple switches, the configuration of bonding and the
1474network changes dramatically. In multiple switch topologies, there is
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001475a trade off between network availability and usable bandwidth.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001476
1477 Below is a sample network, configured to maximize the
1478availability of the network:
1479
1480 | |
1481 |port3 port3|
1482 +-----+----+ +-----+----+
1483 | |port2 ISL port2| |
1484 | switch A +--------------------------+ switch B |
1485 | | | |
1486 +-----+----+ +-----++---+
1487 |port1 port1|
1488 | +-------+ |
1489 +-------------+ host1 +---------------+
1490 eth0 +-------+ eth1
1491
1492 In this configuration, there is a link between the two
1493switches (ISL, or inter switch link), and multiple ports connecting to
1494the outside world ("port3" on each switch). There is no technical
1495reason that this could not be extended to a third switch.
1496
Auke Kok6224e012006-06-08 11:15:35 -0700149711.2.1 HA Bonding Mode Selection for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001498-------------------------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001499
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001500 In a topology such as the example above, the active-backup and
1501broadcast modes are the only useful bonding modes when optimizing for
1502availability; the other modes require all links to terminate on the
1503same peer for them to behave rationally.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001504
1505active-backup: This is generally the preferred mode, particularly if
1506 the switches have an ISL and play together well. If the
1507 network configuration is such that one switch is specifically
1508 a backup switch (e.g., has lower capacity, higher cost, etc),
1509 then the primary option can be used to insure that the
1510 preferred link is always used when it is available.
1511
1512broadcast: This mode is really a special purpose mode, and is suitable
1513 only for very specific needs. For example, if the two
1514 switches are not connected (no ISL), and the networks beyond
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001515 them are totally independent. In this case, if it is
Linus Torvalds1da177e2005-04-16 15:20:36 -07001516 necessary for some specific one-way traffic to reach both
1517 independent networks, then the broadcast mode may be suitable.
1518
Auke Kok6224e012006-06-08 11:15:35 -0700151911.2.2 HA Link Monitoring Selection for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001520----------------------------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001521
1522 The choice of link monitoring ultimately depends upon your
1523switch. If the switch can reliably fail ports in response to other
1524failures, then either the MII or ARP monitors should work. For
1525example, in the above example, if the "port3" link fails at the remote
1526end, the MII monitor has no direct means to detect this. The ARP
1527monitor could be configured with a target at the remote end of port3,
1528thus detecting that failure without switch support.
1529
1530 In general, however, in a multiple switch topology, the ARP
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001531monitor can provide a higher level of reliability in detecting end to
1532end connectivity failures (which may be caused by the failure of any
1533individual component to pass traffic for any reason). Additionally,
1534the ARP monitor should be configured with multiple targets (at least
1535one for each switch in the network). This will insure that,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001536regardless of which switch is active, the ARP monitor has a suitable
1537target to query.
1538
1539
Auke Kok6224e012006-06-08 11:15:35 -0700154012. Configuring Bonding for Maximum Throughput
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001541==============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -07001542
Auke Kok6224e012006-06-08 11:15:35 -0700154312.1 Maximizing Throughput in a Single Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001544------------------------------------------------------
1545
1546 In a single switch configuration, the best method to maximize
1547throughput depends upon the application and network environment. The
1548various load balancing modes each have strengths and weaknesses in
1549different environments, as detailed below.
1550
1551 For this discussion, we will break down the topologies into
1552two categories. Depending upon the destination of most traffic, we
1553categorize them into either "gatewayed" or "local" configurations.
1554
1555 In a gatewayed configuration, the "switch" is acting primarily
1556as a router, and the majority of traffic passes through this router to
1557other networks. An example would be the following:
1558
1559
1560 +----------+ +----------+
1561 | |eth0 port1| | to other networks
1562 | Host A +---------------------+ router +------------------->
1563 | +---------------------+ | Hosts B and C are out
1564 | |eth1 port2| | here somewhere
1565 +----------+ +----------+
1566
1567 The router may be a dedicated router device, or another host
1568acting as a gateway. For our discussion, the important point is that
1569the majority of traffic from Host A will pass through the router to
1570some other network before reaching its final destination.
1571
1572 In a gatewayed network configuration, although Host A may
1573communicate with many other systems, all of its traffic will be sent
1574and received via one other peer on the local network, the router.
1575
1576 Note that the case of two systems connected directly via
1577multiple physical links is, for purposes of configuring bonding, the
1578same as a gatewayed configuration. In that case, it happens that all
1579traffic is destined for the "gateway" itself, not some other network
1580beyond the gateway.
1581
1582 In a local configuration, the "switch" is acting primarily as
1583a switch, and the majority of traffic passes through this switch to
1584reach other stations on the same network. An example would be the
1585following:
1586
1587 +----------+ +----------+ +--------+
1588 | |eth0 port1| +-------+ Host B |
1589 | Host A +------------+ switch |port3 +--------+
1590 | +------------+ | +--------+
1591 | |eth1 port2| +------------------+ Host C |
1592 +----------+ +----------+port4 +--------+
1593
1594
1595 Again, the switch may be a dedicated switch device, or another
1596host acting as a gateway. For our discussion, the important point is
1597that the majority of traffic from Host A is destined for other hosts
1598on the same local network (Hosts B and C in the above example).
1599
1600 In summary, in a gatewayed configuration, traffic to and from
1601the bonded device will be to the same MAC level peer on the network
1602(the gateway itself, i.e., the router), regardless of its final
1603destination. In a local configuration, traffic flows directly to and
1604from the final destinations, thus, each destination (Host B, Host C)
1605will be addressed directly by their individual MAC addresses.
1606
1607 This distinction between a gatewayed and a local network
1608configuration is important because many of the load balancing modes
1609available use the MAC addresses of the local network source and
1610destination to make load balancing decisions. The behavior of each
1611mode is described below.
1612
1613
Auke Kok6224e012006-06-08 11:15:35 -0700161412.1.1 MT Bonding Mode Selection for Single Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001615-----------------------------------------------------------
1616
1617 This configuration is the easiest to set up and to understand,
1618although you will have to decide which bonding mode best suits your
1619needs. The trade offs for each mode are detailed below:
1620
1621balance-rr: This mode is the only mode that will permit a single
1622 TCP/IP connection to stripe traffic across multiple
1623 interfaces. It is therefore the only mode that will allow a
1624 single TCP/IP stream to utilize more than one interface's
1625 worth of throughput. This comes at a cost, however: the
1626 striping often results in peer systems receiving packets out
1627 of order, causing TCP/IP's congestion control system to kick
1628 in, often by retransmitting segments.
1629
1630 It is possible to adjust TCP/IP's congestion limits by
1631 altering the net.ipv4.tcp_reordering sysctl parameter. The
1632 usual default value is 3, and the maximum useful value is 127.
1633 For a four interface balance-rr bond, expect that a single
1634 TCP/IP stream will utilize no more than approximately 2.3
1635 interface's worth of throughput, even after adjusting
1636 tcp_reordering.
1637
1638 Note that this out of order delivery occurs when both the
1639 sending and receiving systems are utilizing a multiple
1640 interface bond. Consider a configuration in which a
1641 balance-rr bond feeds into a single higher capacity network
1642 channel (e.g., multiple 100Mb/sec ethernets feeding a single
1643 gigabit ethernet via an etherchannel capable switch). In this
1644 configuration, traffic sent from the multiple 100Mb devices to
1645 a destination connected to the gigabit device will not see
1646 packets out of order. However, traffic sent from the gigabit
1647 device to the multiple 100Mb devices may or may not see
1648 traffic out of order, depending upon the balance policy of the
1649 switch. Many switches do not support any modes that stripe
1650 traffic (instead choosing a port based upon IP or MAC level
1651 addresses); for those devices, traffic flowing from the
1652 gigabit device to the many 100Mb devices will only utilize one
1653 interface.
1654
1655 If you are utilizing protocols other than TCP/IP, UDP for
1656 example, and your application can tolerate out of order
1657 delivery, then this mode can allow for single stream datagram
1658 performance that scales near linearly as interfaces are added
1659 to the bond.
1660
1661 This mode requires the switch to have the appropriate ports
1662 configured for "etherchannel" or "trunking."
1663
1664active-backup: There is not much advantage in this network topology to
1665 the active-backup mode, as the inactive backup devices are all
1666 connected to the same peer as the primary. In this case, a
1667 load balancing mode (with link monitoring) will provide the
1668 same level of network availability, but with increased
1669 available bandwidth. On the plus side, active-backup mode
1670 does not require any configuration of the switch, so it may
1671 have value if the hardware available does not support any of
1672 the load balance modes.
1673
1674balance-xor: This mode will limit traffic such that packets destined
1675 for specific peers will always be sent over the same
1676 interface. Since the destination is determined by the MAC
1677 addresses involved, this mode works best in a "local" network
1678 configuration (as described above), with destinations all on
1679 the same local network. This mode is likely to be suboptimal
1680 if all your traffic is passed through a single router (i.e., a
1681 "gatewayed" network configuration, as described above).
1682
1683 As with balance-rr, the switch ports need to be configured for
1684 "etherchannel" or "trunking."
1685
1686broadcast: Like active-backup, there is not much advantage to this
1687 mode in this type of network topology.
1688
1689802.3ad: This mode can be a good choice for this type of network
1690 topology. The 802.3ad mode is an IEEE standard, so all peers
1691 that implement 802.3ad should interoperate well. The 802.3ad
1692 protocol includes automatic configuration of the aggregates,
1693 so minimal manual configuration of the switch is needed
1694 (typically only to designate that some set of devices is
1695 available for 802.3ad). The 802.3ad standard also mandates
1696 that frames be delivered in order (within certain limits), so
1697 in general single connections will not see misordering of
1698 packets. The 802.3ad mode does have some drawbacks: the
1699 standard mandates that all devices in the aggregate operate at
1700 the same speed and duplex. Also, as with all bonding load
1701 balance modes other than balance-rr, no single connection will
1702 be able to utilize more than a single interface's worth of
1703 bandwidth.
1704
1705 Additionally, the linux bonding 802.3ad implementation
1706 distributes traffic by peer (using an XOR of MAC addresses),
1707 so in a "gatewayed" configuration, all outgoing traffic will
1708 generally use the same device. Incoming traffic may also end
1709 up on a single device, but that is dependent upon the
1710 balancing policy of the peer's 8023.ad implementation. In a
1711 "local" configuration, traffic will be distributed across the
1712 devices in the bond.
1713
1714 Finally, the 802.3ad mode mandates the use of the MII monitor,
1715 therefore, the ARP monitor is not available in this mode.
1716
1717balance-tlb: The balance-tlb mode balances outgoing traffic by peer.
1718 Since the balancing is done according to MAC address, in a
1719 "gatewayed" configuration (as described above), this mode will
1720 send all traffic across a single device. However, in a
1721 "local" network configuration, this mode balances multiple
1722 local network peers across devices in a vaguely intelligent
1723 manner (not a simple XOR as in balance-xor or 802.3ad mode),
1724 so that mathematically unlucky MAC addresses (i.e., ones that
1725 XOR to the same value) will not all "bunch up" on a single
1726 interface.
1727
1728 Unlike 802.3ad, interfaces may be of differing speeds, and no
1729 special switch configuration is required. On the down side,
1730 in this mode all incoming traffic arrives over a single
1731 interface, this mode requires certain ethtool support in the
1732 network device driver of the slave interfaces, and the ARP
1733 monitor is not available.
1734
1735balance-alb: This mode is everything that balance-tlb is, and more.
1736 It has all of the features (and restrictions) of balance-tlb,
1737 and will also balance incoming traffic from local network
1738 peers (as described in the Bonding Module Options section,
1739 above).
1740
1741 The only additional down side to this mode is that the network
1742 device driver must support changing the hardware address while
1743 the device is open.
1744
Auke Kok6224e012006-06-08 11:15:35 -0700174512.1.2 MT Link Monitoring for Single Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001746----------------------------------------------------
1747
1748 The choice of link monitoring may largely depend upon which
1749mode you choose to use. The more advanced load balancing modes do not
1750support the use of the ARP monitor, and are thus restricted to using
1751the MII monitor (which does not provide as high a level of end to end
1752assurance as the ARP monitor).
1753
Auke Kok6224e012006-06-08 11:15:35 -0700175412.2 Maximum Throughput in a Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001755-----------------------------------------------------
1756
1757 Multiple switches may be utilized to optimize for throughput
1758when they are configured in parallel as part of an isolated network
1759between two or more systems, for example:
1760
1761 +-----------+
1762 | Host A |
1763 +-+---+---+-+
1764 | | |
1765 +--------+ | +---------+
1766 | | |
1767 +------+---+ +-----+----+ +-----+----+
1768 | Switch A | | Switch B | | Switch C |
1769 +------+---+ +-----+----+ +-----+----+
1770 | | |
1771 +--------+ | +---------+
1772 | | |
1773 +-+---+---+-+
1774 | Host B |
1775 +-----------+
1776
1777 In this configuration, the switches are isolated from one
1778another. One reason to employ a topology such as this is for an
1779isolated network with many hosts (a cluster configured for high
1780performance, for example), using multiple smaller switches can be more
1781cost effective than a single larger switch, e.g., on a network with 24
1782hosts, three 24 port switches can be significantly less expensive than
1783a single 72 port switch.
1784
1785 If access beyond the network is required, an individual host
1786can be equipped with an additional network device connected to an
1787external network; this host then additionally acts as a gateway.
1788
Auke Kok6224e012006-06-08 11:15:35 -0700178912.2.1 MT Bonding Mode Selection for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001790-------------------------------------------------------------
1791
1792 In actual practice, the bonding mode typically employed in
1793configurations of this type is balance-rr. Historically, in this
1794network configuration, the usual caveats about out of order packet
1795delivery are mitigated by the use of network adapters that do not do
1796any kind of packet coalescing (via the use of NAPI, or because the
1797device itself does not generate interrupts until some number of
1798packets has arrived). When employed in this fashion, the balance-rr
1799mode allows individual connections between two hosts to effectively
1800utilize greater than one interface's bandwidth.
1801
Auke Kok6224e012006-06-08 11:15:35 -0700180212.2.2 MT Link Monitoring for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001803------------------------------------------------------
1804
1805 Again, in actual practice, the MII monitor is most often used
1806in this configuration, as performance is given preference over
1807availability. The ARP monitor will function in this topology, but its
1808advantages over the MII monitor are mitigated by the volume of probes
1809needed as the number of systems involved grows (remember that each
1810host in the network is configured with bonding).
1811
Auke Kok6224e012006-06-08 11:15:35 -0700181213. Switch Behavior Issues
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001813==========================
1814
Auke Kok6224e012006-06-08 11:15:35 -0700181513.1 Link Establishment and Failover Delays
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001816-------------------------------------------
1817
1818 Some switches exhibit undesirable behavior with regard to the
1819timing of link up and down reporting by the switch.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001820
1821 First, when a link comes up, some switches may indicate that
1822the link is up (carrier available), but not pass traffic over the
1823interface for some period of time. This delay is typically due to
1824some type of autonegotiation or routing protocol, but may also occur
1825during switch initialization (e.g., during recovery after a switch
1826failure). If you find this to be a problem, specify an appropriate
1827value to the updelay bonding module option to delay the use of the
1828relevant interface(s).
1829
1830 Second, some switches may "bounce" the link state one or more
1831times while a link is changing state. This occurs most commonly while
1832the switch is initializing. Again, an appropriate updelay value may
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001833help.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001834
1835 Note that when a bonding interface has no active links, the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001836driver will immediately reuse the first link that goes up, even if the
1837updelay parameter has been specified (the updelay is ignored in this
1838case). If there are slave interfaces waiting for the updelay timeout
1839to expire, the interface that first went into that state will be
1840immediately reused. This reduces down time of the network if the
1841value of updelay has been overestimated, and since this occurs only in
1842cases with no connectivity, there is no additional penalty for
1843ignoring the updelay.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001844
1845 In addition to the concerns about switch timings, if your
1846switches take a long time to go into backup mode, it may be desirable
1847to not activate a backup interface immediately after a link goes down.
1848Failover may be delayed via the downdelay bonding module option.
1849
Auke Kok6224e012006-06-08 11:15:35 -0700185013.2 Duplicated Incoming Packets
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001851--------------------------------
1852
1853 It is not uncommon to observe a short burst of duplicated
1854traffic when the bonding device is first used, or after it has been
1855idle for some period of time. This is most easily observed by issuing
1856a "ping" to some other host on the network, and noticing that the
1857output from ping flags duplicates (typically one per slave).
1858
1859 For example, on a bond in active-backup mode with five slaves
1860all connected to one switch, the output may appear as follows:
1861
1862# ping -n 10.0.4.2
1863PING 10.0.4.2 (10.0.4.2) from 10.0.3.10 : 56(84) bytes of data.
186464 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.7 ms
186564 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
186664 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
186764 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
186864 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
186964 bytes from 10.0.4.2: icmp_seq=2 ttl=64 time=0.216 ms
187064 bytes from 10.0.4.2: icmp_seq=3 ttl=64 time=0.267 ms
187164 bytes from 10.0.4.2: icmp_seq=4 ttl=64 time=0.222 ms
1872
1873 This is not due to an error in the bonding driver, rather, it
1874is a side effect of how many switches update their MAC forwarding
1875tables. Initially, the switch does not associate the MAC address in
1876the packet with a particular switch port, and so it may send the
1877traffic to all ports until its MAC forwarding table is updated. Since
1878the interfaces attached to the bond may occupy multiple ports on a
1879single switch, when the switch (temporarily) floods the traffic to all
1880ports, the bond device receives multiple copies of the same packet
1881(one per slave device).
1882
1883 The duplicated packet behavior is switch dependent, some
1884switches exhibit this, and some do not. On switches that display this
1885behavior, it can be induced by clearing the MAC forwarding table (on
1886most Cisco switches, the privileged command "clear mac address-table
1887dynamic" will accomplish this).
1888
Auke Kok6224e012006-06-08 11:15:35 -0700188914. Hardware Specific Considerations
Linus Torvalds1da177e2005-04-16 15:20:36 -07001890====================================
1891
1892 This section contains additional information for configuring
1893bonding on specific hardware platforms, or for interfacing bonding
1894with particular switches or other devices.
1895
Auke Kok6224e012006-06-08 11:15:35 -0700189614.1 IBM BladeCenter
Linus Torvalds1da177e2005-04-16 15:20:36 -07001897--------------------
1898
1899 This applies to the JS20 and similar systems.
1900
1901 On the JS20 blades, the bonding driver supports only
1902balance-rr, active-backup, balance-tlb and balance-alb modes. This is
1903largely due to the network topology inside the BladeCenter, detailed
1904below.
1905
1906JS20 network adapter information
1907--------------------------------
1908
1909 All JS20s come with two Broadcom Gigabit Ethernet ports
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001910integrated on the planar (that's "motherboard" in IBM-speak). In the
1911BladeCenter chassis, the eth0 port of all JS20 blades is hard wired to
1912I/O Module #1; similarly, all eth1 ports are wired to I/O Module #2.
1913An add-on Broadcom daughter card can be installed on a JS20 to provide
1914two more Gigabit Ethernet ports. These ports, eth2 and eth3, are
1915wired to I/O Modules 3 and 4, respectively.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001916
1917 Each I/O Module may contain either a switch or a passthrough
1918module (which allows ports to be directly connected to an external
1919switch). Some bonding modes require a specific BladeCenter internal
1920network topology in order to function; these are detailed below.
1921
1922 Additional BladeCenter-specific networking information can be
1923found in two IBM Redbooks (www.ibm.com/redbooks):
1924
1925"IBM eServer BladeCenter Networking Options"
1926"IBM eServer BladeCenter Layer 2-7 Network Switching"
1927
1928BladeCenter networking configuration
1929------------------------------------
1930
1931 Because a BladeCenter can be configured in a very large number
1932of ways, this discussion will be confined to describing basic
1933configurations.
1934
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001935 Normally, Ethernet Switch Modules (ESMs) are used in I/O
Linus Torvalds1da177e2005-04-16 15:20:36 -07001936modules 1 and 2. In this configuration, the eth0 and eth1 ports of a
1937JS20 will be connected to different internal switches (in the
1938respective I/O modules).
1939
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001940 A passthrough module (OPM or CPM, optical or copper,
1941passthrough module) connects the I/O module directly to an external
1942switch. By using PMs in I/O module #1 and #2, the eth0 and eth1
1943interfaces of a JS20 can be redirected to the outside world and
1944connected to a common external switch.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001945
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001946 Depending upon the mix of ESMs and PMs, the network will
1947appear to bonding as either a single switch topology (all PMs) or as a
1948multiple switch topology (one or more ESMs, zero or more PMs). It is
1949also possible to connect ESMs together, resulting in a configuration
1950much like the example in "High Availability in a Multiple Switch
1951Topology," above.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001952
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001953Requirements for specific modes
1954-------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001955
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001956 The balance-rr mode requires the use of passthrough modules
1957for devices in the bond, all connected to an common external switch.
1958That switch must be configured for "etherchannel" or "trunking" on the
Linus Torvalds1da177e2005-04-16 15:20:36 -07001959appropriate ports, as is usual for balance-rr.
1960
1961 The balance-alb and balance-tlb modes will function with
1962either switch modules or passthrough modules (or a mix). The only
1963specific requirement for these modes is that all network interfaces
1964must be able to reach all destinations for traffic sent over the
1965bonding device (i.e., the network must converge at some point outside
1966the BladeCenter).
1967
1968 The active-backup mode has no additional requirements.
1969
1970Link monitoring issues
1971----------------------
1972
1973 When an Ethernet Switch Module is in place, only the ARP
1974monitor will reliably detect link loss to an external switch. This is
1975nothing unusual, but examination of the BladeCenter cabinet would
1976suggest that the "external" network ports are the ethernet ports for
1977the system, when it fact there is a switch between these "external"
1978ports and the devices on the JS20 system itself. The MII monitor is
1979only able to detect link failures between the ESM and the JS20 system.
1980
1981 When a passthrough module is in place, the MII monitor does
1982detect failures to the "external" port, which is then directly
1983connected to the JS20 system.
1984
1985Other concerns
1986--------------
1987
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001988 The Serial Over LAN (SoL) link is established over the primary
Linus Torvalds1da177e2005-04-16 15:20:36 -07001989ethernet (eth0) only, therefore, any loss of link to eth0 will result
1990in losing your SoL connection. It will not fail over with other
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001991network traffic, as the SoL system is beyond the control of the
1992bonding driver.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001993
1994 It may be desirable to disable spanning tree on the switch
1995(either the internal Ethernet Switch Module, or an external switch) to
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001996avoid fail-over delay issues when using bonding.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001997
1998
Auke Kok6224e012006-06-08 11:15:35 -0700199915. Frequently Asked Questions
Linus Torvalds1da177e2005-04-16 15:20:36 -07002000==============================
2001
20021. Is it SMP safe?
2003
2004 Yes. The old 2.0.xx channel bonding patch was not SMP safe.
2005The new driver was designed to be SMP safe from the start.
2006
20072. What type of cards will work with it?
2008
2009 Any Ethernet type cards (you can even mix cards - a Intel
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002010EtherExpress PRO/100 and a 3com 3c905b, for example). For most modes,
2011devices need not be of the same speed.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002012
20133. How many bonding devices can I have?
2014
2015 There is no limit.
2016
20174. How many slaves can a bonding device have?
2018
2019 This is limited only by the number of network interfaces Linux
2020supports and/or the number of network cards you can place in your
2021system.
2022
20235. What happens when a slave link dies?
2024
2025 If link monitoring is enabled, then the failing device will be
2026disabled. The active-backup mode will fail over to a backup link, and
2027other modes will ignore the failed link. The link will continue to be
2028monitored, and should it recover, it will rejoin the bond (in whatever
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002029manner is appropriate for the mode). See the sections on High
2030Availability and the documentation for each mode for additional
2031information.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002032
2033 Link monitoring can be enabled via either the miimon or
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002034arp_interval parameters (described in the module parameters section,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002035above). In general, miimon monitors the carrier state as sensed by
2036the underlying network device, and the arp monitor (arp_interval)
2037monitors connectivity to another host on the local network.
2038
2039 If no link monitoring is configured, the bonding driver will
2040be unable to detect link failures, and will assume that all links are
2041always available. This will likely result in lost packets, and a
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002042resulting degradation of performance. The precise performance loss
Linus Torvalds1da177e2005-04-16 15:20:36 -07002043depends upon the bonding mode and network configuration.
2044
20456. Can bonding be used for High Availability?
2046
2047 Yes. See the section on High Availability for details.
2048
20497. Which switches/systems does it work with?
2050
2051 The full answer to this depends upon the desired mode.
2052
2053 In the basic balance modes (balance-rr and balance-xor), it
2054works with any system that supports etherchannel (also called
2055trunking). Most managed switches currently available have such
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002056support, and many unmanaged switches as well.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002057
2058 The advanced balance modes (balance-tlb and balance-alb) do
2059not have special switch requirements, but do need device drivers that
2060support specific features (described in the appropriate section under
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002061module parameters, above).
Linus Torvalds1da177e2005-04-16 15:20:36 -07002062
Auke Kok6224e012006-06-08 11:15:35 -07002063 In 802.3ad mode, it works with systems that support IEEE
Linus Torvalds1da177e2005-04-16 15:20:36 -07002064802.3ad Dynamic Link Aggregation. Most managed and many unmanaged
2065switches currently available support 802.3ad.
2066
2067 The active-backup mode should work with any Layer-II switch.
2068
20698. Where does a bonding device get its MAC address from?
2070
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002071 If not explicitly configured (with ifconfig or ip link), the
2072MAC address of the bonding device is taken from its first slave
2073device. This MAC address is then passed to all following slaves and
Tobias Klauserd533f672005-09-10 00:26:46 -07002074remains persistent (even if the first slave is removed) until the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002075bonding device is brought down or reconfigured.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002076
2077 If you wish to change the MAC address, you can set it with
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002078ifconfig or ip link:
Linus Torvalds1da177e2005-04-16 15:20:36 -07002079
2080# ifconfig bond0 hw ether 00:11:22:33:44:55
2081
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002082# ip link set bond0 address 66:77:88:99:aa:bb
2083
Linus Torvalds1da177e2005-04-16 15:20:36 -07002084 The MAC address can be also changed by bringing down/up the
2085device and then changing its slaves (or their order):
2086
2087# ifconfig bond0 down ; modprobe -r bonding
2088# ifconfig bond0 .... up
2089# ifenslave bond0 eth...
2090
2091 This method will automatically take the address from the next
2092slave that is added.
2093
2094 To restore your slaves' MAC addresses, you need to detach them
2095from the bond (`ifenslave -d bond0 eth0'). The bonding driver will
2096then restore the MAC addresses that the slaves had before they were
2097enslaved.
2098
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700209916. Resources and Links
Linus Torvalds1da177e2005-04-16 15:20:36 -07002100=======================
2101
2102The latest version of the bonding driver can be found in the latest
2103version of the linux kernel, found on http://kernel.org
2104
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002105The latest version of this document can be found in either the latest
2106kernel source (named Documentation/networking/bonding.txt), or on the
2107bonding sourceforge site:
2108
2109http://www.sourceforge.net/projects/bonding
2110
Linus Torvalds1da177e2005-04-16 15:20:36 -07002111Discussions regarding the bonding driver take place primarily on the
2112bonding-devel mailing list, hosted at sourceforge.net. If you have
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002113questions or problems, post them to the list. The list address is:
Linus Torvalds1da177e2005-04-16 15:20:36 -07002114
2115bonding-devel@lists.sourceforge.net
2116
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002117 The administrative interface (to subscribe or unsubscribe) can
2118be found at:
2119
Linus Torvalds1da177e2005-04-16 15:20:36 -07002120https://lists.sourceforge.net/lists/listinfo/bonding-devel
2121
Linus Torvalds1da177e2005-04-16 15:20:36 -07002122Donald Becker's Ethernet Drivers and diag programs may be found at :
2123 - http://www.scyld.com/network/
2124
2125You will also find a lot of information regarding Ethernet, NWay, MII,
2126etc. at www.scyld.com.
2127
2128-- END --