blob: 5dd960d751743ba8a49b7e28c69628cf00807930 [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
Ben Hutchingsad246c92011-04-26 15:25:52 +00004 Latest update: 27 April 2011
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
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +0000523.5 Configuration with Interfaces Support
533.6 Overriding Configuration for Special Cases
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
Auke Kok6224e012006-06-08 11:15:35 -0700554. Querying Bonding Configuration
564.1 Bonding Configuration
574.2 Network Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Auke Kok6224e012006-06-08 11:15:35 -0700595. Switch Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
Auke Kok6224e012006-06-08 11:15:35 -0700616. 802.1q VLAN Support
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Auke Kok6224e012006-06-08 11:15:35 -0700637. Link Monitoring
647.1 ARP Monitor Operation
657.2 Configuring Multiple ARP Targets
667.3 MII Monitor Operation
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Auke Kok6224e012006-06-08 11:15:35 -0700688. Potential Trouble Sources
698.1 Adventures in Routing
708.2 Ethernet Device Renaming
718.3 Painfully Slow Or No Failed Link Detection By Miimon
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Auke Kok6224e012006-06-08 11:15:35 -0700739. SNMP agents
Linus Torvalds1da177e2005-04-16 15:20:36 -070074
Auke Kok6224e012006-06-08 11:15:35 -07007510. Promiscuous mode
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
Auke Kok6224e012006-06-08 11:15:35 -07007711. Configuring Bonding for High Availability
7811.1 High Availability in a Single Switch Topology
7911.2 High Availability in a Multiple Switch Topology
8011.2.1 HA Bonding Mode Selection for Multiple Switch Topology
8111.2.2 HA Link Monitoring for Multiple Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
Auke Kok6224e012006-06-08 11:15:35 -07008312. Configuring Bonding for Maximum Throughput
8412.1 Maximum Throughput in a Single Switch Topology
8512.1.1 MT Bonding Mode Selection for Single Switch Topology
8612.1.2 MT Link Monitoring for Single Switch Topology
8712.2 Maximum Throughput in a Multiple Switch Topology
8812.2.1 MT Bonding Mode Selection for Multiple Switch Topology
8912.2.2 MT Link Monitoring for Multiple Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
Auke Kok6224e012006-06-08 11:15:35 -07009113. Switch Behavior Issues
9213.1 Link Establishment and Failover Delays
9313.2 Duplicated Incoming Packets
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
Auke Kok6224e012006-06-08 11:15:35 -07009514. Hardware Specific Considerations
9614.1 IBM BladeCenter
Jay Vosburgh00354cf2005-07-21 12:18:02 -070097
Auke Kok6224e012006-06-08 11:15:35 -07009815. Frequently Asked Questions
Jay Vosburgh00354cf2005-07-21 12:18:02 -070099
Auke Kok6224e012006-06-08 11:15:35 -070010016. Resources and Links
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102
1031. Bonding Driver Installation
104==============================
105
106 Most popular distro kernels ship with the bonding driver
107already available as a module and the ifenslave user level control
108program installed and ready for use. If your distro does not, or you
109have need to compile bonding from source (e.g., configuring and
110installing a mainline kernel from kernel.org), you'll need to perform
111the following steps:
112
1131.1 Configure and build the kernel with bonding
114-----------------------------------------------
115
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700116 The current version of the bonding driver is available in the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117drivers/net/bonding subdirectory of the most recent kernel source
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700118(which is available on http://kernel.org). Most users "rolling their
119own" will want to use the most recent kernel from kernel.org.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
121 Configure kernel with "make menuconfig" (or "make xconfig" or
122"make config"), then select "Bonding driver support" in the "Network
123device support" section. It is recommended that you configure the
124driver as module since it is currently the only way to pass parameters
125to the driver or configure more than one bonding device.
126
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700127 Build and install the new kernel and modules, then continue
128below to install ifenslave.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129
1301.2 Install ifenslave Control Utility
131-------------------------------------
132
133 The ifenslave user level control program is included in the
134kernel source tree, in the file Documentation/networking/ifenslave.c.
135It is generally recommended that you use the ifenslave that
136corresponds to the kernel that you are using (either from the same
137source tree or supplied with the distro), however, ifenslave
138executables from older kernels should function (but features newer
139than the ifenslave release are not supported). Running an ifenslave
140that is newer than the kernel is not supported, and may or may not
141work.
142
143 To install ifenslave, do the following:
144
145# gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave
146# cp ifenslave /sbin/ifenslave
147
148 If your kernel source is not in "/usr/src/linux," then replace
149"/usr/src/linux/include" in the above with the location of your kernel
150source include directory.
151
152 You may wish to back up any existing /sbin/ifenslave, or, for
153testing or informal use, tag the ifenslave to the kernel version
154(e.g., name the ifenslave executable /sbin/ifenslave-2.6.10).
155
156IMPORTANT NOTE:
157
158 If you omit the "-I" or specify an incorrect directory, you
159may end up with an ifenslave that is incompatible with the kernel
160you're trying to build it for. Some distros (e.g., Red Hat from 7.1
161onwards) do not have /usr/include/linux symbolically linked to the
162default kernel source include directory.
163
Auke Kok6224e012006-06-08 11:15:35 -0700164SECOND IMPORTANT NOTE:
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +0000165 If you plan to configure bonding using sysfs or using the
166/etc/network/interfaces file, you do not need to use ifenslave.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167
1682. Bonding Driver Options
169=========================
170
Jay Vosburgh9a6c6862007-11-13 20:25:48 -0800171 Options for the bonding driver are supplied as parameters to the
172bonding module at load time, or are specified via sysfs.
173
174 Module options may be given as command line arguments to the
175insmod or modprobe command, but are usually specified in either the
176/etc/modules.conf or /etc/modprobe.conf configuration file, or in a
177distro-specific configuration file (some of which are detailed in the next
178section).
179
180 Details on bonding support for sysfs is provided in the
181"Configuring Bonding Manually via Sysfs" section, below.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
183 The available bonding driver parameters are listed below. If a
184parameter is not specified the default value is used. When initially
185configuring a bond, it is recommended "tail -f /var/log/messages" be
186run in a separate window to watch for bonding driver error messages.
187
188 It is critical that either the miimon or arp_interval and
189arp_ip_target parameters be specified, otherwise serious network
190degradation will occur during link failures. Very few devices do not
191support at least miimon, so there is really no reason not to use it.
192
193 Options with textual values will accept either the text name
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700194or, for backwards compatibility, the option value. E.g.,
195"mode=802.3ad" and "mode=4" set the same mode.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196
197 The parameters are as follows:
198
Jay Vosburghfd989c82008-11-04 17:51:16 -0800199ad_select
200
201 Specifies the 802.3ad aggregation selection logic to use. The
202 possible values and their effects are:
203
204 stable or 0
205
206 The active aggregator is chosen by largest aggregate
207 bandwidth.
208
209 Reselection of the active aggregator occurs only when all
210 slaves of the active aggregator are down or the active
211 aggregator has no slaves.
212
213 This is the default value.
214
215 bandwidth or 1
216
217 The active aggregator is chosen by largest aggregate
218 bandwidth. Reselection occurs if:
219
220 - A slave is added to or removed from the bond
221
222 - Any slave's link state changes
223
224 - Any slave's 802.3ad association state changes
225
Matt LaPlante19f59462009-04-27 15:06:31 +0200226 - The bond's administrative state changes to up
Jay Vosburghfd989c82008-11-04 17:51:16 -0800227
228 count or 2
229
230 The active aggregator is chosen by the largest number of
231 ports (slaves). Reselection occurs as described under the
232 "bandwidth" setting, above.
233
234 The bandwidth and count selection policies permit failover of
235 802.3ad aggregations when partial failure of the active aggregator
236 occurs. This keeps the aggregator with the highest availability
237 (either in bandwidth or in number of ports) active at all times.
238
239 This option was added in bonding version 3.4.0.
240
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241arp_interval
242
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700243 Specifies the ARP link monitoring frequency in milliseconds.
Jay Vosburghf5b2b962006-09-22 21:54:53 -0700244
245 The ARP monitor works by periodically checking the slave
246 devices to determine whether they have sent or received
247 traffic recently (the precise criteria depends upon the
248 bonding mode, and the state of the slave). Regular traffic is
249 generated via ARP probes issued for the addresses specified by
250 the arp_ip_target option.
251
252 This behavior can be modified by the arp_validate option,
253 below.
254
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700255 If ARP monitoring is used in an etherchannel compatible mode
256 (modes 0 and 2), the switch should be configured in a mode
257 that evenly distributes packets across all links. If the
258 switch is configured to distribute the packets in an XOR
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 fashion, all replies from the ARP targets will be received on
260 the same link which could cause the other team members to
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700261 fail. ARP monitoring should not be used in conjunction with
262 miimon. A value of 0 disables ARP monitoring. The default
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263 value is 0.
264
265arp_ip_target
266
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700267 Specifies the IP addresses to use as ARP monitoring peers when
268 arp_interval is > 0. These are the targets of the ARP request
269 sent to determine the health of the link to the targets.
270 Specify these values in ddd.ddd.ddd.ddd format. Multiple IP
271 addresses must be separated by a comma. At least one IP
272 address must be given for ARP monitoring to function. The
273 maximum number of targets that can be specified is 16. The
274 default value is no IP addresses.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275
Jay Vosburghf5b2b962006-09-22 21:54:53 -0700276arp_validate
277
278 Specifies whether or not ARP probes and replies should be
279 validated in the active-backup mode. This causes the ARP
280 monitor to examine the incoming ARP requests and replies, and
281 only consider a slave to be up if it is receiving the
282 appropriate ARP traffic.
283
284 Possible values are:
285
286 none or 0
287
288 No validation is performed. This is the default.
289
290 active or 1
291
292 Validation is performed only for the active slave.
293
294 backup or 2
295
296 Validation is performed only for backup slaves.
297
298 all or 3
299
300 Validation is performed for all slaves.
301
302 For the active slave, the validation checks ARP replies to
303 confirm that they were generated by an arp_ip_target. Since
304 backup slaves do not typically receive these replies, the
305 validation performed for backup slaves is on the ARP request
306 sent out via the active slave. It is possible that some
307 switch or network configurations may result in situations
308 wherein the backup slaves do not receive the ARP requests; in
309 such a situation, validation of backup slaves must be
310 disabled.
311
312 This option is useful in network configurations in which
313 multiple bonding hosts are concurrently issuing ARPs to one or
314 more targets beyond a common switch. Should the link between
315 the switch and target fail (but not the switch itself), the
316 probe traffic generated by the multiple bonding instances will
317 fool the standard ARP monitor into considering the links as
318 still up. Use of the arp_validate option can resolve this, as
319 the ARP monitor will only consider ARP requests and replies
320 associated with its own instance of bonding.
321
322 This option was added in bonding version 3.1.0.
323
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324downdelay
325
326 Specifies the time, in milliseconds, to wait before disabling
327 a slave after a link failure has been detected. This option
328 is only valid for the miimon link monitor. The downdelay
329 value should be a multiple of the miimon value; if not, it
330 will be rounded down to the nearest multiple. The default
331 value is 0.
332
Jay Vosburghdd957c52007-10-09 19:57:24 -0700333fail_over_mac
334
335 Specifies whether active-backup mode should set all slaves to
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700336 the same MAC address at enslavement (the traditional
337 behavior), or, when enabled, perform special handling of the
338 bond's MAC address in accordance with the selected policy.
Jay Vosburghdd957c52007-10-09 19:57:24 -0700339
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700340 Possible values are:
Jay Vosburghdd957c52007-10-09 19:57:24 -0700341
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700342 none or 0
Jay Vosburghdd957c52007-10-09 19:57:24 -0700343
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700344 This setting disables fail_over_mac, and causes
345 bonding to set all slaves of an active-backup bond to
346 the same MAC address at enslavement time. This is the
347 default.
Jay Vosburghdd957c52007-10-09 19:57:24 -0700348
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700349 active or 1
Jay Vosburghdd957c52007-10-09 19:57:24 -0700350
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700351 The "active" fail_over_mac policy indicates that the
352 MAC address of the bond should always be the MAC
353 address of the currently active slave. The MAC
354 address of the slaves is not changed; instead, the MAC
355 address of the bond changes during a failover.
356
357 This policy is useful for devices that cannot ever
358 alter their MAC address, or for devices that refuse
359 incoming broadcasts with their own source MAC (which
360 interferes with the ARP monitor).
361
362 The down side of this policy is that every device on
363 the network must be updated via gratuitous ARP,
364 vs. just updating a switch or set of switches (which
365 often takes place for any traffic, not just ARP
366 traffic, if the switch snoops incoming traffic to
367 update its tables) for the traditional method. If the
368 gratuitous ARP is lost, communication may be
369 disrupted.
370
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300371 When this policy is used in conjunction with the mii
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700372 monitor, devices which assert link up prior to being
373 able to actually transmit and receive are particularly
Matt LaPlante19f59462009-04-27 15:06:31 +0200374 susceptible to loss of the gratuitous ARP, and an
Jay Vosburgh3915c1e82008-05-17 21:10:14 -0700375 appropriate updelay setting may be required.
376
377 follow or 2
378
379 The "follow" fail_over_mac policy causes the MAC
380 address of the bond to be selected normally (normally
381 the MAC address of the first slave added to the bond).
382 However, the second and subsequent slaves are not set
383 to this MAC address while they are in a backup role; a
384 slave is programmed with the bond's MAC address at
385 failover time (and the formerly active slave receives
386 the newly active slave's MAC address).
387
388 This policy is useful for multiport devices that
389 either become confused or incur a performance penalty
390 when multiple ports are programmed with the same MAC
391 address.
392
393
394 The default policy is none, unless the first slave cannot
395 change its MAC address, in which case the active policy is
396 selected by default.
397
398 This option may be modified via sysfs only when no slaves are
399 present in the bond.
400
401 This option was added in bonding version 3.2.0. The "follow"
402 policy was added in bonding version 3.3.0.
Jay Vosburghdd957c52007-10-09 19:57:24 -0700403
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404lacp_rate
405
406 Option specifying the rate in which we'll ask our link partner
407 to transmit LACPDU packets in 802.3ad mode. Possible values
408 are:
409
410 slow or 0
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700411 Request partner to transmit LACPDUs every 30 seconds
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412
413 fast or 1
414 Request partner to transmit LACPDUs every 1 second
415
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700416 The default is slow.
417
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418max_bonds
419
420 Specifies the number of bonding devices to create for this
421 instance of the bonding driver. E.g., if max_bonds is 3, and
422 the bonding driver is not already loaded, then bond0, bond1
Jay Vosburghb8a97872008-06-13 18:12:04 -0700423 and bond2 will be created. The default value is 1. Specifying
424 a value of 0 will load bonding, but will not create any devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425
426miimon
427
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700428 Specifies the MII link monitoring frequency in milliseconds.
429 This determines how often the link state of each slave is
430 inspected for link failures. A value of zero disables MII
431 link monitoring. A value of 100 is a good starting point.
432 The use_carrier option, below, affects how the link state is
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433 determined. See the High Availability section for additional
434 information. The default value is 0.
435
436mode
437
438 Specifies one of the bonding policies. The default is
439 balance-rr (round robin). Possible values are:
440
441 balance-rr or 0
442
443 Round-robin policy: Transmit packets in sequential
444 order from the first available slave through the
445 last. This mode provides load balancing and fault
446 tolerance.
447
448 active-backup or 1
449
450 Active-backup policy: Only one slave in the bond is
451 active. A different slave becomes active if, and only
452 if, the active slave fails. The bond's MAC address is
453 externally visible on only one port (network adapter)
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700454 to avoid confusing the switch.
455
456 In bonding version 2.6.2 or later, when a failover
457 occurs in active-backup mode, bonding will issue one
458 or more gratuitous ARPs on the newly active slave.
Auke Kok6224e012006-06-08 11:15:35 -0700459 One gratuitous ARP is issued for the bonding master
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700460 interface and each VLAN interfaces configured above
461 it, provided that the interface has at least one IP
462 address configured. Gratuitous ARPs issued for VLAN
463 interfaces are tagged with the appropriate VLAN id.
464
465 This mode provides fault tolerance. The primary
466 option, documented below, affects the behavior of this
467 mode.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468
469 balance-xor or 2
470
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700471 XOR policy: Transmit based on the selected transmit
472 hash policy. The default policy is a simple [(source
473 MAC address XOR'd with destination MAC address) modulo
474 slave count]. Alternate transmit policies may be
475 selected via the xmit_hash_policy option, described
476 below.
477
478 This mode provides load balancing and fault tolerance.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479
480 broadcast or 3
481
482 Broadcast policy: transmits everything on all slave
483 interfaces. This mode provides fault tolerance.
484
485 802.3ad or 4
486
487 IEEE 802.3ad Dynamic link aggregation. Creates
488 aggregation groups that share the same speed and
489 duplex settings. Utilizes all slaves in the active
490 aggregator according to the 802.3ad specification.
491
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700492 Slave selection for outgoing traffic is done according
493 to the transmit hash policy, which may be changed from
494 the default simple XOR policy via the xmit_hash_policy
495 option, documented below. Note that not all transmit
496 policies may be 802.3ad compliant, particularly in
497 regards to the packet mis-ordering requirements of
498 section 43.2.4 of the 802.3ad standard. Differing
499 peer implementations will have varying tolerances for
500 noncompliance.
501
502 Prerequisites:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700503
504 1. Ethtool support in the base drivers for retrieving
505 the speed and duplex of each slave.
506
507 2. A switch that supports IEEE 802.3ad Dynamic link
508 aggregation.
509
510 Most switches will require some type of configuration
511 to enable 802.3ad mode.
512
513 balance-tlb or 5
514
515 Adaptive transmit load balancing: channel bonding that
516 does not require any special switch support. The
517 outgoing traffic is distributed according to the
518 current load (computed relative to the speed) on each
519 slave. Incoming traffic is received by the current
520 slave. If the receiving slave fails, another slave
521 takes over the MAC address of the failed receiving
522 slave.
523
524 Prerequisite:
525
526 Ethtool support in the base drivers for retrieving the
527 speed of each slave.
528
529 balance-alb or 6
530
531 Adaptive load balancing: includes balance-tlb plus
532 receive load balancing (rlb) for IPV4 traffic, and
533 does not require any special switch support. The
534 receive load balancing is achieved by ARP negotiation.
535 The bonding driver intercepts the ARP Replies sent by
536 the local system on their way out and overwrites the
537 source hardware address with the unique hardware
538 address of one of the slaves in the bond such that
539 different peers use different hardware addresses for
540 the server.
541
542 Receive traffic from connections created by the server
543 is also balanced. When the local system sends an ARP
544 Request the bonding driver copies and saves the peer's
545 IP information from the ARP packet. When the ARP
546 Reply arrives from the peer, its hardware address is
547 retrieved and the bonding driver initiates an ARP
548 reply to this peer assigning it to one of the slaves
549 in the bond. A problematic outcome of using ARP
550 negotiation for balancing is that each time that an
551 ARP request is broadcast it uses the hardware address
552 of the bond. Hence, peers learn the hardware address
553 of the bond and the balancing of receive traffic
554 collapses to the current slave. This is handled by
555 sending updates (ARP Replies) to all the peers with
556 their individually assigned hardware address such that
557 the traffic is redistributed. Receive traffic is also
558 redistributed when a new slave is added to the bond
559 and when an inactive slave is re-activated. The
560 receive load is distributed sequentially (round robin)
561 among the group of highest speed slaves in the bond.
562
563 When a link is reconnected or a new slave joins the
564 bond the receive traffic is redistributed among all
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700565 active slaves in the bond by initiating ARP Replies
Auke Kok6224e012006-06-08 11:15:35 -0700566 with the selected MAC address to each of the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567 clients. The updelay parameter (detailed below) must
568 be set to a value equal or greater than the switch's
569 forwarding delay so that the ARP Replies sent to the
570 peers will not be blocked by the switch.
571
572 Prerequisites:
573
574 1. Ethtool support in the base drivers for retrieving
575 the speed of each slave.
576
577 2. Base driver support for setting the hardware
578 address of a device while it is open. This is
579 required so that there will always be one slave in the
580 team using the bond hardware address (the
581 curr_active_slave) while having a unique hardware
582 address for each slave in the bond. If the
583 curr_active_slave fails its hardware address is
584 swapped with the new curr_active_slave that was
585 chosen.
586
Jay Vosburghb59f9f72008-06-13 18:12:03 -0700587num_grat_arp
Brian Haley305d5522008-11-04 17:51:14 -0800588num_unsol_na
589
Ben Hutchingsad246c92011-04-26 15:25:52 +0000590 Specify the number of peer notifications (gratuitous ARPs and
591 unsolicited IPv6 Neighbor Advertisements) to be issued after a
592 failover event. As soon as the link is up on the new slave
593 (possibly immediately) a peer notification is sent on the
594 bonding device and each VLAN sub-device. This is repeated at
595 each link monitor interval (arp_interval or miimon, whichever
596 is active) if the number is greater than 1.
Brian Haley305d5522008-11-04 17:51:14 -0800597
Ben Hutchingsad246c92011-04-26 15:25:52 +0000598 The valid range is 0 - 255; the default value is 1. These options
599 affect only the active-backup mode. These options were added for
600 bonding versions 3.3.0 and 3.4.0 respectively.
601
Jesper Juhl8fb4e132011-08-01 17:59:44 -0700602 From Linux 3.0 and bonding version 3.7.1, these notifications
Ben Hutchingsad246c92011-04-26 15:25:52 +0000603 are generated by the ipv4 and ipv6 code and the numbers of
604 repetitions cannot be set independently.
Brian Haley305d5522008-11-04 17:51:14 -0800605
Linus Torvalds1da177e2005-04-16 15:20:36 -0700606primary
607
608 A string (eth0, eth2, etc) specifying which slave is the
609 primary device. The specified device will always be the
610 active slave while it is available. Only when the primary is
611 off-line will alternate devices be used. This is useful when
612 one slave is preferred over another, e.g., when one slave has
613 higher throughput than another.
614
615 The primary option is only valid for active-backup mode.
616
Jiri Pirkoa5499522009-09-25 03:28:09 +0000617primary_reselect
618
619 Specifies the reselection policy for the primary slave. This
620 affects how the primary slave is chosen to become the active slave
621 when failure of the active slave or recovery of the primary slave
622 occurs. This option is designed to prevent flip-flopping between
623 the primary slave and other slaves. Possible values are:
624
625 always or 0 (default)
626
627 The primary slave becomes the active slave whenever it
628 comes back up.
629
630 better or 1
631
632 The primary slave becomes the active slave when it comes
633 back up, if the speed and duplex of the primary slave is
634 better than the speed and duplex of the current active
635 slave.
636
637 failure or 2
638
639 The primary slave becomes the active slave only if the
640 current active slave fails and the primary slave is up.
641
642 The primary_reselect setting is ignored in two cases:
643
644 If no slaves are active, the first slave to recover is
645 made the active slave.
646
647 When initially enslaved, the primary slave is always made
648 the active slave.
649
650 Changing the primary_reselect policy via sysfs will cause an
651 immediate selection of the best active slave according to the new
652 policy. This may or may not result in a change of the active
653 slave, depending upon the circumstances.
654
655 This option was added for bonding version 3.6.0.
656
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657updelay
658
659 Specifies the time, in milliseconds, to wait before enabling a
660 slave after a link recovery has been detected. This option is
661 only valid for the miimon link monitor. The updelay value
662 should be a multiple of the miimon value; if not, it will be
663 rounded down to the nearest multiple. The default value is 0.
664
665use_carrier
666
667 Specifies whether or not miimon should use MII or ETHTOOL
668 ioctls vs. netif_carrier_ok() to determine the link
669 status. The MII or ETHTOOL ioctls are less efficient and
670 utilize a deprecated calling sequence within the kernel. The
671 netif_carrier_ok() relies on the device driver to maintain its
672 state with netif_carrier_on/off; at this writing, most, but
673 not all, device drivers support this facility.
674
675 If bonding insists that the link is up when it should not be,
676 it may be that your network device driver does not support
677 netif_carrier_on/off. The default state for netif_carrier is
678 "carrier on," so if a driver does not support netif_carrier,
679 it will appear as if the link is always up. In this case,
680 setting use_carrier to 0 will cause bonding to revert to the
681 MII / ETHTOOL ioctl method to determine the link state.
682
683 A value of 1 enables the use of netif_carrier_ok(), a value of
684 0 will use the deprecated MII / ETHTOOL ioctls. The default
685 value is 1.
686
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700687xmit_hash_policy
688
689 Selects the transmit hash policy to use for slave selection in
690 balance-xor and 802.3ad modes. Possible values are:
691
692 layer2
693
694 Uses XOR of hardware MAC addresses to generate the
695 hash. The formula is
696
697 (source MAC XOR destination MAC) modulo slave count
698
699 This algorithm will place all traffic to a particular
700 network peer on the same slave.
701
702 This algorithm is 802.3ad compliant.
703
Jay Vosburgh6f6652b2007-12-06 23:40:34 -0800704 layer2+3
705
706 This policy uses a combination of layer2 and layer3
707 protocol information to generate the hash.
708
709 Uses XOR of hardware MAC addresses and IP addresses to
710 generate the hash. The formula is
711
712 (((source IP XOR dest IP) AND 0xffff) XOR
713 ( source MAC XOR destination MAC ))
714 modulo slave count
715
716 This algorithm will place all traffic to a particular
717 network peer on the same slave. For non-IP traffic,
718 the formula is the same as for the layer2 transmit
719 hash policy.
720
721 This policy is intended to provide a more balanced
722 distribution of traffic than layer2 alone, especially
723 in environments where a layer3 gateway device is
724 required to reach most destinations.
725
Matt LaPlanted9195882008-07-25 19:45:33 -0700726 This algorithm is 802.3ad compliant.
Jay Vosburgh6f6652b2007-12-06 23:40:34 -0800727
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700728 layer3+4
729
730 This policy uses upper layer protocol information,
731 when available, to generate the hash. This allows for
732 traffic to a particular network peer to span multiple
733 slaves, although a single connection will not span
734 multiple slaves.
735
736 The formula for unfragmented TCP and UDP packets is
737
738 ((source port XOR dest port) XOR
739 ((source IP XOR dest IP) AND 0xffff)
740 modulo slave count
741
742 For fragmented TCP or UDP packets and all other IP
743 protocol traffic, the source and destination port
744 information is omitted. For non-IP traffic, the
745 formula is the same as for the layer2 transmit hash
746 policy.
747
748 This policy is intended to mimic the behavior of
749 certain switches, notably Cisco switches with PFC2 as
750 well as some Foundry and IBM products.
751
752 This algorithm is not fully 802.3ad compliant. A
753 single TCP or UDP conversation containing both
754 fragmented and unfragmented packets will see packets
755 striped across two interfaces. This may result in out
756 of order delivery. Most traffic types will not meet
757 this criteria, as TCP rarely fragments traffic, and
758 most UDP traffic is not involved in extended
759 conversations. Other implementations of 802.3ad may
760 or may not tolerate this noncompliance.
761
762 The default value is layer2. This option was added in bonding
Jay Vosburgh6f6652b2007-12-06 23:40:34 -0800763 version 2.6.3. In earlier versions of bonding, this parameter
764 does not exist, and the layer2 policy is the only policy. The
765 layer2+3 value was added for bonding version 3.2.2.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766
Flavio Leitnerc2952c32010-10-05 14:23:59 +0000767resend_igmp
768
769 Specifies the number of IGMP membership reports to be issued after
770 a failover event. One membership report is issued immediately after
771 the failover, subsequent packets are sent in each 200ms interval.
772
Flavio Leitner94265cf2011-05-25 08:38:58 +0000773 The valid range is 0 - 255; the default value is 1. A value of 0
774 prevents the IGMP membership report from being issued in response
775 to the failover event.
776
777 This option is useful for bonding modes balance-rr (0), active-backup
778 (1), balance-tlb (5) and balance-alb (6), in which a failover can
779 switch the IGMP traffic from one slave to another. Therefore a fresh
780 IGMP report must be issued to cause the switch to forward the incoming
781 IGMP traffic over the newly selected slave.
782
783 This option was added for bonding version 3.7.0.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784
7853. Configuring Bonding Devices
786==============================
787
Auke Kok6224e012006-06-08 11:15:35 -0700788 You can configure bonding using either your distro's network
789initialization scripts, or manually using either ifenslave or the
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +0000790sysfs interface. Distros generally use one of three packages for the
791network initialization scripts: initscripts, sysconfig or interfaces.
792Recent versions of these packages have support for bonding, while older
Auke Kok6224e012006-06-08 11:15:35 -0700793versions do not.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700794
795 We will first describe the options for configuring bonding for
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +0000796distros using versions of initscripts, sysconfig and interfaces with full
797or partial support for bonding, then provide information on enabling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700798bonding without support from the network initialization scripts (i.e.,
799older versions of initscripts or sysconfig).
800
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +0000801 If you're unsure whether your distro uses sysconfig,
802initscripts or interfaces, or don't know if it's new enough, have no fear.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700803Determining this is fairly straightforward.
804
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +0000805 First, look for a file called interfaces in /etc/network directory.
806If this file is present in your system, then your system use interfaces. See
807Configuration with Interfaces Support.
808
809 Else, issue the command:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810
811$ rpm -qf /sbin/ifup
812
813 It will respond with a line of text starting with either
814"initscripts" or "sysconfig," followed by some numbers. This is the
815package that provides your network initialization scripts.
816
817 Next, to determine if your installation supports bonding,
818issue the command:
819
820$ grep ifenslave /sbin/ifup
821
822 If this returns any matches, then your initscripts or
823sysconfig has support for bonding.
824
Auke Kok6224e012006-06-08 11:15:35 -07008253.1 Configuration with Sysconfig Support
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826----------------------------------------
827
828 This section applies to distros using a version of sysconfig
829with bonding support, for example, SuSE Linux Enterprise Server 9.
830
831 SuSE SLES 9's networking configuration system does support
832bonding, however, at this writing, the YaST system configuration
Auke Kok6224e012006-06-08 11:15:35 -0700833front end does not provide any means to work with bonding devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700834Bonding devices can be managed by hand, however, as follows.
835
836 First, if they have not already been configured, configure the
837slave devices. On SLES 9, this is most easily done by running the
838yast2 sysconfig configuration utility. The goal is for to create an
839ifcfg-id file for each slave device. The simplest way to accomplish
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700840this is to configure the devices for DHCP (this is only to get the
841file ifcfg-id file created; see below for some issues with DHCP). The
842name of the configuration file for each device will be of the form:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843
844ifcfg-id-xx:xx:xx:xx:xx:xx
845
846 Where the "xx" portion will be replaced with the digits from
847the device's permanent MAC address.
848
849 Once the set of ifcfg-id-xx:xx:xx:xx:xx:xx files has been
850created, it is necessary to edit the configuration files for the slave
851devices (the MAC addresses correspond to those of the slave devices).
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700852Before editing, the file will contain multiple lines, and will look
Linus Torvalds1da177e2005-04-16 15:20:36 -0700853something like this:
854
855BOOTPROTO='dhcp'
856STARTMODE='on'
857USERCTL='no'
858UNIQUE='XNzu.WeZGOGF+4wE'
859_nm_name='bus-pci-0001:61:01.0'
860
861 Change the BOOTPROTO and STARTMODE lines to the following:
862
863BOOTPROTO='none'
864STARTMODE='off'
865
866 Do not alter the UNIQUE or _nm_name lines. Remove any other
867lines (USERCTL, etc).
868
869 Once the ifcfg-id-xx:xx:xx:xx:xx:xx files have been modified,
870it's time to create the configuration file for the bonding device
871itself. This file is named ifcfg-bondX, where X is the number of the
872bonding device to create, starting at 0. The first such file is
873ifcfg-bond0, the second is ifcfg-bond1, and so on. The sysconfig
874network configuration system will correctly start multiple instances
875of bonding.
876
877 The contents of the ifcfg-bondX file is as follows:
878
879BOOTPROTO="static"
880BROADCAST="10.0.2.255"
881IPADDR="10.0.2.10"
882NETMASK="255.255.0.0"
883NETWORK="10.0.2.0"
884REMOTE_IPADDR=""
885STARTMODE="onboot"
886BONDING_MASTER="yes"
887BONDING_MODULE_OPTS="mode=active-backup miimon=100"
888BONDING_SLAVE0="eth0"
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700889BONDING_SLAVE1="bus-pci-0000:06:08.1"
Linus Torvalds1da177e2005-04-16 15:20:36 -0700890
891 Replace the sample BROADCAST, IPADDR, NETMASK and NETWORK
892values with the appropriate values for your network.
893
Linus Torvalds1da177e2005-04-16 15:20:36 -0700894 The STARTMODE specifies when the device is brought online.
895The possible values are:
896
897 onboot: The device is started at boot time. If you're not
898 sure, this is probably what you want.
899
900 manual: The device is started only when ifup is called
901 manually. Bonding devices may be configured this
902 way if you do not wish them to start automatically
903 at boot for some reason.
904
905 hotplug: The device is started by a hotplug event. This is not
906 a valid choice for a bonding device.
907
908 off or ignore: The device configuration is ignored.
909
910 The line BONDING_MASTER='yes' indicates that the device is a
911bonding master device. The only useful value is "yes."
912
913 The contents of BONDING_MODULE_OPTS are supplied to the
914instance of the bonding module for this device. Specify the options
915for the bonding mode, link monitoring, and so on here. Do not include
916the max_bonds bonding parameter; this will confuse the configuration
917system if you have multiple bonding devices.
918
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700919 Finally, supply one BONDING_SLAVEn="slave device" for each
920slave. where "n" is an increasing value, one for each slave. The
921"slave device" is either an interface name, e.g., "eth0", or a device
922specifier for the network device. The interface name is easier to
923find, but the ethN names are subject to change at boot time if, e.g.,
924a device early in the sequence has failed. The device specifiers
925(bus-pci-0000:06:08.1 in the example above) specify the physical
926network device, and will not change unless the device's bus location
927changes (for example, it is moved from one PCI slot to another). The
928example above uses one of each type for demonstration purposes; most
929configurations will choose one or the other for all slave devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700930
931 When all configuration files have been modified or created,
932networking must be restarted for the configuration changes to take
933effect. This can be accomplished via the following:
934
935# /etc/init.d/network restart
936
937 Note that the network control script (/sbin/ifdown) will
938remove the bonding module as part of the network shutdown processing,
939so it is not necessary to remove the module by hand if, e.g., the
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700940module parameters have changed.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700941
942 Also, at this writing, YaST/YaST2 will not manage bonding
943devices (they do not show bonding interfaces on its list of network
944devices). It is necessary to edit the configuration file by hand to
945change the bonding configuration.
946
947 Additional general options and details of the ifcfg file
948format can be found in an example ifcfg template file:
949
950/etc/sysconfig/network/ifcfg.template
951
952 Note that the template does not document the various BONDING_
953settings described above, but does describe many of the other options.
954
Auke Kok6224e012006-06-08 11:15:35 -07009553.1.1 Using DHCP with Sysconfig
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700956-------------------------------
957
958 Under sysconfig, configuring a device with BOOTPROTO='dhcp'
959will cause it to query DHCP for its IP address information. At this
960writing, this does not function for bonding devices; the scripts
961attempt to obtain the device address from DHCP prior to adding any of
962the slave devices. Without active slaves, the DHCP requests are not
963sent to the network.
964
Auke Kok6224e012006-06-08 11:15:35 -07009653.1.2 Configuring Multiple Bonds with Sysconfig
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700966-----------------------------------------------
967
968 The sysconfig network initialization system is capable of
969handling multiple bonding devices. All that is necessary is for each
970bonding instance to have an appropriately configured ifcfg-bondX file
971(as described above). Do not specify the "max_bonds" parameter to any
972instance of bonding, as this will confuse sysconfig. If you require
973multiple bonding devices with identical parameters, create multiple
974ifcfg-bondX files.
975
976 Because the sysconfig scripts supply the bonding module
977options in the ifcfg-bondX file, it is not necessary to add them to
978the system /etc/modules.conf or /etc/modprobe.conf configuration file.
979
Auke Kok6224e012006-06-08 11:15:35 -07009803.2 Configuration with Initscripts Support
Linus Torvalds1da177e2005-04-16 15:20:36 -0700981------------------------------------------
982
Jay Vosburgh9a6c6862007-11-13 20:25:48 -0800983 This section applies to distros using a recent version of
984initscripts with bonding support, for example, Red Hat Enterprise Linux
985version 3 or later, Fedora, etc. On these systems, the network
986initialization scripts have knowledge of bonding, and can be configured to
987control bonding devices. Note that older versions of the initscripts
988package have lower levels of support for bonding; this will be noted where
989applicable.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700990
991 These distros will not automatically load the network adapter
992driver unless the ethX device is configured with an IP address.
993Because of this constraint, users must manually configure a
994network-script file for all physical adapters that will be members of
995a bondX link. Network script files are located in the directory:
996
997/etc/sysconfig/network-scripts
998
999 The file name must be prefixed with "ifcfg-eth" and suffixed
1000with the adapter's physical adapter number. For example, the script
1001for eth0 would be named /etc/sysconfig/network-scripts/ifcfg-eth0.
1002Place the following text in the file:
1003
1004DEVICE=eth0
1005USERCTL=no
1006ONBOOT=yes
1007MASTER=bond0
1008SLAVE=yes
1009BOOTPROTO=none
1010
1011 The DEVICE= line will be different for every ethX device and
1012must correspond with the name of the file, i.e., ifcfg-eth1 must have
1013a device line of DEVICE=eth1. The setting of the MASTER= line will
1014also depend on the final bonding interface name chosen for your bond.
1015As with other network devices, these typically start at 0, and go up
1016one for each device, i.e., the first bonding instance is bond0, the
1017second is bond1, and so on.
1018
1019 Next, create a bond network script. The file name for this
1020script will be /etc/sysconfig/network-scripts/ifcfg-bondX where X is
1021the number of the bond. For bond0 the file is named "ifcfg-bond0",
1022for bond1 it is named "ifcfg-bond1", and so on. Within that file,
1023place the following text:
1024
1025DEVICE=bond0
1026IPADDR=192.168.1.1
1027NETMASK=255.255.255.0
1028NETWORK=192.168.1.0
1029BROADCAST=192.168.1.255
1030ONBOOT=yes
1031BOOTPROTO=none
1032USERCTL=no
1033
1034 Be sure to change the networking specific lines (IPADDR,
1035NETMASK, NETWORK and BROADCAST) to match your network configuration.
1036
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001037 For later versions of initscripts, such as that found with Fedora
Andy Gospodarek3f8b4b12008-10-22 11:19:48 +000010387 (or later) and Red Hat Enterprise Linux version 5 (or later), it is possible,
1039and, indeed, preferable, to specify the bonding options in the ifcfg-bond0
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001040file, e.g. a line of the format:
1041
Andy Gospodarek3f8b4b12008-10-22 11:19:48 +00001042BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=192.168.1.254"
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001043
1044 will configure the bond with the specified options. The options
1045specified in BONDING_OPTS are identical to the bonding module parameters
Andy Gospodarek3f8b4b12008-10-22 11:19:48 +00001046except for the arp_ip_target field when using versions of initscripts older
1047than and 8.57 (Fedora 8) and 8.45.19 (Red Hat Enterprise Linux 5.2). When
1048using older versions each target should be included as a separate option and
1049should be preceded by a '+' to indicate it should be added to the list of
1050queried targets, e.g.,
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001051
1052 arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2
1053
1054 is the proper syntax to specify multiple targets. When specifying
1055options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or
1056/etc/modprobe.conf.
1057
Andy Gospodarek3f8b4b12008-10-22 11:19:48 +00001058 For even older versions of initscripts that do not support
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001059BONDING_OPTS, it is necessary to edit /etc/modules.conf (or
1060/etc/modprobe.conf, depending upon your distro) to load the bonding module
1061with your desired options when the bond0 interface is brought up. The
1062following lines in /etc/modules.conf (or modprobe.conf) will load the
1063bonding module, and select its options:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001064
1065alias bond0 bonding
1066options bond0 mode=balance-alb miimon=100
1067
1068 Replace the sample parameters with the appropriate set of
1069options for your configuration.
1070
1071 Finally run "/etc/rc.d/init.d/network restart" as root. This
1072will restart the networking subsystem and your bond link should be now
1073up and running.
1074
Auke Kok6224e012006-06-08 11:15:35 -070010753.2.1 Using DHCP with Initscripts
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001076---------------------------------
1077
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001078 Recent versions of initscripts (the versions supplied with Fedora
1079Core 3 and Red Hat Enterprise Linux 4, or later versions, are reported to
1080work) have support for assigning IP information to bonding devices via
1081DHCP.
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001082
1083 To configure bonding for DHCP, configure it as described
1084above, except replace the line "BOOTPROTO=none" with "BOOTPROTO=dhcp"
1085and add a line consisting of "TYPE=Bonding". Note that the TYPE value
1086is case sensitive.
1087
Auke Kok6224e012006-06-08 11:15:35 -070010883.2.2 Configuring Multiple Bonds with Initscripts
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001089-------------------------------------------------
1090
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001091 Initscripts packages that are included with Fedora 7 and Red Hat
1092Enterprise Linux 5 support multiple bonding interfaces by simply
1093specifying the appropriate BONDING_OPTS= in ifcfg-bondX where X is the
1094number of the bond. This support requires sysfs support in the kernel,
1095and a bonding driver of version 3.0.0 or later. Other configurations may
1096not support this method for specifying multiple bonding interfaces; for
1097those instances, see the "Configuring Multiple Bonds Manually" section,
1098below.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001099
Auke Kok6224e012006-06-08 11:15:35 -070011003.3 Configuring Bonding Manually with Ifenslave
1101-----------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001102
1103 This section applies to distros whose network initialization
1104scripts (the sysconfig or initscripts package) do not have specific
1105knowledge of bonding. One such distro is SuSE Linux Enterprise Server
1106version 8.
1107
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001108 The general method for these systems is to place the bonding
1109module parameters into /etc/modules.conf or /etc/modprobe.conf (as
1110appropriate for the installed distro), then add modprobe and/or
1111ifenslave commands to the system's global init script. The name of
1112the global init script differs; for sysconfig, it is
Linus Torvalds1da177e2005-04-16 15:20:36 -07001113/etc/init.d/boot.local and for initscripts it is /etc/rc.d/rc.local.
1114
1115 For example, if you wanted to make a simple bond of two e100
1116devices (presumed to be eth0 and eth1), and have it persist across
1117reboots, edit the appropriate file (/etc/init.d/boot.local or
1118/etc/rc.d/rc.local), and add the following:
1119
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001120modprobe bonding mode=balance-alb miimon=100
Linus Torvalds1da177e2005-04-16 15:20:36 -07001121modprobe e100
1122ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
1123ifenslave bond0 eth0
1124ifenslave bond0 eth1
1125
1126 Replace the example bonding module parameters and bond0
1127network configuration (IP address, netmask, etc) with the appropriate
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001128values for your configuration.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001129
1130 Unfortunately, this method will not provide support for the
1131ifup and ifdown scripts on the bond devices. To reload the bonding
1132configuration, it is necessary to run the initialization script, e.g.,
1133
1134# /etc/init.d/boot.local
1135
1136 or
1137
1138# /etc/rc.d/rc.local
1139
1140 It may be desirable in such a case to create a separate script
1141which only initializes the bonding configuration, then call that
1142separate script from within boot.local. This allows for bonding to be
1143enabled without re-running the entire global init script.
1144
1145 To shut down the bonding devices, it is necessary to first
1146mark the bonding device itself as being down, then remove the
1147appropriate device driver modules. For our example above, you can do
1148the following:
1149
1150# ifconfig bond0 down
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001151# rmmod bonding
Linus Torvalds1da177e2005-04-16 15:20:36 -07001152# rmmod e100
1153
1154 Again, for convenience, it may be desirable to create a script
1155with these commands.
1156
1157
Jay Vosburgh00354cf2005-07-21 12:18:02 -070011583.3.1 Configuring Multiple Bonds Manually
1159-----------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001160
1161 This section contains information on configuring multiple
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001162bonding devices with differing options for those systems whose network
1163initialization scripts lack support for configuring multiple bonds.
1164
1165 If you require multiple bonding devices, but all with the same
1166options, you may wish to use the "max_bonds" module parameter,
1167documented above.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001168
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001169 To create multiple bonding devices with differing options, it is
1170preferrable to use bonding parameters exported by sysfs, documented in the
1171section below.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001172
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001173 For versions of bonding without sysfs support, the only means to
1174provide multiple instances of bonding with differing options is to load
1175the bonding driver multiple times. Note that current versions of the
1176sysconfig network initialization scripts handle this automatically; if
1177your distro uses these scripts, no special action is needed. See the
1178section Configuring Bonding Devices, above, if you're not sure about your
1179network initialization scripts.
1180
1181 To load multiple instances of the module, it is necessary to
1182specify a different name for each instance (the module loading system
1183requires that every loaded module, even multiple instances of the same
1184module, have a unique name). This is accomplished by supplying multiple
1185sets of bonding options in /etc/modprobe.conf, for example:
1186
1187alias bond0 bonding
1188options bond0 -o bond0 mode=balance-rr miimon=100
1189
1190alias bond1 bonding
1191options bond1 -o bond1 mode=balance-alb miimon=50
1192
1193 will load the bonding module two times. The first instance is
1194named "bond0" and creates the bond0 device in balance-rr mode with an
1195miimon of 100. The second instance is named "bond1" and creates the
1196bond1 device in balance-alb mode with an miimon of 50.
1197
1198 In some circumstances (typically with older distributions),
1199the above does not work, and the second bonding instance never sees
1200its options. In that case, the second options line can be substituted
1201as follows:
1202
1203install bond1 /sbin/modprobe --ignore-install bonding -o bond1 \
1204 mode=balance-alb miimon=50
1205
1206 This may be repeated any number of times, specifying a new and
1207unique name in place of bond1 for each subsequent instance.
1208
1209 It has been observed that some Red Hat supplied kernels are unable
1210to rename modules at load time (the "-o bond1" part). Attempts to pass
1211that option to modprobe will produce an "Operation not permitted" error.
1212This has been reported on some Fedora Core kernels, and has been seen on
1213RHEL 4 as well. On kernels exhibiting this problem, it will be impossible
1214to configure multiple bonds with differing parameters (as they are older
1215kernels, and also lack sysfs support).
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001216
Auke Kok6224e012006-06-08 11:15:35 -070012173.4 Configuring Bonding Manually via Sysfs
1218------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001219
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001220 Starting with version 3.0.0, Channel Bonding may be configured
Auke Kok6224e012006-06-08 11:15:35 -07001221via the sysfs interface. This interface allows dynamic configuration
1222of all bonds in the system without unloading the module. It also
1223allows for adding and removing bonds at runtime. Ifenslave is no
1224longer required, though it is still supported.
1225
1226 Use of the sysfs interface allows you to use multiple bonds
1227with different configurations without having to reload the module.
1228It also allows you to use multiple, differently configured bonds when
1229bonding is compiled into the kernel.
1230
1231 You must have the sysfs filesystem mounted to configure
1232bonding this way. The examples in this document assume that you
1233are using the standard mount point for sysfs, e.g. /sys. If your
1234sysfs filesystem is mounted elsewhere, you will need to adjust the
1235example paths accordingly.
1236
1237Creating and Destroying Bonds
1238-----------------------------
1239To add a new bond foo:
1240# echo +foo > /sys/class/net/bonding_masters
1241
1242To remove an existing bond bar:
1243# echo -bar > /sys/class/net/bonding_masters
1244
1245To show all existing bonds:
1246# cat /sys/class/net/bonding_masters
1247
1248NOTE: due to 4K size limitation of sysfs files, this list may be
1249truncated if you have more than a few hundred bonds. This is unlikely
1250to occur under normal operating conditions.
1251
1252Adding and Removing Slaves
1253--------------------------
1254 Interfaces may be enslaved to a bond using the file
1255/sys/class/net/<bond>/bonding/slaves. The semantics for this file
1256are the same as for the bonding_masters file.
1257
1258To enslave interface eth0 to bond bond0:
1259# ifconfig bond0 up
1260# echo +eth0 > /sys/class/net/bond0/bonding/slaves
1261
1262To free slave eth0 from bond bond0:
1263# echo -eth0 > /sys/class/net/bond0/bonding/slaves
1264
Auke Kok6224e012006-06-08 11:15:35 -07001265 When an interface is enslaved to a bond, symlinks between the
1266two are created in the sysfs filesystem. In this case, you would get
1267/sys/class/net/bond0/slave_eth0 pointing to /sys/class/net/eth0, and
1268/sys/class/net/eth0/master pointing to /sys/class/net/bond0.
1269
1270 This means that you can tell quickly whether or not an
1271interface is enslaved by looking for the master symlink. Thus:
1272# echo -eth0 > /sys/class/net/eth0/master/bonding/slaves
1273will free eth0 from whatever bond it is enslaved to, regardless of
1274the name of the bond interface.
1275
1276Changing a Bond's Configuration
1277-------------------------------
1278 Each bond may be configured individually by manipulating the
1279files located in /sys/class/net/<bond name>/bonding
1280
1281 The names of these files correspond directly with the command-
Paolo Ornati670e9f32006-10-03 22:57:56 +02001282line parameters described elsewhere in this file, and, with the
Auke Kok6224e012006-06-08 11:15:35 -07001283exception of arp_ip_target, they accept the same values. To see the
1284current setting, simply cat the appropriate file.
1285
1286 A few examples will be given here; for specific usage
1287guidelines for each parameter, see the appropriate section in this
1288document.
1289
1290To configure bond0 for balance-alb mode:
1291# ifconfig bond0 down
1292# echo 6 > /sys/class/net/bond0/bonding/mode
1293 - or -
1294# echo balance-alb > /sys/class/net/bond0/bonding/mode
1295 NOTE: The bond interface must be down before the mode can be
1296changed.
1297
1298To enable MII monitoring on bond0 with a 1 second interval:
1299# echo 1000 > /sys/class/net/bond0/bonding/miimon
1300 NOTE: If ARP monitoring is enabled, it will disabled when MII
1301monitoring is enabled, and vice-versa.
1302
1303To add ARP targets:
1304# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
1305# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
Brian Haley5a31bec2009-04-13 00:11:30 -07001306 NOTE: up to 16 target addresses may be specified.
Auke Kok6224e012006-06-08 11:15:35 -07001307
1308To remove an ARP target:
1309# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
1310
1311Example Configuration
1312---------------------
1313 We begin with the same example that is shown in section 3.3,
1314executed with sysfs, and without using ifenslave.
1315
1316 To make a simple bond of two e100 devices (presumed to be eth0
1317and eth1), and have it persist across reboots, edit the appropriate
1318file (/etc/init.d/boot.local or /etc/rc.d/rc.local), and add the
1319following:
1320
1321modprobe bonding
1322modprobe e100
1323echo balance-alb > /sys/class/net/bond0/bonding/mode
1324ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
1325echo 100 > /sys/class/net/bond0/bonding/miimon
1326echo +eth0 > /sys/class/net/bond0/bonding/slaves
1327echo +eth1 > /sys/class/net/bond0/bonding/slaves
1328
1329 To add a second bond, with two e1000 interfaces in
1330active-backup mode, using ARP monitoring, add the following lines to
1331your init script:
1332
1333modprobe e1000
1334echo +bond1 > /sys/class/net/bonding_masters
1335echo active-backup > /sys/class/net/bond1/bonding/mode
1336ifconfig bond1 192.168.2.1 netmask 255.255.255.0 up
1337echo +192.168.2.100 /sys/class/net/bond1/bonding/arp_ip_target
1338echo 2000 > /sys/class/net/bond1/bonding/arp_interval
1339echo +eth2 > /sys/class/net/bond1/bonding/slaves
1340echo +eth3 > /sys/class/net/bond1/bonding/slaves
1341
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +000013423.5 Configuration with Interfaces Support
1343-----------------------------------------
1344
1345 This section applies to distros which use /etc/network/interfaces file
1346to describe network interface configuration, most notably Debian and it's
1347derivatives.
1348
1349 The ifup and ifdown commands on Debian don't support bonding out of
1350the box. The ifenslave-2.6 package should be installed to provide bonding
1351support. Once installed, this package will provide bond-* options to be used
1352into /etc/network/interfaces.
1353
1354 Note that ifenslave-2.6 package will load the bonding module and use
1355the ifenslave command when appropriate.
1356
1357Example Configurations
1358----------------------
1359
1360In /etc/network/interfaces, the following stanza will configure bond0, in
1361active-backup mode, with eth0 and eth1 as slaves.
1362
1363auto bond0
1364iface bond0 inet dhcp
1365 bond-slaves eth0 eth1
1366 bond-mode active-backup
1367 bond-miimon 100
1368 bond-primary eth0 eth1
1369
1370If the above configuration doesn't work, you might have a system using
1371upstart for system startup. This is most notably true for recent
1372Ubuntu versions. The following stanza in /etc/network/interfaces will
1373produce the same result on those systems.
1374
1375auto bond0
1376iface bond0 inet dhcp
1377 bond-slaves none
1378 bond-mode active-backup
1379 bond-miimon 100
1380
1381auto eth0
1382iface eth0 inet manual
1383 bond-master bond0
1384 bond-primary eth0 eth1
1385
1386auto eth1
1387iface eth1 inet manual
1388 bond-master bond0
1389 bond-primary eth0 eth1
1390
1391For a full list of bond-* supported options in /etc/network/interfaces and some
1392more advanced examples tailored to you particular distros, see the files in
1393/usr/share/doc/ifenslave-2.6.
1394
13953.6 Overriding Configuration for Special Cases
Andy Gospodarekbb1d9122010-06-02 08:40:18 +00001396----------------------------------------------
Nicolas de Pesloüande221bd2011-01-24 13:21:37 +00001397
Andy Gospodarekbb1d9122010-06-02 08:40:18 +00001398When using the bonding driver, the physical port which transmits a frame is
1399typically selected by the bonding driver, and is not relevant to the user or
1400system administrator. The output port is simply selected using the policies of
1401the selected bonding mode. On occasion however, it is helpful to direct certain
1402classes of traffic to certain physical interfaces on output to implement
1403slightly more complex policies. For example, to reach a web server over a
1404bonded interface in which eth0 connects to a private network, while eth1
1405connects via a public network, it may be desirous to bias the bond to send said
1406traffic over eth0 first, using eth1 only as a fall back, while all other traffic
1407can safely be sent over either interface. Such configurations may be achieved
1408using the traffic control utilities inherent in linux.
Auke Kok6224e012006-06-08 11:15:35 -07001409
Andy Gospodarekbb1d9122010-06-02 08:40:18 +00001410By default the bonding driver is multiqueue aware and 16 queues are created
1411when the driver initializes (see Documentation/networking/multiqueue.txt
1412for details). If more or less queues are desired the module parameter
1413tx_queues can be used to change this value. There is no sysfs parameter
1414available as the allocation is done at module init time.
1415
1416The output of the file /proc/net/bonding/bondX has changed so the output Queue
1417ID is now printed for each slave:
1418
1419Bonding Mode: fault-tolerance (active-backup)
1420Primary Slave: None
1421Currently Active Slave: eth0
1422MII Status: up
1423MII Polling Interval (ms): 0
1424Up Delay (ms): 0
1425Down Delay (ms): 0
1426
1427Slave Interface: eth0
1428MII Status: up
1429Link Failure Count: 0
1430Permanent HW addr: 00:1a:a0:12:8f:cb
1431Slave queue ID: 0
1432
1433Slave Interface: eth1
1434MII Status: up
1435Link Failure Count: 0
1436Permanent HW addr: 00:1a:a0:12:8f:cc
1437Slave queue ID: 2
1438
1439The queue_id for a slave can be set using the command:
1440
1441# echo "eth1:2" > /sys/class/net/bond0/bonding/queue_id
1442
1443Any interface that needs a queue_id set should set it with multiple calls
1444like the one above until proper priorities are set for all interfaces. On
1445distributions that allow configuration via initscripts, multiple 'queue_id'
1446arguments can be added to BONDING_OPTS to set all needed slave queues.
1447
1448These queue id's can be used in conjunction with the tc utility to configure
1449a multiqueue qdisc and filters to bias certain traffic to transmit on certain
1450slave devices. For instance, say we wanted, in the above configuration to
1451force all traffic bound to 192.168.1.100 to use eth1 in the bond as its output
1452device. The following commands would accomplish this:
1453
1454# tc qdisc add dev bond0 handle 1 root multiq
1455
1456# tc filter add dev bond0 protocol ip parent 1: prio 1 u32 match ip dst \
1457 192.168.1.100 action skbedit queue_mapping 2
1458
1459These commands tell the kernel to attach a multiqueue queue discipline to the
1460bond0 interface and filter traffic enqueued to it, such that packets with a dst
1461ip of 192.168.1.100 have their output queue mapping value overwritten to 2.
1462This value is then passed into the driver, causing the normal output path
1463selection policy to be overridden, selecting instead qid 2, which maps to eth1.
1464
1465Note that qid values begin at 1. Qid 0 is reserved to initiate to the driver
1466that normal output policy selection should take place. One benefit to simply
1467leaving the qid for a slave to 0 is the multiqueue awareness in the bonding
1468driver that is now present. This awareness allows tc filters to be placed on
1469slave devices as well as bond devices and the bonding driver will simply act as
1470a pass-through for selecting output queues on the slave device rather than
1471output port selection.
1472
1473This feature first appeared in bonding driver version 3.7.0 and support for
1474output slave selection was limited to round-robin and active-backup modes.
1475
14764 Querying Bonding Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001477=================================
1478
Auke Kok6224e012006-06-08 11:15:35 -070014794.1 Bonding Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001480-------------------------
1481
1482 Each bonding device has a read-only file residing in the
1483/proc/net/bonding directory. The file contents include information
1484about the bonding configuration, options and state of each slave.
1485
1486 For example, the contents of /proc/net/bonding/bond0 after the
1487driver is loaded with parameters of mode=0 and miimon=1000 is
1488generally as follows:
1489
1490 Ethernet Channel Bonding Driver: 2.6.1 (October 29, 2004)
1491 Bonding Mode: load balancing (round-robin)
1492 Currently Active Slave: eth0
1493 MII Status: up
1494 MII Polling Interval (ms): 1000
1495 Up Delay (ms): 0
1496 Down Delay (ms): 0
1497
1498 Slave Interface: eth1
1499 MII Status: up
1500 Link Failure Count: 1
1501
1502 Slave Interface: eth0
1503 MII Status: up
1504 Link Failure Count: 1
1505
1506 The precise format and contents will change depending upon the
1507bonding configuration, state, and version of the bonding driver.
1508
Auke Kok6224e012006-06-08 11:15:35 -070015094.2 Network configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001510-------------------------
1511
1512 The network configuration can be inspected using the ifconfig
1513command. Bonding devices will have the MASTER flag set; Bonding slave
1514devices will have the SLAVE flag set. The ifconfig output does not
1515contain information on which slaves are associated with which masters.
1516
1517 In the example below, the bond0 interface is the master
1518(MASTER) while eth0 and eth1 are slaves (SLAVE). Notice all slaves of
1519bond0 have the same MAC address (HWaddr) as bond0 for all modes except
1520TLB and ALB that require a unique MAC address for each slave.
1521
1522# /sbin/ifconfig
1523bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
1524 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0
1525 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
1526 RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0
1527 TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0
1528 collisions:0 txqueuelen:0
1529
1530eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
Linus Torvalds1da177e2005-04-16 15:20:36 -07001531 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
1532 RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0
1533 TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0
1534 collisions:0 txqueuelen:100
1535 Interrupt:10 Base address:0x1080
1536
1537eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
Linus Torvalds1da177e2005-04-16 15:20:36 -07001538 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
1539 RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0
1540 TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0
1541 collisions:0 txqueuelen:100
1542 Interrupt:9 Base address:0x1400
1543
Auke Kok6224e012006-06-08 11:15:35 -070015445. Switch Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -07001545=======================
1546
1547 For this section, "switch" refers to whatever system the
1548bonded devices are directly connected to (i.e., where the other end of
1549the cable plugs into). This may be an actual dedicated switch device,
1550or it may be another regular system (e.g., another computer running
1551Linux),
1552
1553 The active-backup, balance-tlb and balance-alb modes do not
1554require any specific configuration of the switch.
1555
1556 The 802.3ad mode requires that the switch have the appropriate
1557ports configured as an 802.3ad aggregation. The precise method used
1558to configure this varies from switch to switch, but, for example, a
1559Cisco 3550 series switch requires that the appropriate ports first be
1560grouped together in a single etherchannel instance, then that
1561etherchannel is set to mode "lacp" to enable 802.3ad (instead of
1562standard EtherChannel).
1563
1564 The balance-rr, balance-xor and broadcast modes generally
1565require that the switch have the appropriate ports grouped together.
1566The nomenclature for such a group differs between switches, it may be
1567called an "etherchannel" (as in the Cisco example, above), a "trunk
1568group" or some other similar variation. For these modes, each switch
1569will also have its own configuration options for the switch's transmit
1570policy to the bond. Typical choices include XOR of either the MAC or
1571IP addresses. The transmit policy of the two peers does not need to
1572match. For these three modes, the bonding mode really selects a
1573transmit policy for an EtherChannel group; all three will interoperate
1574with another EtherChannel group.
1575
1576
Auke Kok6224e012006-06-08 11:15:35 -070015776. 802.1q VLAN Support
Linus Torvalds1da177e2005-04-16 15:20:36 -07001578======================
1579
1580 It is possible to configure VLAN devices over a bond interface
1581using the 8021q driver. However, only packets coming from the 8021q
1582driver and passing through bonding will be tagged by default. Self
1583generated packets, for example, bonding's learning packets or ARP
1584packets generated by either ALB mode or the ARP monitor mechanism, are
1585tagged internally by bonding itself. As a result, bonding must
1586"learn" the VLAN IDs configured above it, and use those IDs to tag
1587self generated packets.
1588
1589 For reasons of simplicity, and to support the use of adapters
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001590that can do VLAN hardware acceleration offloading, the bonding
1591interface declares itself as fully hardware offloading capable, it gets
Linus Torvalds1da177e2005-04-16 15:20:36 -07001592the add_vid/kill_vid notifications to gather the necessary
1593information, and it propagates those actions to the slaves. In case
1594of mixed adapter types, hardware accelerated tagged packets that
1595should go through an adapter that is not offloading capable are
1596"un-accelerated" by the bonding driver so the VLAN tag sits in the
1597regular location.
1598
1599 VLAN interfaces *must* be added on top of a bonding interface
1600only after enslaving at least one slave. The bonding interface has a
1601hardware address of 00:00:00:00:00:00 until the first slave is added.
1602If the VLAN interface is created prior to the first enslavement, it
1603would pick up the all-zeroes hardware address. Once the first slave
1604is attached to the bond, the bond device itself will pick up the
1605slave's hardware address, which is then available for the VLAN device.
1606
1607 Also, be aware that a similar problem can occur if all slaves
1608are released from a bond that still has one or more VLAN interfaces on
1609top of it. When a new slave is added, the bonding interface will
1610obtain its hardware address from the first slave, which might not
1611match the hardware address of the VLAN interfaces (which was
1612ultimately copied from an earlier slave).
1613
1614 There are two methods to insure that the VLAN device operates
1615with the correct hardware address if all slaves are removed from a
1616bond interface:
1617
1618 1. Remove all VLAN interfaces then recreate them
1619
1620 2. Set the bonding interface's hardware address so that it
1621matches the hardware address of the VLAN interfaces.
1622
1623 Note that changing a VLAN interface's HW address would set the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001624underlying device -- i.e. the bonding interface -- to promiscuous
Linus Torvalds1da177e2005-04-16 15:20:36 -07001625mode, which might not be what you want.
1626
1627
Auke Kok6224e012006-06-08 11:15:35 -070016287. Link Monitoring
Linus Torvalds1da177e2005-04-16 15:20:36 -07001629==================
1630
1631 The bonding driver at present supports two schemes for
1632monitoring a slave device's link state: the ARP monitor and the MII
1633monitor.
1634
1635 At the present time, due to implementation restrictions in the
1636bonding driver itself, it is not possible to enable both ARP and MII
1637monitoring simultaneously.
1638
Auke Kok6224e012006-06-08 11:15:35 -070016397.1 ARP Monitor Operation
Linus Torvalds1da177e2005-04-16 15:20:36 -07001640-------------------------
1641
1642 The ARP monitor operates as its name suggests: it sends ARP
1643queries to one or more designated peer systems on the network, and
1644uses the response as an indication that the link is operating. This
1645gives some assurance that traffic is actually flowing to and from one
1646or more peers on the local network.
1647
1648 The ARP monitor relies on the device driver itself to verify
1649that traffic is flowing. In particular, the driver must keep up to
1650date the last receive time, dev->last_rx, and transmit start time,
1651dev->trans_start. If these are not updated by the driver, then the
1652ARP monitor will immediately fail any slaves using that driver, and
1653those slaves will stay down. If networking monitoring (tcpdump, etc)
1654shows the ARP requests and replies on the network, then it may be that
1655your device driver is not updating last_rx and trans_start.
1656
Auke Kok6224e012006-06-08 11:15:35 -070016577.2 Configuring Multiple ARP Targets
Linus Torvalds1da177e2005-04-16 15:20:36 -07001658------------------------------------
1659
1660 While ARP monitoring can be done with just one target, it can
1661be useful in a High Availability setup to have several targets to
1662monitor. In the case of just one target, the target itself may go
1663down or have a problem making it unresponsive to ARP requests. Having
1664an additional target (or several) increases the reliability of the ARP
1665monitoring.
1666
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001667 Multiple ARP targets must be separated by commas as follows:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001668
1669# example options for ARP monitoring with three targets
1670alias bond0 bonding
1671options bond0 arp_interval=60 arp_ip_target=192.168.0.1,192.168.0.3,192.168.0.9
1672
1673 For just a single target the options would resemble:
1674
1675# example options for ARP monitoring with one target
1676alias bond0 bonding
1677options bond0 arp_interval=60 arp_ip_target=192.168.0.100
1678
1679
Auke Kok6224e012006-06-08 11:15:35 -070016807.3 MII Monitor Operation
Linus Torvalds1da177e2005-04-16 15:20:36 -07001681-------------------------
1682
1683 The MII monitor monitors only the carrier state of the local
1684network interface. It accomplishes this in one of three ways: by
1685depending upon the device driver to maintain its carrier state, by
1686querying the device's MII registers, or by making an ethtool query to
1687the device.
1688
1689 If the use_carrier module parameter is 1 (the default value),
1690then the MII monitor will rely on the driver for carrier state
1691information (via the netif_carrier subsystem). As explained in the
1692use_carrier parameter information, above, if the MII monitor fails to
1693detect carrier loss on the device (e.g., when the cable is physically
1694disconnected), it may be that the driver does not support
1695netif_carrier.
1696
1697 If use_carrier is 0, then the MII monitor will first query the
1698device's (via ioctl) MII registers and check the link state. If that
1699request fails (not just that it returns carrier down), then the MII
1700monitor will make an ethtool ETHOOL_GLINK request to attempt to obtain
1701the same information. If both methods fail (i.e., the driver either
1702does not support or had some error in processing both the MII register
1703and ethtool requests), then the MII monitor will assume the link is
1704up.
1705
Auke Kok6224e012006-06-08 11:15:35 -070017068. Potential Sources of Trouble
Linus Torvalds1da177e2005-04-16 15:20:36 -07001707===============================
1708
Auke Kok6224e012006-06-08 11:15:35 -070017098.1 Adventures in Routing
Linus Torvalds1da177e2005-04-16 15:20:36 -07001710-------------------------
1711
1712 When bonding is configured, it is important that the slave
Auke Kok6224e012006-06-08 11:15:35 -07001713devices not have routes that supersede routes of the master (or,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001714generally, not have routes at all). For example, suppose the bonding
1715device bond0 has two slaves, eth0 and eth1, and the routing table is
1716as follows:
1717
1718Kernel IP routing table
1719Destination Gateway Genmask Flags MSS Window irtt Iface
172010.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 eth0
172110.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 eth1
172210.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 bond0
1723127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
1724
1725 This routing configuration will likely still update the
1726receive/transmit times in the driver (needed by the ARP monitor), but
1727may bypass the bonding driver (because outgoing traffic to, in this
1728case, another host on network 10 would use eth0 or eth1 before bond0).
1729
1730 The ARP monitor (and ARP itself) may become confused by this
1731configuration, because ARP requests (generated by the ARP monitor)
1732will be sent on one interface (bond0), but the corresponding reply
1733will arrive on a different interface (eth0). This reply looks to ARP
1734as an unsolicited ARP reply (because ARP matches replies on an
1735interface basis), and is discarded. The MII monitor is not affected
1736by the state of the routing table.
1737
1738 The solution here is simply to insure that slaves do not have
1739routes of their own, and if for some reason they must, those routes do
Auke Kok6224e012006-06-08 11:15:35 -07001740not supersede routes of their master. This should generally be the
Linus Torvalds1da177e2005-04-16 15:20:36 -07001741case, but unusual configurations or errant manual or automatic static
1742route additions may cause trouble.
1743
Auke Kok6224e012006-06-08 11:15:35 -070017448.2 Ethernet Device Renaming
Linus Torvalds1da177e2005-04-16 15:20:36 -07001745----------------------------
1746
1747 On systems with network configuration scripts that do not
1748associate physical devices directly with network interface names (so
1749that the same physical device always has the same "ethX" name), it may
1750be necessary to add some special logic to either /etc/modules.conf or
1751/etc/modprobe.conf (depending upon which is installed on the system).
1752
1753 For example, given a modules.conf containing the following:
1754
1755alias bond0 bonding
1756options bond0 mode=some-mode miimon=50
1757alias eth0 tg3
1758alias eth1 tg3
1759alias eth2 e1000
1760alias eth3 e1000
1761
1762 If neither eth0 and eth1 are slaves to bond0, then when the
1763bond0 interface comes up, the devices may end up reordered. This
1764happens because bonding is loaded first, then its slave device's
1765drivers are loaded next. Since no other drivers have been loaded,
1766when the e1000 driver loads, it will receive eth0 and eth1 for its
1767devices, but the bonding configuration tries to enslave eth2 and eth3
1768(which may later be assigned to the tg3 devices).
1769
1770 Adding the following:
1771
1772add above bonding e1000 tg3
1773
1774 causes modprobe to load e1000 then tg3, in that order, when
1775bonding is loaded. This command is fully documented in the
1776modules.conf manual page.
1777
1778 On systems utilizing modprobe.conf (or modprobe.conf.local),
1779an equivalent problem can occur. In this case, the following can be
1780added to modprobe.conf (or modprobe.conf.local, as appropriate), as
1781follows (all on one line; it has been split here for clarity):
1782
1783install bonding /sbin/modprobe tg3; /sbin/modprobe e1000;
1784 /sbin/modprobe --ignore-install bonding
1785
1786 This will, when loading the bonding module, rather than
1787performing the normal action, instead execute the provided command.
1788This command loads the device drivers in the order needed, then calls
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001789modprobe with --ignore-install to cause the normal action to then take
Linus Torvalds1da177e2005-04-16 15:20:36 -07001790place. Full documentation on this can be found in the modprobe.conf
1791and modprobe manual pages.
1792
Auke Kok6224e012006-06-08 11:15:35 -070017938.3. Painfully Slow Or No Failed Link Detection By Miimon
Linus Torvalds1da177e2005-04-16 15:20:36 -07001794---------------------------------------------------------
1795
1796 By default, bonding enables the use_carrier option, which
1797instructs bonding to trust the driver to maintain carrier state.
1798
1799 As discussed in the options section, above, some drivers do
1800not support the netif_carrier_on/_off link state tracking system.
1801With use_carrier enabled, bonding will always see these links as up,
1802regardless of their actual state.
1803
1804 Additionally, other drivers do support netif_carrier, but do
1805not maintain it in real time, e.g., only polling the link state at
1806some fixed interval. In this case, miimon will detect failures, but
1807only after some long period of time has expired. If it appears that
1808miimon is very slow in detecting link failures, try specifying
1809use_carrier=0 to see if that improves the failure detection time. If
1810it does, then it may be that the driver checks the carrier state at a
1811fixed interval, but does not cache the MII register values (so the
1812use_carrier=0 method of querying the registers directly works). If
1813use_carrier=0 does not improve the failover, then the driver may cache
1814the registers, or the problem may be elsewhere.
1815
1816 Also, remember that miimon only checks for the device's
1817carrier state. It has no way to determine the state of devices on or
1818beyond other ports of a switch, or if a switch is refusing to pass
1819traffic while still maintaining carrier on.
1820
Auke Kok6224e012006-06-08 11:15:35 -070018219. SNMP agents
Linus Torvalds1da177e2005-04-16 15:20:36 -07001822===============
1823
1824 If running SNMP agents, the bonding driver should be loaded
1825before any network drivers participating in a bond. This requirement
Tobias Klauserd533f672005-09-10 00:26:46 -07001826is due to the interface index (ipAdEntIfIndex) being associated to
Linus Torvalds1da177e2005-04-16 15:20:36 -07001827the first interface found with a given IP address. That is, there is
1828only one ipAdEntIfIndex for each IP address. For example, if eth0 and
1829eth1 are slaves of bond0 and the driver for eth0 is loaded before the
1830bonding driver, the interface for the IP address will be associated
1831with the eth0 interface. This configuration is shown below, the IP
1832address 192.168.1.1 has an interface index of 2 which indexes to eth0
1833in the ifDescr table (ifDescr.2).
1834
1835 interfaces.ifTable.ifEntry.ifDescr.1 = lo
1836 interfaces.ifTable.ifEntry.ifDescr.2 = eth0
1837 interfaces.ifTable.ifEntry.ifDescr.3 = eth1
1838 interfaces.ifTable.ifEntry.ifDescr.4 = eth2
1839 interfaces.ifTable.ifEntry.ifDescr.5 = eth3
1840 interfaces.ifTable.ifEntry.ifDescr.6 = bond0
1841 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 5
1842 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
1843 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 4
1844 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
1845
1846 This problem is avoided by loading the bonding driver before
1847any network drivers participating in a bond. Below is an example of
1848loading the bonding driver first, the IP address 192.168.1.1 is
1849correctly associated with ifDescr.2.
1850
1851 interfaces.ifTable.ifEntry.ifDescr.1 = lo
1852 interfaces.ifTable.ifEntry.ifDescr.2 = bond0
1853 interfaces.ifTable.ifEntry.ifDescr.3 = eth0
1854 interfaces.ifTable.ifEntry.ifDescr.4 = eth1
1855 interfaces.ifTable.ifEntry.ifDescr.5 = eth2
1856 interfaces.ifTable.ifEntry.ifDescr.6 = eth3
1857 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 6
1858 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
1859 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 5
1860 ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
1861
1862 While some distributions may not report the interface name in
1863ifDescr, the association between the IP address and IfIndex remains
1864and SNMP functions such as Interface_Scan_Next will report that
1865association.
1866
Auke Kok6224e012006-06-08 11:15:35 -0700186710. Promiscuous mode
Linus Torvalds1da177e2005-04-16 15:20:36 -07001868====================
1869
1870 When running network monitoring tools, e.g., tcpdump, it is
1871common to enable promiscuous mode on the device, so that all traffic
1872is seen (instead of seeing only traffic destined for the local host).
1873The bonding driver handles promiscuous mode changes to the bonding
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001874master device (e.g., bond0), and propagates the setting to the slave
Linus Torvalds1da177e2005-04-16 15:20:36 -07001875devices.
1876
1877 For the balance-rr, balance-xor, broadcast, and 802.3ad modes,
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001878the promiscuous mode setting is propagated to all slaves.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001879
1880 For the active-backup, balance-tlb and balance-alb modes, the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001881promiscuous mode setting is propagated only to the active slave.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001882
1883 For balance-tlb mode, the active slave is the slave currently
1884receiving inbound traffic.
1885
1886 For balance-alb mode, the active slave is the slave used as a
1887"primary." This slave is used for mode-specific control traffic, for
1888sending to peers that are unassigned or if the load is unbalanced.
1889
1890 For the active-backup, balance-tlb and balance-alb modes, when
1891the active slave changes (e.g., due to a link failure), the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001892promiscuous setting will be propagated to the new active slave.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001893
Auke Kok6224e012006-06-08 11:15:35 -0700189411. Configuring Bonding for High Availability
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001895=============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -07001896
1897 High Availability refers to configurations that provide
1898maximum network availability by having redundant or backup devices,
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001899links or switches between the host and the rest of the world. The
1900goal is to provide the maximum availability of network connectivity
1901(i.e., the network always works), even though other configurations
1902could provide higher throughput.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001903
Auke Kok6224e012006-06-08 11:15:35 -0700190411.1 High Availability in a Single Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -07001905--------------------------------------------------
1906
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001907 If two hosts (or a host and a single switch) are directly
1908connected via multiple physical links, then there is no availability
1909penalty to optimizing for maximum bandwidth. In this case, there is
1910only one switch (or peer), so if it fails, there is no alternative
1911access to fail over to. Additionally, the bonding load balance modes
1912support link monitoring of their members, so if individual links fail,
1913the load will be rebalanced across the remaining devices.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001914
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001915 See Section 13, "Configuring Bonding for Maximum Throughput"
1916for information on configuring bonding with one peer device.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001917
Auke Kok6224e012006-06-08 11:15:35 -0700191811.2 High Availability in a Multiple Switch Topology
Linus Torvalds1da177e2005-04-16 15:20:36 -07001919----------------------------------------------------
1920
1921 With multiple switches, the configuration of bonding and the
1922network changes dramatically. In multiple switch topologies, there is
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001923a trade off between network availability and usable bandwidth.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001924
1925 Below is a sample network, configured to maximize the
1926availability of the network:
1927
1928 | |
1929 |port3 port3|
1930 +-----+----+ +-----+----+
1931 | |port2 ISL port2| |
1932 | switch A +--------------------------+ switch B |
1933 | | | |
1934 +-----+----+ +-----++---+
1935 |port1 port1|
1936 | +-------+ |
1937 +-------------+ host1 +---------------+
1938 eth0 +-------+ eth1
1939
1940 In this configuration, there is a link between the two
1941switches (ISL, or inter switch link), and multiple ports connecting to
1942the outside world ("port3" on each switch). There is no technical
1943reason that this could not be extended to a third switch.
1944
Auke Kok6224e012006-06-08 11:15:35 -0700194511.2.1 HA Bonding Mode Selection for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001946-------------------------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001947
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001948 In a topology such as the example above, the active-backup and
1949broadcast modes are the only useful bonding modes when optimizing for
1950availability; the other modes require all links to terminate on the
1951same peer for them to behave rationally.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001952
1953active-backup: This is generally the preferred mode, particularly if
1954 the switches have an ISL and play together well. If the
1955 network configuration is such that one switch is specifically
1956 a backup switch (e.g., has lower capacity, higher cost, etc),
1957 then the primary option can be used to insure that the
1958 preferred link is always used when it is available.
1959
1960broadcast: This mode is really a special purpose mode, and is suitable
1961 only for very specific needs. For example, if the two
1962 switches are not connected (no ISL), and the networks beyond
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001963 them are totally independent. In this case, if it is
Linus Torvalds1da177e2005-04-16 15:20:36 -07001964 necessary for some specific one-way traffic to reach both
1965 independent networks, then the broadcast mode may be suitable.
1966
Auke Kok6224e012006-06-08 11:15:35 -0700196711.2.2 HA Link Monitoring Selection for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001968----------------------------------------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07001969
1970 The choice of link monitoring ultimately depends upon your
1971switch. If the switch can reliably fail ports in response to other
1972failures, then either the MII or ARP monitors should work. For
1973example, in the above example, if the "port3" link fails at the remote
1974end, the MII monitor has no direct means to detect this. The ARP
1975monitor could be configured with a target at the remote end of port3,
1976thus detecting that failure without switch support.
1977
1978 In general, however, in a multiple switch topology, the ARP
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001979monitor can provide a higher level of reliability in detecting end to
1980end connectivity failures (which may be caused by the failure of any
1981individual component to pass traffic for any reason). Additionally,
1982the ARP monitor should be configured with multiple targets (at least
1983one for each switch in the network). This will insure that,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001984regardless of which switch is active, the ARP monitor has a suitable
1985target to query.
1986
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001987 Note, also, that of late many switches now support a functionality
1988generally referred to as "trunk failover." This is a feature of the
1989switch that causes the link state of a particular switch port to be set
1990down (or up) when the state of another switch port goes down (or up).
Matt LaPlante19f59462009-04-27 15:06:31 +02001991Its purpose is to propagate link failures from logically "exterior" ports
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08001992to the logically "interior" ports that bonding is able to monitor via
1993miimon. Availability and configuration for trunk failover varies by
1994switch, but this can be a viable alternative to the ARP monitor when using
1995suitable switches.
Linus Torvalds1da177e2005-04-16 15:20:36 -07001996
Auke Kok6224e012006-06-08 11:15:35 -0700199712. Configuring Bonding for Maximum Throughput
Jay Vosburgh00354cf2005-07-21 12:18:02 -07001998==============================================
Linus Torvalds1da177e2005-04-16 15:20:36 -07001999
Auke Kok6224e012006-06-08 11:15:35 -0700200012.1 Maximizing Throughput in a Single Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002001------------------------------------------------------
2002
2003 In a single switch configuration, the best method to maximize
2004throughput depends upon the application and network environment. The
2005various load balancing modes each have strengths and weaknesses in
2006different environments, as detailed below.
2007
2008 For this discussion, we will break down the topologies into
2009two categories. Depending upon the destination of most traffic, we
2010categorize them into either "gatewayed" or "local" configurations.
2011
2012 In a gatewayed configuration, the "switch" is acting primarily
2013as a router, and the majority of traffic passes through this router to
2014other networks. An example would be the following:
2015
2016
2017 +----------+ +----------+
2018 | |eth0 port1| | to other networks
2019 | Host A +---------------------+ router +------------------->
2020 | +---------------------+ | Hosts B and C are out
2021 | |eth1 port2| | here somewhere
2022 +----------+ +----------+
2023
2024 The router may be a dedicated router device, or another host
2025acting as a gateway. For our discussion, the important point is that
2026the majority of traffic from Host A will pass through the router to
2027some other network before reaching its final destination.
2028
2029 In a gatewayed network configuration, although Host A may
2030communicate with many other systems, all of its traffic will be sent
2031and received via one other peer on the local network, the router.
2032
2033 Note that the case of two systems connected directly via
2034multiple physical links is, for purposes of configuring bonding, the
2035same as a gatewayed configuration. In that case, it happens that all
2036traffic is destined for the "gateway" itself, not some other network
2037beyond the gateway.
2038
2039 In a local configuration, the "switch" is acting primarily as
2040a switch, and the majority of traffic passes through this switch to
2041reach other stations on the same network. An example would be the
2042following:
2043
2044 +----------+ +----------+ +--------+
2045 | |eth0 port1| +-------+ Host B |
2046 | Host A +------------+ switch |port3 +--------+
2047 | +------------+ | +--------+
2048 | |eth1 port2| +------------------+ Host C |
2049 +----------+ +----------+port4 +--------+
2050
2051
2052 Again, the switch may be a dedicated switch device, or another
2053host acting as a gateway. For our discussion, the important point is
2054that the majority of traffic from Host A is destined for other hosts
2055on the same local network (Hosts B and C in the above example).
2056
2057 In summary, in a gatewayed configuration, traffic to and from
2058the bonded device will be to the same MAC level peer on the network
2059(the gateway itself, i.e., the router), regardless of its final
2060destination. In a local configuration, traffic flows directly to and
2061from the final destinations, thus, each destination (Host B, Host C)
2062will be addressed directly by their individual MAC addresses.
2063
2064 This distinction between a gatewayed and a local network
2065configuration is important because many of the load balancing modes
2066available use the MAC addresses of the local network source and
2067destination to make load balancing decisions. The behavior of each
2068mode is described below.
2069
2070
Auke Kok6224e012006-06-08 11:15:35 -0700207112.1.1 MT Bonding Mode Selection for Single Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002072-----------------------------------------------------------
2073
2074 This configuration is the easiest to set up and to understand,
2075although you will have to decide which bonding mode best suits your
2076needs. The trade offs for each mode are detailed below:
2077
2078balance-rr: This mode is the only mode that will permit a single
2079 TCP/IP connection to stripe traffic across multiple
2080 interfaces. It is therefore the only mode that will allow a
2081 single TCP/IP stream to utilize more than one interface's
2082 worth of throughput. This comes at a cost, however: the
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08002083 striping generally results in peer systems receiving packets out
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002084 of order, causing TCP/IP's congestion control system to kick
2085 in, often by retransmitting segments.
2086
2087 It is possible to adjust TCP/IP's congestion limits by
2088 altering the net.ipv4.tcp_reordering sysctl parameter. The
2089 usual default value is 3, and the maximum useful value is 127.
2090 For a four interface balance-rr bond, expect that a single
2091 TCP/IP stream will utilize no more than approximately 2.3
2092 interface's worth of throughput, even after adjusting
2093 tcp_reordering.
2094
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08002095 Note that the fraction of packets that will be delivered out of
2096 order is highly variable, and is unlikely to be zero. The level
2097 of reordering depends upon a variety of factors, including the
2098 networking interfaces, the switch, and the topology of the
2099 configuration. Speaking in general terms, higher speed network
2100 cards produce more reordering (due to factors such as packet
2101 coalescing), and a "many to many" topology will reorder at a
2102 higher rate than a "many slow to one fast" configuration.
2103
2104 Many switches do not support any modes that stripe traffic
2105 (instead choosing a port based upon IP or MAC level addresses);
2106 for those devices, traffic for a particular connection flowing
2107 through the switch to a balance-rr bond will not utilize greater
2108 than one interface's worth of bandwidth.
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002109
2110 If you are utilizing protocols other than TCP/IP, UDP for
2111 example, and your application can tolerate out of order
2112 delivery, then this mode can allow for single stream datagram
2113 performance that scales near linearly as interfaces are added
2114 to the bond.
2115
2116 This mode requires the switch to have the appropriate ports
2117 configured for "etherchannel" or "trunking."
2118
2119active-backup: There is not much advantage in this network topology to
2120 the active-backup mode, as the inactive backup devices are all
2121 connected to the same peer as the primary. In this case, a
2122 load balancing mode (with link monitoring) will provide the
2123 same level of network availability, but with increased
2124 available bandwidth. On the plus side, active-backup mode
2125 does not require any configuration of the switch, so it may
2126 have value if the hardware available does not support any of
2127 the load balance modes.
2128
2129balance-xor: This mode will limit traffic such that packets destined
2130 for specific peers will always be sent over the same
2131 interface. Since the destination is determined by the MAC
2132 addresses involved, this mode works best in a "local" network
2133 configuration (as described above), with destinations all on
2134 the same local network. This mode is likely to be suboptimal
2135 if all your traffic is passed through a single router (i.e., a
2136 "gatewayed" network configuration, as described above).
2137
2138 As with balance-rr, the switch ports need to be configured for
2139 "etherchannel" or "trunking."
2140
2141broadcast: Like active-backup, there is not much advantage to this
2142 mode in this type of network topology.
2143
2144802.3ad: This mode can be a good choice for this type of network
2145 topology. The 802.3ad mode is an IEEE standard, so all peers
2146 that implement 802.3ad should interoperate well. The 802.3ad
2147 protocol includes automatic configuration of the aggregates,
2148 so minimal manual configuration of the switch is needed
2149 (typically only to designate that some set of devices is
2150 available for 802.3ad). The 802.3ad standard also mandates
2151 that frames be delivered in order (within certain limits), so
2152 in general single connections will not see misordering of
2153 packets. The 802.3ad mode does have some drawbacks: the
2154 standard mandates that all devices in the aggregate operate at
2155 the same speed and duplex. Also, as with all bonding load
2156 balance modes other than balance-rr, no single connection will
2157 be able to utilize more than a single interface's worth of
2158 bandwidth.
2159
2160 Additionally, the linux bonding 802.3ad implementation
2161 distributes traffic by peer (using an XOR of MAC addresses),
2162 so in a "gatewayed" configuration, all outgoing traffic will
2163 generally use the same device. Incoming traffic may also end
2164 up on a single device, but that is dependent upon the
2165 balancing policy of the peer's 8023.ad implementation. In a
2166 "local" configuration, traffic will be distributed across the
2167 devices in the bond.
2168
2169 Finally, the 802.3ad mode mandates the use of the MII monitor,
2170 therefore, the ARP monitor is not available in this mode.
2171
2172balance-tlb: The balance-tlb mode balances outgoing traffic by peer.
2173 Since the balancing is done according to MAC address, in a
2174 "gatewayed" configuration (as described above), this mode will
2175 send all traffic across a single device. However, in a
2176 "local" network configuration, this mode balances multiple
2177 local network peers across devices in a vaguely intelligent
2178 manner (not a simple XOR as in balance-xor or 802.3ad mode),
2179 so that mathematically unlucky MAC addresses (i.e., ones that
2180 XOR to the same value) will not all "bunch up" on a single
2181 interface.
2182
2183 Unlike 802.3ad, interfaces may be of differing speeds, and no
2184 special switch configuration is required. On the down side,
2185 in this mode all incoming traffic arrives over a single
2186 interface, this mode requires certain ethtool support in the
2187 network device driver of the slave interfaces, and the ARP
2188 monitor is not available.
2189
2190balance-alb: This mode is everything that balance-tlb is, and more.
2191 It has all of the features (and restrictions) of balance-tlb,
2192 and will also balance incoming traffic from local network
2193 peers (as described in the Bonding Module Options section,
2194 above).
2195
2196 The only additional down side to this mode is that the network
2197 device driver must support changing the hardware address while
2198 the device is open.
2199
Auke Kok6224e012006-06-08 11:15:35 -0700220012.1.2 MT Link Monitoring for Single Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002201----------------------------------------------------
2202
2203 The choice of link monitoring may largely depend upon which
2204mode you choose to use. The more advanced load balancing modes do not
2205support the use of the ARP monitor, and are thus restricted to using
2206the MII monitor (which does not provide as high a level of end to end
2207assurance as the ARP monitor).
2208
Auke Kok6224e012006-06-08 11:15:35 -0700220912.2 Maximum Throughput in a Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002210-----------------------------------------------------
2211
2212 Multiple switches may be utilized to optimize for throughput
2213when they are configured in parallel as part of an isolated network
2214between two or more systems, for example:
2215
2216 +-----------+
2217 | Host A |
2218 +-+---+---+-+
2219 | | |
2220 +--------+ | +---------+
2221 | | |
2222 +------+---+ +-----+----+ +-----+----+
2223 | Switch A | | Switch B | | Switch C |
2224 +------+---+ +-----+----+ +-----+----+
2225 | | |
2226 +--------+ | +---------+
2227 | | |
2228 +-+---+---+-+
2229 | Host B |
2230 +-----------+
2231
2232 In this configuration, the switches are isolated from one
2233another. One reason to employ a topology such as this is for an
2234isolated network with many hosts (a cluster configured for high
2235performance, for example), using multiple smaller switches can be more
2236cost effective than a single larger switch, e.g., on a network with 24
2237hosts, three 24 port switches can be significantly less expensive than
2238a single 72 port switch.
2239
2240 If access beyond the network is required, an individual host
2241can be equipped with an additional network device connected to an
2242external network; this host then additionally acts as a gateway.
2243
Auke Kok6224e012006-06-08 11:15:35 -0700224412.2.1 MT Bonding Mode Selection for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002245-------------------------------------------------------------
2246
2247 In actual practice, the bonding mode typically employed in
2248configurations of this type is balance-rr. Historically, in this
2249network configuration, the usual caveats about out of order packet
2250delivery are mitigated by the use of network adapters that do not do
2251any kind of packet coalescing (via the use of NAPI, or because the
2252device itself does not generate interrupts until some number of
2253packets has arrived). When employed in this fashion, the balance-rr
2254mode allows individual connections between two hosts to effectively
2255utilize greater than one interface's bandwidth.
2256
Auke Kok6224e012006-06-08 11:15:35 -0700225712.2.2 MT Link Monitoring for Multiple Switch Topology
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002258------------------------------------------------------
2259
2260 Again, in actual practice, the MII monitor is most often used
2261in this configuration, as performance is given preference over
2262availability. The ARP monitor will function in this topology, but its
2263advantages over the MII monitor are mitigated by the volume of probes
2264needed as the number of systems involved grows (remember that each
2265host in the network is configured with bonding).
2266
Auke Kok6224e012006-06-08 11:15:35 -0700226713. Switch Behavior Issues
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002268==========================
2269
Auke Kok6224e012006-06-08 11:15:35 -0700227013.1 Link Establishment and Failover Delays
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002271-------------------------------------------
2272
2273 Some switches exhibit undesirable behavior with regard to the
2274timing of link up and down reporting by the switch.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002275
2276 First, when a link comes up, some switches may indicate that
2277the link is up (carrier available), but not pass traffic over the
2278interface for some period of time. This delay is typically due to
2279some type of autonegotiation or routing protocol, but may also occur
2280during switch initialization (e.g., during recovery after a switch
2281failure). If you find this to be a problem, specify an appropriate
2282value to the updelay bonding module option to delay the use of the
2283relevant interface(s).
2284
2285 Second, some switches may "bounce" the link state one or more
2286times while a link is changing state. This occurs most commonly while
2287the switch is initializing. Again, an appropriate updelay value may
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002288help.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002289
2290 Note that when a bonding interface has no active links, the
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002291driver will immediately reuse the first link that goes up, even if the
2292updelay parameter has been specified (the updelay is ignored in this
2293case). If there are slave interfaces waiting for the updelay timeout
2294to expire, the interface that first went into that state will be
2295immediately reused. This reduces down time of the network if the
2296value of updelay has been overestimated, and since this occurs only in
2297cases with no connectivity, there is no additional penalty for
2298ignoring the updelay.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002299
2300 In addition to the concerns about switch timings, if your
2301switches take a long time to go into backup mode, it may be desirable
2302to not activate a backup interface immediately after a link goes down.
2303Failover may be delayed via the downdelay bonding module option.
2304
Auke Kok6224e012006-06-08 11:15:35 -0700230513.2 Duplicated Incoming Packets
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002306--------------------------------
2307
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08002308 NOTE: Starting with version 3.0.2, the bonding driver has logic to
2309suppress duplicate packets, which should largely eliminate this problem.
2310The following description is kept for reference.
2311
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002312 It is not uncommon to observe a short burst of duplicated
2313traffic when the bonding device is first used, or after it has been
2314idle for some period of time. This is most easily observed by issuing
2315a "ping" to some other host on the network, and noticing that the
2316output from ping flags duplicates (typically one per slave).
2317
2318 For example, on a bond in active-backup mode with five slaves
2319all connected to one switch, the output may appear as follows:
2320
2321# ping -n 10.0.4.2
2322PING 10.0.4.2 (10.0.4.2) from 10.0.3.10 : 56(84) bytes of data.
232364 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.7 ms
232464 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
232564 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
232664 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
232764 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
232864 bytes from 10.0.4.2: icmp_seq=2 ttl=64 time=0.216 ms
232964 bytes from 10.0.4.2: icmp_seq=3 ttl=64 time=0.267 ms
233064 bytes from 10.0.4.2: icmp_seq=4 ttl=64 time=0.222 ms
2331
2332 This is not due to an error in the bonding driver, rather, it
2333is a side effect of how many switches update their MAC forwarding
2334tables. Initially, the switch does not associate the MAC address in
2335the packet with a particular switch port, and so it may send the
2336traffic to all ports until its MAC forwarding table is updated. Since
2337the interfaces attached to the bond may occupy multiple ports on a
2338single switch, when the switch (temporarily) floods the traffic to all
2339ports, the bond device receives multiple copies of the same packet
2340(one per slave device).
2341
2342 The duplicated packet behavior is switch dependent, some
2343switches exhibit this, and some do not. On switches that display this
2344behavior, it can be induced by clearing the MAC forwarding table (on
2345most Cisco switches, the privileged command "clear mac address-table
2346dynamic" will accomplish this).
2347
Auke Kok6224e012006-06-08 11:15:35 -0700234814. Hardware Specific Considerations
Linus Torvalds1da177e2005-04-16 15:20:36 -07002349====================================
2350
2351 This section contains additional information for configuring
2352bonding on specific hardware platforms, or for interfacing bonding
2353with particular switches or other devices.
2354
Auke Kok6224e012006-06-08 11:15:35 -0700235514.1 IBM BladeCenter
Linus Torvalds1da177e2005-04-16 15:20:36 -07002356--------------------
2357
2358 This applies to the JS20 and similar systems.
2359
2360 On the JS20 blades, the bonding driver supports only
2361balance-rr, active-backup, balance-tlb and balance-alb modes. This is
2362largely due to the network topology inside the BladeCenter, detailed
2363below.
2364
2365JS20 network adapter information
2366--------------------------------
2367
2368 All JS20s come with two Broadcom Gigabit Ethernet ports
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002369integrated on the planar (that's "motherboard" in IBM-speak). In the
2370BladeCenter chassis, the eth0 port of all JS20 blades is hard wired to
2371I/O Module #1; similarly, all eth1 ports are wired to I/O Module #2.
2372An add-on Broadcom daughter card can be installed on a JS20 to provide
2373two more Gigabit Ethernet ports. These ports, eth2 and eth3, are
2374wired to I/O Modules 3 and 4, respectively.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002375
2376 Each I/O Module may contain either a switch or a passthrough
2377module (which allows ports to be directly connected to an external
2378switch). Some bonding modes require a specific BladeCenter internal
2379network topology in order to function; these are detailed below.
2380
2381 Additional BladeCenter-specific networking information can be
2382found in two IBM Redbooks (www.ibm.com/redbooks):
2383
2384"IBM eServer BladeCenter Networking Options"
2385"IBM eServer BladeCenter Layer 2-7 Network Switching"
2386
2387BladeCenter networking configuration
2388------------------------------------
2389
2390 Because a BladeCenter can be configured in a very large number
2391of ways, this discussion will be confined to describing basic
2392configurations.
2393
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002394 Normally, Ethernet Switch Modules (ESMs) are used in I/O
Linus Torvalds1da177e2005-04-16 15:20:36 -07002395modules 1 and 2. In this configuration, the eth0 and eth1 ports of a
2396JS20 will be connected to different internal switches (in the
2397respective I/O modules).
2398
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002399 A passthrough module (OPM or CPM, optical or copper,
2400passthrough module) connects the I/O module directly to an external
2401switch. By using PMs in I/O module #1 and #2, the eth0 and eth1
2402interfaces of a JS20 can be redirected to the outside world and
2403connected to a common external switch.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002404
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002405 Depending upon the mix of ESMs and PMs, the network will
2406appear to bonding as either a single switch topology (all PMs) or as a
2407multiple switch topology (one or more ESMs, zero or more PMs). It is
2408also possible to connect ESMs together, resulting in a configuration
2409much like the example in "High Availability in a Multiple Switch
2410Topology," above.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002411
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002412Requirements for specific modes
2413-------------------------------
Linus Torvalds1da177e2005-04-16 15:20:36 -07002414
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002415 The balance-rr mode requires the use of passthrough modules
2416for devices in the bond, all connected to an common external switch.
2417That switch must be configured for "etherchannel" or "trunking" on the
Linus Torvalds1da177e2005-04-16 15:20:36 -07002418appropriate ports, as is usual for balance-rr.
2419
2420 The balance-alb and balance-tlb modes will function with
2421either switch modules or passthrough modules (or a mix). The only
2422specific requirement for these modes is that all network interfaces
2423must be able to reach all destinations for traffic sent over the
2424bonding device (i.e., the network must converge at some point outside
2425the BladeCenter).
2426
2427 The active-backup mode has no additional requirements.
2428
2429Link monitoring issues
2430----------------------
2431
2432 When an Ethernet Switch Module is in place, only the ARP
2433monitor will reliably detect link loss to an external switch. This is
2434nothing unusual, but examination of the BladeCenter cabinet would
2435suggest that the "external" network ports are the ethernet ports for
2436the system, when it fact there is a switch between these "external"
2437ports and the devices on the JS20 system itself. The MII monitor is
2438only able to detect link failures between the ESM and the JS20 system.
2439
2440 When a passthrough module is in place, the MII monitor does
2441detect failures to the "external" port, which is then directly
2442connected to the JS20 system.
2443
2444Other concerns
2445--------------
2446
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002447 The Serial Over LAN (SoL) link is established over the primary
Linus Torvalds1da177e2005-04-16 15:20:36 -07002448ethernet (eth0) only, therefore, any loss of link to eth0 will result
2449in losing your SoL connection. It will not fail over with other
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002450network traffic, as the SoL system is beyond the control of the
2451bonding driver.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002452
2453 It may be desirable to disable spanning tree on the switch
2454(either the internal Ethernet Switch Module, or an external switch) to
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002455avoid fail-over delay issues when using bonding.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002456
2457
Auke Kok6224e012006-06-08 11:15:35 -0700245815. Frequently Asked Questions
Linus Torvalds1da177e2005-04-16 15:20:36 -07002459==============================
2460
24611. Is it SMP safe?
2462
2463 Yes. The old 2.0.xx channel bonding patch was not SMP safe.
2464The new driver was designed to be SMP safe from the start.
2465
24662. What type of cards will work with it?
2467
2468 Any Ethernet type cards (you can even mix cards - a Intel
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002469EtherExpress PRO/100 and a 3com 3c905b, for example). For most modes,
2470devices need not be of the same speed.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002471
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08002472 Starting with version 3.2.1, bonding also supports Infiniband
2473slaves in active-backup mode.
2474
Linus Torvalds1da177e2005-04-16 15:20:36 -070024753. How many bonding devices can I have?
2476
2477 There is no limit.
2478
24794. How many slaves can a bonding device have?
2480
2481 This is limited only by the number of network interfaces Linux
2482supports and/or the number of network cards you can place in your
2483system.
2484
24855. What happens when a slave link dies?
2486
2487 If link monitoring is enabled, then the failing device will be
2488disabled. The active-backup mode will fail over to a backup link, and
2489other modes will ignore the failed link. The link will continue to be
2490monitored, and should it recover, it will rejoin the bond (in whatever
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002491manner is appropriate for the mode). See the sections on High
2492Availability and the documentation for each mode for additional
2493information.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002494
2495 Link monitoring can be enabled via either the miimon or
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002496arp_interval parameters (described in the module parameters section,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002497above). In general, miimon monitors the carrier state as sensed by
2498the underlying network device, and the arp monitor (arp_interval)
2499monitors connectivity to another host on the local network.
2500
2501 If no link monitoring is configured, the bonding driver will
2502be unable to detect link failures, and will assume that all links are
2503always available. This will likely result in lost packets, and a
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002504resulting degradation of performance. The precise performance loss
Linus Torvalds1da177e2005-04-16 15:20:36 -07002505depends upon the bonding mode and network configuration.
2506
25076. Can bonding be used for High Availability?
2508
2509 Yes. See the section on High Availability for details.
2510
25117. Which switches/systems does it work with?
2512
2513 The full answer to this depends upon the desired mode.
2514
2515 In the basic balance modes (balance-rr and balance-xor), it
2516works with any system that supports etherchannel (also called
2517trunking). Most managed switches currently available have such
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002518support, and many unmanaged switches as well.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002519
2520 The advanced balance modes (balance-tlb and balance-alb) do
2521not have special switch requirements, but do need device drivers that
2522support specific features (described in the appropriate section under
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002523module parameters, above).
Linus Torvalds1da177e2005-04-16 15:20:36 -07002524
Auke Kok6224e012006-06-08 11:15:35 -07002525 In 802.3ad mode, it works with systems that support IEEE
Linus Torvalds1da177e2005-04-16 15:20:36 -07002526802.3ad Dynamic Link Aggregation. Most managed and many unmanaged
2527switches currently available support 802.3ad.
2528
2529 The active-backup mode should work with any Layer-II switch.
2530
25318. Where does a bonding device get its MAC address from?
2532
Jay Vosburgh9a6c6862007-11-13 20:25:48 -08002533 When using slave devices that have fixed MAC addresses, or when
2534the fail_over_mac option is enabled, the bonding device's MAC address is
2535the MAC address of the active slave.
2536
2537 For other configurations, if not explicitly configured (with
2538ifconfig or ip link), the MAC address of the bonding device is taken from
2539its first slave device. This MAC address is then passed to all following
2540slaves and remains persistent (even if the first slave is removed) until
2541the bonding device is brought down or reconfigured.
Linus Torvalds1da177e2005-04-16 15:20:36 -07002542
2543 If you wish to change the MAC address, you can set it with
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002544ifconfig or ip link:
Linus Torvalds1da177e2005-04-16 15:20:36 -07002545
2546# ifconfig bond0 hw ether 00:11:22:33:44:55
2547
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002548# ip link set bond0 address 66:77:88:99:aa:bb
2549
Linus Torvalds1da177e2005-04-16 15:20:36 -07002550 The MAC address can be also changed by bringing down/up the
2551device and then changing its slaves (or their order):
2552
2553# ifconfig bond0 down ; modprobe -r bonding
2554# ifconfig bond0 .... up
2555# ifenslave bond0 eth...
2556
2557 This method will automatically take the address from the next
2558slave that is added.
2559
2560 To restore your slaves' MAC addresses, you need to detach them
2561from the bond (`ifenslave -d bond0 eth0'). The bonding driver will
2562then restore the MAC addresses that the slaves had before they were
2563enslaved.
2564
Jay Vosburgh00354cf2005-07-21 12:18:02 -0700256516. Resources and Links
Linus Torvalds1da177e2005-04-16 15:20:36 -07002566=======================
2567
Nicolas de Pesloüana23c37f12011-03-13 10:34:22 +00002568 The latest version of the bonding driver can be found in the latest
Linus Torvalds1da177e2005-04-16 15:20:36 -07002569version of the linux kernel, found on http://kernel.org
2570
Nicolas de Pesloüana23c37f12011-03-13 10:34:22 +00002571 The latest version of this document can be found in the latest kernel
2572source (named Documentation/networking/bonding.txt).
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002573
Nicolas de Pesloüana23c37f12011-03-13 10:34:22 +00002574 Discussions regarding the usage of the bonding driver take place on the
2575bonding-devel mailing list, hosted at sourceforge.net. If you have questions or
2576problems, post them to the list. The list address is:
Linus Torvalds1da177e2005-04-16 15:20:36 -07002577
2578bonding-devel@lists.sourceforge.net
2579
Jay Vosburgh00354cf2005-07-21 12:18:02 -07002580 The administrative interface (to subscribe or unsubscribe) can
2581be found at:
2582
Linus Torvalds1da177e2005-04-16 15:20:36 -07002583https://lists.sourceforge.net/lists/listinfo/bonding-devel
2584
Nicolas de Pesloüana23c37f12011-03-13 10:34:22 +00002585 Discussions regarding the developpement of the bonding driver take place
2586on the main Linux network mailing list, hosted at vger.kernel.org. The list
2587address is:
2588
2589netdev@vger.kernel.org
2590
2591 The administrative interface (to subscribe or unsubscribe) can
2592be found at:
2593
2594http://vger.kernel.org/vger-lists.html#netdev
2595
Linus Torvalds1da177e2005-04-16 15:20:36 -07002596Donald Becker's Ethernet Drivers and diag programs may be found at :
Justin P. Mattock0ea6e612010-07-23 20:51:24 -07002597 - http://web.archive.org/web/*/http://www.scyld.com/network/
Linus Torvalds1da177e2005-04-16 15:20:36 -07002598
2599You will also find a lot of information regarding Ethernet, NWay, MII,
2600etc. at www.scyld.com.
2601
2602-- END --