make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / Documentation / networking / bonding.txt
1
2                    Linux Ethernet Bonding Driver mini-howto
3
4 Initial release : Thomas Davis <tadavis at lbl.gov>
5 Corrections, HA extensions : 2000/10/03-15 :
6   - Willy Tarreau <willy at meta-x.org>
7   - Constantine Gavrilov <const-g at xpert.com>
8   - Chad N. Tindel <ctindel at ieee dot org>
9   - Janice Girouard <girouard at us dot ibm dot com>
10
11 Note :
12 ------
13 The bonding driver originally came from Donald Becker's beowulf patches for
14 kernel 2.0. It has changed quite a bit since, and the original tools from
15 extreme-linux and beowulf sites will not work with this version of the driver.
16
17 For new versions of the driver, patches for older kernels and the updated
18 userspace tools, please follow the links at the end of this file.
19
20
21 Table of Contents
22 =================
23  
24 Installation
25 Bond Configuration
26 Module Parameters
27 Configuring Multiple Bonds
28 Switch Configuration
29 Verifying Bond Configuration
30 Frequently Asked Questions
31 High Availability
32 Promiscuous Sniffing notes
33 Limitations
34 Resources and Links
35
36
37 Installation
38 ============
39
40 1) Build kernel with the bonding driver
41 ---------------------------------------
42 For the latest version of the bonding driver, use kernel 2.4.12 or above
43 (otherwise you will need to apply a patch).
44
45 Configure kernel with `make menuconfig/xconfig/config', and select
46 "Bonding driver support" in the "Network device support" section. It is
47 recommended to configure the driver as module since it is currently the only way
48 to pass parameters to the driver and configure more than one bonding device.
49
50 Build and install the new kernel and modules.
51
52 2) Get and install the userspace tools
53 --------------------------------------
54 This version of the bonding driver requires updated ifenslave program. The
55 original one from extreme-linux and beowulf will not work. Kernels 2.4.12
56 and above include the updated version of ifenslave.c in Documentation/network
57 directory. For older kernels, please follow the links at the end of this file.
58
59 IMPORTANT!!!  If you are running on Redhat 7.1 or greater, you need
60 to be careful because /usr/include/linux is no longer a symbolic link
61 to /usr/src/linux/include/linux.  If you build ifenslave while this is
62 true, ifenslave will appear to succeed but your bond won't work.  The purpose
63 of the -I option on the ifenslave compile line is to make sure it uses
64 /usr/src/linux/include/linux/if_bonding.h instead of the version from
65 /usr/include/linux.
66
67 To install ifenslave.c, do:
68     # gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave 
69     # cp ifenslave /sbin/ifenslave
70
71
72 Bond Configuration
73 ==================
74
75 You will need to add at least the following line to /etc/modules.conf
76 so the bonding driver will automatically load when the bond0 interface is 
77 configured. Refer to the modules.conf manual page for specific modules.conf 
78 syntax details. The Module Parameters section of this document describes each 
79 bonding driver parameter. 
80
81         alias bond0 bonding
82
83 Use standard distribution techniques to define the bond0 network interface. For
84 example, on modern Red Hat distributions, create an ifcfg-bond0 file in
85 the /etc/sysconfig/network-scripts directory that resembles the following:
86
87 DEVICE=bond0
88 IPADDR=192.168.1.1
89 NETMASK=255.255.255.0
90 NETWORK=192.168.1.0
91 BROADCAST=192.168.1.255
92 ONBOOT=yes
93 BOOTPROTO=none
94 USERCTL=no
95
96 (use appropriate values for your network above)
97
98 All interfaces that are part of a bond should have SLAVE and MASTER
99 definitions. For example, in the case of Red Hat, if you wish to make eth0 and
100 eth1 a part of the bonding interface bond0, their config files (ifcfg-eth0 and
101 ifcfg-eth1) should resemble the following:
102
103 DEVICE=eth0
104 USERCTL=no
105 ONBOOT=yes
106 MASTER=bond0
107 SLAVE=yes
108 BOOTPROTO=none
109
110 Use DEVICE=eth1 in the ifcfg-eth1 config file. If you configure a second bonding
111 interface (bond1), use MASTER=bond1 in the config file to make the network
112 interface be a slave of bond1.
113
114 Restart the networking subsystem or just bring up the bonding device if your
115 administration tools allow it. Otherwise, reboot. On Red Hat distros you can 
116 issue `ifup bond0' or `/etc/rc.d/init.d/network restart'.
117
118 If the administration tools of your distribution do not support master/slave
119 notation in configuring network interfaces, you will need to manually configure 
120 the bonding device with the following commands:
121
122     # /sbin/ifconfig bond0 192.168.1.1 netmask 255.255.255.0 \
123       broadcast 192.168.1.255 up
124
125     # /sbin/ifenslave bond0 eth0
126     # /sbin/ifenslave bond0 eth1
127
128 (use appropriate values for your network above)
129
130 You can then create a script containing these commands and place it in the 
131 appropriate rc directory.
132
133 If you specifically need all network drivers loaded before the bonding driver,
134 adding the following line to modules.conf will cause the network driver for 
135 eth0 and eth1 to be loaded before the bonding driver.
136
137 probeall bond0 eth0 eth1 bonding
138
139 Be careful not to reference bond0 itself at the end of the line, or modprobe 
140 will die in an endless recursive loop.
141
142 To have device characteristics (such as MTU size) propagate to slave devices, 
143 set the bond characteristics before enslaving the device.  The characteristics 
144 are propagated during the enslave process.
145
146 If running SNMP agents, the bonding driver should be loaded before any network 
147 drivers participating in a bond. This requirement is due to the the interface 
148 index (ipAdEntIfIndex) being associated to the first interface found with a 
149 given IP address. That is, there is only one ipAdEntIfIndex for each IP 
150 address. For example, if eth0 and eth1 are slaves of bond0 and the driver for 
151 eth0 is loaded before the bonding driver, the interface for the IP address 
152 will be associated with the eth0 interface. This configuration is shown below, 
153 the IP address 192.168.1.1 has an interface index of 2 which indexes to eth0 
154 in the ifDescr table (ifDescr.2).
155
156      interfaces.ifTable.ifEntry.ifDescr.1 = lo
157      interfaces.ifTable.ifEntry.ifDescr.2 = eth0
158      interfaces.ifTable.ifEntry.ifDescr.3 = eth1
159      interfaces.ifTable.ifEntry.ifDescr.4 = eth2
160      interfaces.ifTable.ifEntry.ifDescr.5 = eth3
161      interfaces.ifTable.ifEntry.ifDescr.6 = bond0
162      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 5
163      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
164      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 4
165      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
166
167 This problem is avoided by loading the bonding driver before any network
168 drivers participating in a bond. Below is an example of loading the bonding 
169 driver first, the IP address 192.168.1.1 is correctly associated with ifDescr.2.
170
171      interfaces.ifTable.ifEntry.ifDescr.1 = lo
172      interfaces.ifTable.ifEntry.ifDescr.2 = bond0
173      interfaces.ifTable.ifEntry.ifDescr.3 = eth0
174      interfaces.ifTable.ifEntry.ifDescr.4 = eth1
175      interfaces.ifTable.ifEntry.ifDescr.5 = eth2
176      interfaces.ifTable.ifEntry.ifDescr.6 = eth3
177      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 6
178      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
179      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 5
180      ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
181
182 While some distributions may not report the interface name in ifDescr,
183 the association between the IP address and IfIndex remains and SNMP
184 functions such as Interface_Scan_Next will report that association.
185
186
187 Module Parameters
188 =================
189
190 Optional parameters for the bonding driver can be supplied as command line 
191 arguments to the insmod command. Typically, these parameters are specified in 
192 the file /etc/modules.conf (see the manual page for modules.conf). The 
193 available bonding driver parameters are listed below. If a parameter is not 
194 specified the default value is used. When initially configuring a bond, it
195 is recommended "tail -f /var/log/messages" be run in a separate window to
196 watch for bonding driver error messages.
197
198 It is critical that either the miimon or arp_interval and arp_ip_target
199 parameters be specified, otherwise serious network degradation will occur
200 during link failures.
201
202 mode
203         Specifies one of four bonding policies. The default is round-robin.
204         Possible values are:
205  
206         0       Round-robin policy: Transmit in a sequential order from the
207                 first available slave through the last. This mode provides
208                 load balancing and fault tolerance.
209
210         1       Active-backup policy: Only one slave in the bond is active. A 
211                 different slave becomes active if, and only if, the active slave
212                 fails. The bond's MAC address is externally visible on only 
213                 one port (network adapter) to avoid confusing the switch.
214                 This mode provides fault tolerance.
215  
216  
217         2       XOR policy: Transmit based on [(source MAC address XOR'd with 
218                 destination MAC address) modula slave count]. This selects the 
219                 same slave for each destination MAC address. This mode provides
220                 load balancing and fault tolerance.
221
222         3       Broadcast policy: transmits everything on all slave interfaces.
223                 This mode provides fault tolerance.
224
225 miimon
226  
227         Specifies the frequency in milli-seconds that MII link monitoring will 
228         occur. A value of zero disables MII link monitoring. A value of 
229         100 is a good starting point. See High Availability section for 
230         additional information. The default value is 0.
231
232 downdelay
233  
234         Specifies the delay time in milli-seconds to disable a link after a 
235         link failure has been detected. This should be a multiple of miimon
236         value, otherwise the value will be rounded. The default value is 0.
237
238 updelay
239  
240         Specifies the delay time in milli-seconds to enable a link after a 
241         link up status has been detected. This should be a multiple of miimon
242         value, otherwise the value will be rounded. The default value is 0.
243  
244 arp_interval
245  
246         Specifies the ARP monitoring frequency in milli-seconds. 
247         If ARP monitoring is used in a load-balancing mode (mode 0 or 2), the 
248         switch should be configured in a mode that evenly distributes packets 
249         across all links - such as round-robin. If the switch is configured to 
250         distribute the packets in an XOR fashion, all replies from the ARP 
251         targets will be received on the same link which could cause the other 
252         team members to fail. ARP monitoring should not be used in conjunction
253         with miimon. A value of 0 disables ARP monitoring. The default value 
254         is 0.
255  
256 arp_ip_target
257  
258         Specifies the ip addresses to use when arp_interval is > 0. These are
259         the targets of the ARP request sent to determine the health of the link
260         to the targets. Specify these values in ddd.ddd.ddd.ddd format.
261         Multiple ip adresses must be seperated by a comma. At least one ip
262         address needs to be given for ARP monitoring to work. The maximum number
263         of targets that can be specified is set at 16.
264
265 primary
266
267         A string (eth0, eth2, etc) to equate to a primary device. If this 
268         value is entered, and the device is on-line, it will be used first as 
269         the output media. Only when this device is off-line, will alternate 
270         devices be used. Otherwise, once a failover is detected and a new 
271         default output is chosen, it will remain the output media until it too 
272         fails. This is useful when one slave was preferred over another, i.e. 
273         when one slave is 1000Mbps and another is 100Mbps. If the 1000Mbps 
274         slave fails and is later restored, it may be preferred the faster slave
275         gracefully become the active slave - without deliberately failing the
276         100Mbps slave. Specifying a primary is only valid in active-backup mode.
277
278 multicast
279
280         Integer value for the mode of operation for multicast support.
281         Possible values are:
282
283         0       Disabled (no multicast support)
284
285         1       Enabled on active slave only, useful in active-backup mode
286
287         2       Enabled on all slaves, this is the default
288
289
290 Configuring Multiple Bonds
291 ==========================
292
293 If several bonding interfaces are required, the driver must be loaded
294 multiple times. For example, to configure two bonding interfaces with link 
295 monitoring performed every 100 milli-seconds, the /etc/conf.modules should
296 resemble the following:
297
298 alias bond0 bonding
299 alias bond1 bonding
300
301 options bond0 miimon=100
302 options bond1 -o bonding1 miimon=100
303
304 Configuring Multiple ARP Targets
305 ================================
306
307 While ARP monitoring can be done with just one target, it can be usefull
308 in a High Availability setup to have several targets to monitor. In the
309 case of just one target,  the target itself may go down or have a problem
310 making it unresponsive to ARP requests. Having an additional target (or
311 several) would increase the reliability of the ARP monitoring.
312 Multiple ARP targets must be seperated by commas as follows:
313
314 # example options for ARP monitoring with three targets
315 alias bond0 bonding
316 options bond0 arp_interval=60 arp_ip_target=192.168.0.1,192.168.0.3,192.168.0.9
317
318 For just a single target the options would resemble:
319
320 # example options for ARP monitoring with one target
321 alias bond0 bonding
322 options bond0 arp_interval=60 arp_ip_target=192.168.0.100
323
324
325
326 Switch Configuration
327 ====================
328
329 While the switch does not need to be configured when the active-backup
330 policy is used (mode=1), it does need to be configured for the round-robin, 
331 XOR, and broadcast policies (mode=0, mode=2, and mode=3). 
332
333
334 Verifying Bond Configuration
335 ============================
336
337 1) Bonding information files
338 ----------------------------
339 The bonding driver information files reside in the /proc/net/bond* directories. 
340
341 Sample contents of /proc/net/bond0/info after the driver is loaded with 
342 parameters of mode=0 and miimon=1000 is shown below.
343  
344         Bonding Mode: load balancing (round-robin)
345         Currently Active Slave: eth0
346         MII Status: up
347         MII Polling Interval (ms): 1000
348         Up Delay (ms): 0
349         Down Delay (ms): 0
350  
351         Slave Interface: eth1
352         MII Status: up
353         Link Failure Count: 1
354  
355         Slave Interface: eth0
356         MII Status: up
357         Link Failure Count: 1
358
359 2) Network verification
360 -----------------------
361 The network configuration can be verified using the ifconfig command. In
362 the example below, the bond0 interface is the master (MASTER) while eth0 and 
363 eth1 are slaves (SLAVE). Notice all slaves of bond0 have the same MAC address 
364 (HWaddr) as bond0.
365
366 [root]# /sbin/ifconfig
367 bond0     Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4  
368           inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
369           UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
370           RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0
371           TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0
372           collisions:0 txqueuelen:0 
373
374 eth0      Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4  
375           inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
376           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
377           RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0
378           TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0
379           collisions:0 txqueuelen:100 
380           Interrupt:10 Base address:0x1080 
381
382 eth1      Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4  
383           inet addr:XXX.XXX.XXX.YYY  Bcast:XXX.XXX.XXX.255  Mask:255.255.252.0
384           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
385           RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0
386           TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0
387           collisions:0 txqueuelen:100 
388           Interrupt:9 Base address:0x1400 
389
390
391 Frequently Asked Questions
392 ==========================
393
394 1.  Is it SMP safe?
395
396         Yes. The old 2.0.xx channel bonding patch was not SMP safe.
397         The new driver was designed to be SMP safe from the start.
398
399 2.  What type of cards will work with it?
400
401         Any Ethernet type cards (you can even mix cards - a Intel
402         EtherExpress PRO/100 and a 3com 3c905b, for example).
403         You can even bond together Gigabit Ethernet cards!
404
405 3.  How many bonding devices can I have?
406
407         One for each module you load. See section on Module Parameters for how
408         to accomplish this.
409
410 4.  How many slaves can a bonding device have?
411
412         Limited by the number of network interfaces Linux supports and/or the
413         number of network cards you can place in your system.
414
415 5.  What happens when a slave link dies?
416
417         If your ethernet cards support MII or ETHTOOL link status monitoring 
418         and the MII monitoring has been enabled in the driver (see description 
419         of module parameters), there will be no adverse consequences. This 
420         release of the bonding driver knows how to get the MII information and
421         enables or disables its slaves according to their link status.
422         See section on High Availability for additional information.
423
424         For ethernet cards not supporting MII status, the arp_interval and
425         arp_ip_target parameters must be specified for bonding to work
426         correctly. If packets have not been sent or received during the
427         specified arp_interval durration, an ARP request is sent to the targets 
428         to generate send and receive traffic. If after this interval, either 
429         the successful send and/or receive count has not incremented, the next 
430         slave in the sequence will become the active slave.
431
432         If neither mii_monitor and arp_interval is configured, the bonding
433         driver will not handle this situation very well. The driver will 
434         continue to send packets but some packets will be lost. Retransmits 
435         will cause serious degradation of performance (in the case when one
436         of two slave links fails, 50% packets will be lost, which is a serious
437         problem for both TCP and UDP).
438
439 6.  Can bonding be used for High Availability?
440
441         Yes, if you use MII monitoring and ALL your cards support MII link
442         status reporting. See section on High Availability for more information.
443
444 7.  Which switches/systems does it work with?
445
446         In round-robin and XOR mode, it works with systems that support 
447         trunking:
448         
449         * Cisco 5500 series (look for EtherChannel support).
450         * SunTrunking software.
451         * Alteon AceDirector switches / WebOS (use Trunks).
452         * BayStack Switches (trunks must be explicitly configured). Stackable
453           models (450) can define trunks between ports on different physical
454           units.
455         * Linux bonding, of course !
456         
457         In active-backup mode, it should work with any Layer-II switche.
458
459
460 8.  Where does a bonding device get its MAC address from?
461
462         If not explicitly configured with ifconfig, the MAC address of the
463         bonding device is taken from its first slave device. This MAC address
464         is then passed to all following slaves and remains persistent (even if
465         the first slave is removed) until the bonding device is brought
466         down or reconfigured.
467         
468         If you wish to change the MAC address, you can set it with ifconfig:
469
470           # ifconfig bond0 hw ether 00:11:22:33:44:55
471
472         The MAC address can be also changed by bringing down/up the device
473         and then changing its slaves (or their order):
474         
475           # ifconfig bond0 down ; modprobe -r bonding
476           # ifconfig bond0 .... up
477           # ifenslave bond0 eth...
478
479         This method will automatically take the address from the next slave
480         that will be added.
481         
482         To restore your slaves' MAC addresses, you need to detach them
483         from the bond (`ifenslave -d bond0 eth0'), set them down
484         (`ifconfig eth0 down'), unload the drivers (`rmmod 3c59x', for
485         example) and reload them to get the MAC addresses from their
486         eeproms. If the driver is shared by several devices, you need
487         to turn them all down. Another solution is to look for the MAC
488         address at boot time (dmesg or tail /var/log/messages) and to
489         reset it by hand with ifconfig :
490
491           # ifconfig eth0 down
492           # ifconfig eth0 hw ether 00:20:40:60:80:A0
493
494 9.  Which transmit polices can be used?
495
496         Round-robin, based on the order of enslaving, the output device
497         is selected base on the next available slave. Regardless of
498         the source and/or destination of the packet.
499
500         Active-backup policy that ensures that one and only one device will
501         transmit at any given moment. Active-backup policy is useful for
502         implementing high availability solutions using two hubs (see
503         section on High Availability).
504
505         XOR, based on (src hw addr XOR dst hw addr) % slave count. This
506         policy selects the same slave for each destination hw address.
507
508         Broadcast policy transmits everything on all slave interfaces.
509
510
511 High Availability
512 =================
513
514 To implement high availability using the bonding driver, the driver needs to be
515 compiled as a module, because currently it is the only way to pass parameters 
516 to the driver. This may change in the future.
517
518 High availability is achieved by using MII or ETHTOOL status reporting. You 
519 need to verify that all your interfaces support MII or ETHTOOL link status 
520 reporting.  On Linux kernel 2.2.17, all the 100 Mbps capable drivers and 
521 yellowfin gigabit driver support MII. To determine if ETHTOOL link reporting 
522 is available for interface eth0, type "ethtool eth0" and the "Link detected:" 
523 line should contain the correct link status. If your system has an interface 
524 that does not support MII or ETHTOOL status reporting, a failure of its link 
525 will not be detected! A message indicating MII and ETHTOOL is not supported by 
526 a network driver is logged when the bonding driver is loaded with a non-zero 
527 miimon value.
528
529 The bonding driver can regularly check all its slaves links using the ETHTOOL
530 IOCTL (ETHTOOL_GLINK command) or by checking the MII status registers. The 
531 check interval is specified by the module argument "miimon" (MII monitoring). 
532 It takes an integer that represents the checking time in milliseconds. It 
533 should not come to close to (1000/HZ) (10 milli-seconds on i386) because it 
534 may then reduce the system interactivity. A value of 100 seems to be a good 
535 starting point. It means that a dead link will be detected at most 100 
536 milli-seconds after it goes down.
537
538 Example:
539
540    # modprobe bonding miimon=100
541
542 Or, put the following lines in /etc/modules.conf:
543
544    alias bond0 bonding
545    options bond0 miimon=100
546
547 There are currently two policies for high availability. They are dependent on 
548 whether:
549
550    a) hosts are connected to a single host or switch that support trunking
551
552    b) hosts are connected to several different switches or a single switch that
553       does not support trunking
554
555
556 1) High Availability on a single switch or host - load balancing
557 ----------------------------------------------------------------
558 It is the easiest to set up and to understand. Simply configure the
559 remote equipment (host or switch) to aggregate traffic over several
560 ports (Trunk, EtherChannel, etc.) and configure the bonding interfaces.
561 If the module has been loaded with the proper MII option, it will work
562 automatically. You can then try to remove and restore different links
563 and see in your logs what the driver detects. When testing, you may
564 encounter problems on some buggy switches that disable the trunk for a
565 long time if all ports in a trunk go down. This is not Linux, but really
566 the switch (reboot it to ensure).
567
568 Example 1 : host to host at twice the speed
569
570           +----------+                          +----------+
571           |          |eth0                  eth0|          |
572           | Host A   +--------------------------+  Host B  |
573           |          +--------------------------+          |
574           |          |eth1                  eth1|          |
575           +----------+                          +----------+
576
577   On each host :
578      # modprobe bonding miimon=100
579      # ifconfig bond0 addr
580      # ifenslave bond0 eth0 eth1
581
582 Example 2 : host to switch at twice the speed
583
584           +----------+                          +----------+
585           |          |eth0                 port1|          |
586           | Host A   +--------------------------+  switch  |
587           |          +--------------------------+          |
588           |          |eth1                 port2|          |
589           +----------+                          +----------+
590
591   On host A :                             On the switch :
592      # modprobe bonding miimon=100           # set up a trunk on port1
593      # ifconfig bond0 addr                     and port2
594      # ifenslave bond0 eth0 eth1
595
596
597 2) High Availability on two or more switches (or a single switch without 
598    trunking support)
599 ---------------------------------------------------------------------------
600 This mode is more problematic because it relies on the fact that there
601 are multiple ports and the host's MAC address should be visible on one
602 port only to avoid confusing the switches.
603
604 If you need to know which interface is the active one, and which ones are
605 backup, use ifconfig. All backup interfaces have the NOARP flag set.
606
607 To use this mode, pass "mode=1" to the module at load time :
608
609     # modprobe bonding miimon=100 mode=1
610
611 Or, put in your /etc/modules.conf :
612
613     alias bond0 bonding
614     options bond0 miimon=100 mode=1
615
616 Example 1: Using multiple host and multiple switches to build a "no single
617 point of failure" solution.
618
619
620                 |                                     |
621                 |port3                           port3|
622           +-----+----+                          +-----+----+
623           |          |port7       ISL      port7|          |
624           | switch A +--------------------------+ switch B |
625           |          +--------------------------+          |
626           |          |port8                port8|          |
627           +----++----+                          +-----++---+
628           port2||port1                           port1||port2
629                ||             +-------+               ||
630                |+-------------+ host1 +---------------+|
631                |         eth0 +-------+ eth1           |
632                |                                       |
633                |              +-------+                |
634                +--------------+ host2 +----------------+
635                          eth0 +-------+ eth1
636
637 In this configuration, there is an ISL - Inter Switch Link (could be a trunk),
638 several servers (host1, host2 ...) attached to both switches each, and one or
639 more ports to the outside world (port3...). One an only one slave on each host
640 is active at a time, while all links are still monitored (the system can
641 detect a failure of active and backup links).
642
643 Each time a host changes its active interface, it sticks to the new one until
644 it goes down. In this example, the hosts are negligibly affected by the
645 expiration time of the switches' forwarding tables.
646
647 If host1 and host2 have the same functionality and are used in load balancing
648 by another external mechanism, it is good to have host1's active interface
649 connected to one switch and host2's to the other. Such system will survive
650 a failure of a single host, cable, or switch. The worst thing that may happen
651 in the case of a switch failure is that half of the hosts will be temporarily
652 unreachable until the other switch expires its tables. 
653
654 Example 2: Using multiple ethernet cards connected to a switch to configure
655            NIC failover (switch is not required to support trunking). 
656
657
658           +----------+                          +----------+
659           |          |eth0                 port1|          |
660           | Host A   +--------------------------+  switch  |
661           |          +--------------------------+          |
662           |          |eth1                 port2|          |
663           +----------+                          +----------+
664
665   On host A :                                 On the switch :
666      # modprobe bonding miimon=100 mode=1     # (optional) minimize the time
667      # ifconfig bond0 addr                    # for table expiration
668      # ifenslave bond0 eth0 eth1
669
670 Each time the host changes its active interface, it sticks to the new one until
671 it goes down. In this example, the host is strongly affected by the expiration
672 time of the switch forwarding table.
673
674
675 3) Adapting to your switches' timing
676 ------------------------------------
677 If your switches take a long time to go into backup mode, it may be
678 desirable not to activate a backup interface immediately after a link goes
679 down. It is possible to delay the moment at which a link will be
680 completely disabled by passing the module parameter "downdelay" (in
681 milliseconds, must be a multiple of miimon).
682
683 When a switch reboots, it is possible that its ports report "link up" status
684 before they become usable. This could fool a bond device by causing it to
685 use some ports that are not ready yet. It is possible to delay the moment at
686 which an active link will be reused by passing the module parameter "updelay"
687 (in milliseconds, must be a multiple of miimon).
688
689 A similar situation can occur when a host re-negotiates a lost link with the
690 switch (a case of cable replacement).
691
692 A special case is when a bonding interface has lost all slave links. Then the
693 driver will immediately reuse the first link that goes up, even if updelay
694 parameter was specified. (If there are slave interfaces in the "updelay" state,
695 the interface that first went into that state will be immediately reused.) This
696 allows to reduce down-time if the value of updelay has been overestimated.
697
698 Examples :
699
700     # modprobe bonding miimon=100 mode=1 downdelay=2000 updelay=5000
701     # modprobe bonding miimon=100 mode=0 downdelay=0 updelay=5000
702
703
704 Promiscuous Sniffing notes
705 ==========================
706
707 If you wish to bond channels together for a network sniffing
708 application --- you wish to run tcpdump, or ethereal, or an IDS like
709 snort, with its input aggregated from multiple interfaces using the
710 bonding driver --- then you need to handle the Promiscuous interface
711 setting by hand. Specifically, when you "ifconfing bond0 up" you
712 must add the promisc flag there; it will be propagated down to the
713 slave interfaces at ifenslave time; a full example might look like:
714
715    grep bond0 /etc/modules.conf || echo alias bond0 bonding >/etc/modules.conf
716    ifconfig bond0 promisc up
717    for if in eth1 eth2 ...;do
718        ifconfig $if up
719        ifenslave bond0 $if
720    done
721    snort ... -i bond0 ...
722
723 Ifenslave also wants to propagate addresses from interface to
724 interface, appropriately for its design functions in HA and channel
725 capacity aggregating; but it works fine for unnumbered interfaces;
726 just ignore all the warnings it emits.
727
728
729 Limitations
730 ===========
731 The main limitations are :
732   - only the link status is monitored. If the switch on the other side is
733     partially down (e.g. doesn't forward anymore, but the link is OK), the link
734     won't be disabled. Another way to check for a dead link could be to count
735     incoming frames on a heavily loaded host. This is not applicable to small
736     servers, but may be useful when the front switches send multicast
737     information on their links (e.g. VRRP), or even health-check the servers.
738     Use the arp_interval/arp_ip_target parameters to count incoming/outgoing
739     frames.  
740
741   - A Transmit Load Balancing policy is not currently available. This mode 
742     allows every slave in the bond to transmit while only one receives. If 
743     the "receiving" slave fails, another slave takes over the MAC address of 
744     the failed receiving slave.
745
746
747 Resources and Links
748 ===================
749
750 Current development on this driver is posted to:
751  - http://www.sourceforge.net/projects/bonding/
752
753 Donald Becker's Ethernet Drivers and diag programs may be found at :
754  - http://www.scyld.com/network/
755
756 You will also find a lot of information regarding Ethernet, NWay, MII, etc. at
757 www.scyld.com.
758
759 For new versions of the driver, patches for older kernels and the updated
760 userspace tools, take a look at Willy Tarreau's site :
761  - http://wtarreau.free.fr/pub/bonding/
762  - http://www-miaif.lip6.fr/willy/pub/bonding/
763
764 To get latest informations about Linux Kernel development, please consult
765 the Linux Kernel Mailing List Archives at :
766    http://boudicca.tux.org/hypermail/linux-kernel/latest/
767
768 -- END --