bonding.txt 96 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400
  1. Linux Ethernet Bonding Driver HOWTO
  2. Latest update: 12 November 2007
  3. Initial release : Thomas Davis <tadavis at lbl.gov>
  4. Corrections, HA extensions : 2000/10/03-15 :
  5. - Willy Tarreau <willy at meta-x.org>
  6. - Constantine Gavrilov <const-g at xpert.com>
  7. - Chad N. Tindel <ctindel at ieee dot org>
  8. - Janice Girouard <girouard at us dot ibm dot com>
  9. - Jay Vosburgh <fubar at us dot ibm dot com>
  10. Reorganized and updated Feb 2005 by Jay Vosburgh
  11. Added Sysfs information: 2006/04/24
  12. - Mitch Williams <mitch.a.williams at intel.com>
  13. Introduction
  14. ============
  15. The Linux bonding driver provides a method for aggregating
  16. multiple network interfaces into a single logical "bonded" interface.
  17. The behavior of the bonded interfaces depends upon the mode; generally
  18. speaking, modes provide either hot standby or load balancing services.
  19. Additionally, link integrity monitoring may be performed.
  20. The bonding driver originally came from Donald Becker's
  21. beowulf patches for kernel 2.0. It has changed quite a bit since, and
  22. the original tools from extreme-linux and beowulf sites will not work
  23. with this version of the driver.
  24. For new versions of the driver, updated userspace tools, and
  25. who to ask for help, please follow the links at the end of this file.
  26. Table of Contents
  27. =================
  28. 1. Bonding Driver Installation
  29. 2. Bonding Driver Options
  30. 3. Configuring Bonding Devices
  31. 3.1 Configuration with Sysconfig Support
  32. 3.1.1 Using DHCP with Sysconfig
  33. 3.1.2 Configuring Multiple Bonds with Sysconfig
  34. 3.2 Configuration with Initscripts Support
  35. 3.2.1 Using DHCP with Initscripts
  36. 3.2.2 Configuring Multiple Bonds with Initscripts
  37. 3.3 Configuring Bonding Manually with Ifenslave
  38. 3.3.1 Configuring Multiple Bonds Manually
  39. 3.4 Configuring Bonding Manually via Sysfs
  40. 4. Querying Bonding Configuration
  41. 4.1 Bonding Configuration
  42. 4.2 Network Configuration
  43. 5. Switch Configuration
  44. 6. 802.1q VLAN Support
  45. 7. Link Monitoring
  46. 7.1 ARP Monitor Operation
  47. 7.2 Configuring Multiple ARP Targets
  48. 7.3 MII Monitor Operation
  49. 8. Potential Trouble Sources
  50. 8.1 Adventures in Routing
  51. 8.2 Ethernet Device Renaming
  52. 8.3 Painfully Slow Or No Failed Link Detection By Miimon
  53. 9. SNMP agents
  54. 10. Promiscuous mode
  55. 11. Configuring Bonding for High Availability
  56. 11.1 High Availability in a Single Switch Topology
  57. 11.2 High Availability in a Multiple Switch Topology
  58. 11.2.1 HA Bonding Mode Selection for Multiple Switch Topology
  59. 11.2.2 HA Link Monitoring for Multiple Switch Topology
  60. 12. Configuring Bonding for Maximum Throughput
  61. 12.1 Maximum Throughput in a Single Switch Topology
  62. 12.1.1 MT Bonding Mode Selection for Single Switch Topology
  63. 12.1.2 MT Link Monitoring for Single Switch Topology
  64. 12.2 Maximum Throughput in a Multiple Switch Topology
  65. 12.2.1 MT Bonding Mode Selection for Multiple Switch Topology
  66. 12.2.2 MT Link Monitoring for Multiple Switch Topology
  67. 13. Switch Behavior Issues
  68. 13.1 Link Establishment and Failover Delays
  69. 13.2 Duplicated Incoming Packets
  70. 14. Hardware Specific Considerations
  71. 14.1 IBM BladeCenter
  72. 15. Frequently Asked Questions
  73. 16. Resources and Links
  74. 1. Bonding Driver Installation
  75. ==============================
  76. Most popular distro kernels ship with the bonding driver
  77. already available as a module and the ifenslave user level control
  78. program installed and ready for use. If your distro does not, or you
  79. have need to compile bonding from source (e.g., configuring and
  80. installing a mainline kernel from kernel.org), you'll need to perform
  81. the following steps:
  82. 1.1 Configure and build the kernel with bonding
  83. -----------------------------------------------
  84. The current version of the bonding driver is available in the
  85. drivers/net/bonding subdirectory of the most recent kernel source
  86. (which is available on http://kernel.org). Most users "rolling their
  87. own" will want to use the most recent kernel from kernel.org.
  88. Configure kernel with "make menuconfig" (or "make xconfig" or
  89. "make config"), then select "Bonding driver support" in the "Network
  90. device support" section. It is recommended that you configure the
  91. driver as module since it is currently the only way to pass parameters
  92. to the driver or configure more than one bonding device.
  93. Build and install the new kernel and modules, then continue
  94. below to install ifenslave.
  95. 1.2 Install ifenslave Control Utility
  96. -------------------------------------
  97. The ifenslave user level control program is included in the
  98. kernel source tree, in the file Documentation/networking/ifenslave.c.
  99. It is generally recommended that you use the ifenslave that
  100. corresponds to the kernel that you are using (either from the same
  101. source tree or supplied with the distro), however, ifenslave
  102. executables from older kernels should function (but features newer
  103. than the ifenslave release are not supported). Running an ifenslave
  104. that is newer than the kernel is not supported, and may or may not
  105. work.
  106. To install ifenslave, do the following:
  107. # gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave
  108. # cp ifenslave /sbin/ifenslave
  109. If your kernel source is not in "/usr/src/linux," then replace
  110. "/usr/src/linux/include" in the above with the location of your kernel
  111. source include directory.
  112. You may wish to back up any existing /sbin/ifenslave, or, for
  113. testing or informal use, tag the ifenslave to the kernel version
  114. (e.g., name the ifenslave executable /sbin/ifenslave-2.6.10).
  115. IMPORTANT NOTE:
  116. If you omit the "-I" or specify an incorrect directory, you
  117. may end up with an ifenslave that is incompatible with the kernel
  118. you're trying to build it for. Some distros (e.g., Red Hat from 7.1
  119. onwards) do not have /usr/include/linux symbolically linked to the
  120. default kernel source include directory.
  121. SECOND IMPORTANT NOTE:
  122. If you plan to configure bonding using sysfs, you do not need
  123. to use ifenslave.
  124. 2. Bonding Driver Options
  125. =========================
  126. Options for the bonding driver are supplied as parameters to the
  127. bonding module at load time, or are specified via sysfs.
  128. Module options may be given as command line arguments to the
  129. insmod or modprobe command, but are usually specified in either the
  130. /etc/modules.conf or /etc/modprobe.conf configuration file, or in a
  131. distro-specific configuration file (some of which are detailed in the next
  132. section).
  133. Details on bonding support for sysfs is provided in the
  134. "Configuring Bonding Manually via Sysfs" section, below.
  135. The available bonding driver parameters are listed below. If a
  136. parameter is not specified the default value is used. When initially
  137. configuring a bond, it is recommended "tail -f /var/log/messages" be
  138. run in a separate window to watch for bonding driver error messages.
  139. It is critical that either the miimon or arp_interval and
  140. arp_ip_target parameters be specified, otherwise serious network
  141. degradation will occur during link failures. Very few devices do not
  142. support at least miimon, so there is really no reason not to use it.
  143. Options with textual values will accept either the text name
  144. or, for backwards compatibility, the option value. E.g.,
  145. "mode=802.3ad" and "mode=4" set the same mode.
  146. The parameters are as follows:
  147. ad_select
  148. Specifies the 802.3ad aggregation selection logic to use. The
  149. possible values and their effects are:
  150. stable or 0
  151. The active aggregator is chosen by largest aggregate
  152. bandwidth.
  153. Reselection of the active aggregator occurs only when all
  154. slaves of the active aggregator are down or the active
  155. aggregator has no slaves.
  156. This is the default value.
  157. bandwidth or 1
  158. The active aggregator is chosen by largest aggregate
  159. bandwidth. Reselection occurs if:
  160. - A slave is added to or removed from the bond
  161. - Any slave's link state changes
  162. - Any slave's 802.3ad association state changes
  163. - The bond's adminstrative state changes to up
  164. count or 2
  165. The active aggregator is chosen by the largest number of
  166. ports (slaves). Reselection occurs as described under the
  167. "bandwidth" setting, above.
  168. The bandwidth and count selection policies permit failover of
  169. 802.3ad aggregations when partial failure of the active aggregator
  170. occurs. This keeps the aggregator with the highest availability
  171. (either in bandwidth or in number of ports) active at all times.
  172. This option was added in bonding version 3.4.0.
  173. arp_interval
  174. Specifies the ARP link monitoring frequency in milliseconds.
  175. The ARP monitor works by periodically checking the slave
  176. devices to determine whether they have sent or received
  177. traffic recently (the precise criteria depends upon the
  178. bonding mode, and the state of the slave). Regular traffic is
  179. generated via ARP probes issued for the addresses specified by
  180. the arp_ip_target option.
  181. This behavior can be modified by the arp_validate option,
  182. below.
  183. If ARP monitoring is used in an etherchannel compatible mode
  184. (modes 0 and 2), the switch should be configured in a mode
  185. that evenly distributes packets across all links. If the
  186. switch is configured to distribute the packets in an XOR
  187. fashion, all replies from the ARP targets will be received on
  188. the same link which could cause the other team members to
  189. fail. ARP monitoring should not be used in conjunction with
  190. miimon. A value of 0 disables ARP monitoring. The default
  191. value is 0.
  192. arp_ip_target
  193. Specifies the IP addresses to use as ARP monitoring peers when
  194. arp_interval is > 0. These are the targets of the ARP request
  195. sent to determine the health of the link to the targets.
  196. Specify these values in ddd.ddd.ddd.ddd format. Multiple IP
  197. addresses must be separated by a comma. At least one IP
  198. address must be given for ARP monitoring to function. The
  199. maximum number of targets that can be specified is 16. The
  200. default value is no IP addresses.
  201. arp_validate
  202. Specifies whether or not ARP probes and replies should be
  203. validated in the active-backup mode. This causes the ARP
  204. monitor to examine the incoming ARP requests and replies, and
  205. only consider a slave to be up if it is receiving the
  206. appropriate ARP traffic.
  207. Possible values are:
  208. none or 0
  209. No validation is performed. This is the default.
  210. active or 1
  211. Validation is performed only for the active slave.
  212. backup or 2
  213. Validation is performed only for backup slaves.
  214. all or 3
  215. Validation is performed for all slaves.
  216. For the active slave, the validation checks ARP replies to
  217. confirm that they were generated by an arp_ip_target. Since
  218. backup slaves do not typically receive these replies, the
  219. validation performed for backup slaves is on the ARP request
  220. sent out via the active slave. It is possible that some
  221. switch or network configurations may result in situations
  222. wherein the backup slaves do not receive the ARP requests; in
  223. such a situation, validation of backup slaves must be
  224. disabled.
  225. This option is useful in network configurations in which
  226. multiple bonding hosts are concurrently issuing ARPs to one or
  227. more targets beyond a common switch. Should the link between
  228. the switch and target fail (but not the switch itself), the
  229. probe traffic generated by the multiple bonding instances will
  230. fool the standard ARP monitor into considering the links as
  231. still up. Use of the arp_validate option can resolve this, as
  232. the ARP monitor will only consider ARP requests and replies
  233. associated with its own instance of bonding.
  234. This option was added in bonding version 3.1.0.
  235. downdelay
  236. Specifies the time, in milliseconds, to wait before disabling
  237. a slave after a link failure has been detected. This option
  238. is only valid for the miimon link monitor. The downdelay
  239. value should be a multiple of the miimon value; if not, it
  240. will be rounded down to the nearest multiple. The default
  241. value is 0.
  242. fail_over_mac
  243. Specifies whether active-backup mode should set all slaves to
  244. the same MAC address at enslavement (the traditional
  245. behavior), or, when enabled, perform special handling of the
  246. bond's MAC address in accordance with the selected policy.
  247. Possible values are:
  248. none or 0
  249. This setting disables fail_over_mac, and causes
  250. bonding to set all slaves of an active-backup bond to
  251. the same MAC address at enslavement time. This is the
  252. default.
  253. active or 1
  254. The "active" fail_over_mac policy indicates that the
  255. MAC address of the bond should always be the MAC
  256. address of the currently active slave. The MAC
  257. address of the slaves is not changed; instead, the MAC
  258. address of the bond changes during a failover.
  259. This policy is useful for devices that cannot ever
  260. alter their MAC address, or for devices that refuse
  261. incoming broadcasts with their own source MAC (which
  262. interferes with the ARP monitor).
  263. The down side of this policy is that every device on
  264. the network must be updated via gratuitous ARP,
  265. vs. just updating a switch or set of switches (which
  266. often takes place for any traffic, not just ARP
  267. traffic, if the switch snoops incoming traffic to
  268. update its tables) for the traditional method. If the
  269. gratuitous ARP is lost, communication may be
  270. disrupted.
  271. When this policy is used in conjuction with the mii
  272. monitor, devices which assert link up prior to being
  273. able to actually transmit and receive are particularly
  274. susecptible to loss of the gratuitous ARP, and an
  275. appropriate updelay setting may be required.
  276. follow or 2
  277. The "follow" fail_over_mac policy causes the MAC
  278. address of the bond to be selected normally (normally
  279. the MAC address of the first slave added to the bond).
  280. However, the second and subsequent slaves are not set
  281. to this MAC address while they are in a backup role; a
  282. slave is programmed with the bond's MAC address at
  283. failover time (and the formerly active slave receives
  284. the newly active slave's MAC address).
  285. This policy is useful for multiport devices that
  286. either become confused or incur a performance penalty
  287. when multiple ports are programmed with the same MAC
  288. address.
  289. The default policy is none, unless the first slave cannot
  290. change its MAC address, in which case the active policy is
  291. selected by default.
  292. This option may be modified via sysfs only when no slaves are
  293. present in the bond.
  294. This option was added in bonding version 3.2.0. The "follow"
  295. policy was added in bonding version 3.3.0.
  296. lacp_rate
  297. Option specifying the rate in which we'll ask our link partner
  298. to transmit LACPDU packets in 802.3ad mode. Possible values
  299. are:
  300. slow or 0
  301. Request partner to transmit LACPDUs every 30 seconds
  302. fast or 1
  303. Request partner to transmit LACPDUs every 1 second
  304. The default is slow.
  305. max_bonds
  306. Specifies the number of bonding devices to create for this
  307. instance of the bonding driver. E.g., if max_bonds is 3, and
  308. the bonding driver is not already loaded, then bond0, bond1
  309. and bond2 will be created. The default value is 1. Specifying
  310. a value of 0 will load bonding, but will not create any devices.
  311. miimon
  312. Specifies the MII link monitoring frequency in milliseconds.
  313. This determines how often the link state of each slave is
  314. inspected for link failures. A value of zero disables MII
  315. link monitoring. A value of 100 is a good starting point.
  316. The use_carrier option, below, affects how the link state is
  317. determined. See the High Availability section for additional
  318. information. The default value is 0.
  319. mode
  320. Specifies one of the bonding policies. The default is
  321. balance-rr (round robin). Possible values are:
  322. balance-rr or 0
  323. Round-robin policy: Transmit packets in sequential
  324. order from the first available slave through the
  325. last. This mode provides load balancing and fault
  326. tolerance.
  327. active-backup or 1
  328. Active-backup policy: Only one slave in the bond is
  329. active. A different slave becomes active if, and only
  330. if, the active slave fails. The bond's MAC address is
  331. externally visible on only one port (network adapter)
  332. to avoid confusing the switch.
  333. In bonding version 2.6.2 or later, when a failover
  334. occurs in active-backup mode, bonding will issue one
  335. or more gratuitous ARPs on the newly active slave.
  336. One gratuitous ARP is issued for the bonding master
  337. interface and each VLAN interfaces configured above
  338. it, provided that the interface has at least one IP
  339. address configured. Gratuitous ARPs issued for VLAN
  340. interfaces are tagged with the appropriate VLAN id.
  341. This mode provides fault tolerance. The primary
  342. option, documented below, affects the behavior of this
  343. mode.
  344. balance-xor or 2
  345. XOR policy: Transmit based on the selected transmit
  346. hash policy. The default policy is a simple [(source
  347. MAC address XOR'd with destination MAC address) modulo
  348. slave count]. Alternate transmit policies may be
  349. selected via the xmit_hash_policy option, described
  350. below.
  351. This mode provides load balancing and fault tolerance.
  352. broadcast or 3
  353. Broadcast policy: transmits everything on all slave
  354. interfaces. This mode provides fault tolerance.
  355. 802.3ad or 4
  356. IEEE 802.3ad Dynamic link aggregation. Creates
  357. aggregation groups that share the same speed and
  358. duplex settings. Utilizes all slaves in the active
  359. aggregator according to the 802.3ad specification.
  360. Slave selection for outgoing traffic is done according
  361. to the transmit hash policy, which may be changed from
  362. the default simple XOR policy via the xmit_hash_policy
  363. option, documented below. Note that not all transmit
  364. policies may be 802.3ad compliant, particularly in
  365. regards to the packet mis-ordering requirements of
  366. section 43.2.4 of the 802.3ad standard. Differing
  367. peer implementations will have varying tolerances for
  368. noncompliance.
  369. Prerequisites:
  370. 1. Ethtool support in the base drivers for retrieving
  371. the speed and duplex of each slave.
  372. 2. A switch that supports IEEE 802.3ad Dynamic link
  373. aggregation.
  374. Most switches will require some type of configuration
  375. to enable 802.3ad mode.
  376. balance-tlb or 5
  377. Adaptive transmit load balancing: channel bonding that
  378. does not require any special switch support. The
  379. outgoing traffic is distributed according to the
  380. current load (computed relative to the speed) on each
  381. slave. Incoming traffic is received by the current
  382. slave. If the receiving slave fails, another slave
  383. takes over the MAC address of the failed receiving
  384. slave.
  385. Prerequisite:
  386. Ethtool support in the base drivers for retrieving the
  387. speed of each slave.
  388. balance-alb or 6
  389. Adaptive load balancing: includes balance-tlb plus
  390. receive load balancing (rlb) for IPV4 traffic, and
  391. does not require any special switch support. The
  392. receive load balancing is achieved by ARP negotiation.
  393. The bonding driver intercepts the ARP Replies sent by
  394. the local system on their way out and overwrites the
  395. source hardware address with the unique hardware
  396. address of one of the slaves in the bond such that
  397. different peers use different hardware addresses for
  398. the server.
  399. Receive traffic from connections created by the server
  400. is also balanced. When the local system sends an ARP
  401. Request the bonding driver copies and saves the peer's
  402. IP information from the ARP packet. When the ARP
  403. Reply arrives from the peer, its hardware address is
  404. retrieved and the bonding driver initiates an ARP
  405. reply to this peer assigning it to one of the slaves
  406. in the bond. A problematic outcome of using ARP
  407. negotiation for balancing is that each time that an
  408. ARP request is broadcast it uses the hardware address
  409. of the bond. Hence, peers learn the hardware address
  410. of the bond and the balancing of receive traffic
  411. collapses to the current slave. This is handled by
  412. sending updates (ARP Replies) to all the peers with
  413. their individually assigned hardware address such that
  414. the traffic is redistributed. Receive traffic is also
  415. redistributed when a new slave is added to the bond
  416. and when an inactive slave is re-activated. The
  417. receive load is distributed sequentially (round robin)
  418. among the group of highest speed slaves in the bond.
  419. When a link is reconnected or a new slave joins the
  420. bond the receive traffic is redistributed among all
  421. active slaves in the bond by initiating ARP Replies
  422. with the selected MAC address to each of the
  423. clients. The updelay parameter (detailed below) must
  424. be set to a value equal or greater than the switch's
  425. forwarding delay so that the ARP Replies sent to the
  426. peers will not be blocked by the switch.
  427. Prerequisites:
  428. 1. Ethtool support in the base drivers for retrieving
  429. the speed of each slave.
  430. 2. Base driver support for setting the hardware
  431. address of a device while it is open. This is
  432. required so that there will always be one slave in the
  433. team using the bond hardware address (the
  434. curr_active_slave) while having a unique hardware
  435. address for each slave in the bond. If the
  436. curr_active_slave fails its hardware address is
  437. swapped with the new curr_active_slave that was
  438. chosen.
  439. num_grat_arp
  440. Specifies the number of gratuitous ARPs to be issued after a
  441. failover event. One gratuitous ARP is issued immediately after
  442. the failover, subsequent ARPs are sent at a rate of one per link
  443. monitor interval (arp_interval or miimon, whichever is active).
  444. The valid range is 0 - 255; the default value is 1. This option
  445. affects only the active-backup mode. This option was added for
  446. bonding version 3.3.0.
  447. num_unsol_na
  448. Specifies the number of unsolicited IPv6 Neighbor Advertisements
  449. to be issued after a failover event. One unsolicited NA is issued
  450. immediately after the failover.
  451. The valid range is 0 - 255; the default value is 1. This option
  452. affects only the active-backup mode. This option was added for
  453. bonding version 3.4.0.
  454. primary
  455. A string (eth0, eth2, etc) specifying which slave is the
  456. primary device. The specified device will always be the
  457. active slave while it is available. Only when the primary is
  458. off-line will alternate devices be used. This is useful when
  459. one slave is preferred over another, e.g., when one slave has
  460. higher throughput than another.
  461. The primary option is only valid for active-backup mode.
  462. updelay
  463. Specifies the time, in milliseconds, to wait before enabling a
  464. slave after a link recovery has been detected. This option is
  465. only valid for the miimon link monitor. The updelay value
  466. should be a multiple of the miimon value; if not, it will be
  467. rounded down to the nearest multiple. The default value is 0.
  468. use_carrier
  469. Specifies whether or not miimon should use MII or ETHTOOL
  470. ioctls vs. netif_carrier_ok() to determine the link
  471. status. The MII or ETHTOOL ioctls are less efficient and
  472. utilize a deprecated calling sequence within the kernel. The
  473. netif_carrier_ok() relies on the device driver to maintain its
  474. state with netif_carrier_on/off; at this writing, most, but
  475. not all, device drivers support this facility.
  476. If bonding insists that the link is up when it should not be,
  477. it may be that your network device driver does not support
  478. netif_carrier_on/off. The default state for netif_carrier is
  479. "carrier on," so if a driver does not support netif_carrier,
  480. it will appear as if the link is always up. In this case,
  481. setting use_carrier to 0 will cause bonding to revert to the
  482. MII / ETHTOOL ioctl method to determine the link state.
  483. A value of 1 enables the use of netif_carrier_ok(), a value of
  484. 0 will use the deprecated MII / ETHTOOL ioctls. The default
  485. value is 1.
  486. xmit_hash_policy
  487. Selects the transmit hash policy to use for slave selection in
  488. balance-xor and 802.3ad modes. Possible values are:
  489. layer2
  490. Uses XOR of hardware MAC addresses to generate the
  491. hash. The formula is
  492. (source MAC XOR destination MAC) modulo slave count
  493. This algorithm will place all traffic to a particular
  494. network peer on the same slave.
  495. This algorithm is 802.3ad compliant.
  496. layer2+3
  497. This policy uses a combination of layer2 and layer3
  498. protocol information to generate the hash.
  499. Uses XOR of hardware MAC addresses and IP addresses to
  500. generate the hash. The formula is
  501. (((source IP XOR dest IP) AND 0xffff) XOR
  502. ( source MAC XOR destination MAC ))
  503. modulo slave count
  504. This algorithm will place all traffic to a particular
  505. network peer on the same slave. For non-IP traffic,
  506. the formula is the same as for the layer2 transmit
  507. hash policy.
  508. This policy is intended to provide a more balanced
  509. distribution of traffic than layer2 alone, especially
  510. in environments where a layer3 gateway device is
  511. required to reach most destinations.
  512. This algorithm is 802.3ad compliant.
  513. layer3+4
  514. This policy uses upper layer protocol information,
  515. when available, to generate the hash. This allows for
  516. traffic to a particular network peer to span multiple
  517. slaves, although a single connection will not span
  518. multiple slaves.
  519. The formula for unfragmented TCP and UDP packets is
  520. ((source port XOR dest port) XOR
  521. ((source IP XOR dest IP) AND 0xffff)
  522. modulo slave count
  523. For fragmented TCP or UDP packets and all other IP
  524. protocol traffic, the source and destination port
  525. information is omitted. For non-IP traffic, the
  526. formula is the same as for the layer2 transmit hash
  527. policy.
  528. This policy is intended to mimic the behavior of
  529. certain switches, notably Cisco switches with PFC2 as
  530. well as some Foundry and IBM products.
  531. This algorithm is not fully 802.3ad compliant. A
  532. single TCP or UDP conversation containing both
  533. fragmented and unfragmented packets will see packets
  534. striped across two interfaces. This may result in out
  535. of order delivery. Most traffic types will not meet
  536. this criteria, as TCP rarely fragments traffic, and
  537. most UDP traffic is not involved in extended
  538. conversations. Other implementations of 802.3ad may
  539. or may not tolerate this noncompliance.
  540. The default value is layer2. This option was added in bonding
  541. version 2.6.3. In earlier versions of bonding, this parameter
  542. does not exist, and the layer2 policy is the only policy. The
  543. layer2+3 value was added for bonding version 3.2.2.
  544. 3. Configuring Bonding Devices
  545. ==============================
  546. You can configure bonding using either your distro's network
  547. initialization scripts, or manually using either ifenslave or the
  548. sysfs interface. Distros generally use one of two packages for the
  549. network initialization scripts: initscripts or sysconfig. Recent
  550. versions of these packages have support for bonding, while older
  551. versions do not.
  552. We will first describe the options for configuring bonding for
  553. distros using versions of initscripts and sysconfig with full or
  554. partial support for bonding, then provide information on enabling
  555. bonding without support from the network initialization scripts (i.e.,
  556. older versions of initscripts or sysconfig).
  557. If you're unsure whether your distro uses sysconfig or
  558. initscripts, or don't know if it's new enough, have no fear.
  559. Determining this is fairly straightforward.
  560. First, issue the command:
  561. $ rpm -qf /sbin/ifup
  562. It will respond with a line of text starting with either
  563. "initscripts" or "sysconfig," followed by some numbers. This is the
  564. package that provides your network initialization scripts.
  565. Next, to determine if your installation supports bonding,
  566. issue the command:
  567. $ grep ifenslave /sbin/ifup
  568. If this returns any matches, then your initscripts or
  569. sysconfig has support for bonding.
  570. 3.1 Configuration with Sysconfig Support
  571. ----------------------------------------
  572. This section applies to distros using a version of sysconfig
  573. with bonding support, for example, SuSE Linux Enterprise Server 9.
  574. SuSE SLES 9's networking configuration system does support
  575. bonding, however, at this writing, the YaST system configuration
  576. front end does not provide any means to work with bonding devices.
  577. Bonding devices can be managed by hand, however, as follows.
  578. First, if they have not already been configured, configure the
  579. slave devices. On SLES 9, this is most easily done by running the
  580. yast2 sysconfig configuration utility. The goal is for to create an
  581. ifcfg-id file for each slave device. The simplest way to accomplish
  582. this is to configure the devices for DHCP (this is only to get the
  583. file ifcfg-id file created; see below for some issues with DHCP). The
  584. name of the configuration file for each device will be of the form:
  585. ifcfg-id-xx:xx:xx:xx:xx:xx
  586. Where the "xx" portion will be replaced with the digits from
  587. the device's permanent MAC address.
  588. Once the set of ifcfg-id-xx:xx:xx:xx:xx:xx files has been
  589. created, it is necessary to edit the configuration files for the slave
  590. devices (the MAC addresses correspond to those of the slave devices).
  591. Before editing, the file will contain multiple lines, and will look
  592. something like this:
  593. BOOTPROTO='dhcp'
  594. STARTMODE='on'
  595. USERCTL='no'
  596. UNIQUE='XNzu.WeZGOGF+4wE'
  597. _nm_name='bus-pci-0001:61:01.0'
  598. Change the BOOTPROTO and STARTMODE lines to the following:
  599. BOOTPROTO='none'
  600. STARTMODE='off'
  601. Do not alter the UNIQUE or _nm_name lines. Remove any other
  602. lines (USERCTL, etc).
  603. Once the ifcfg-id-xx:xx:xx:xx:xx:xx files have been modified,
  604. it's time to create the configuration file for the bonding device
  605. itself. This file is named ifcfg-bondX, where X is the number of the
  606. bonding device to create, starting at 0. The first such file is
  607. ifcfg-bond0, the second is ifcfg-bond1, and so on. The sysconfig
  608. network configuration system will correctly start multiple instances
  609. of bonding.
  610. The contents of the ifcfg-bondX file is as follows:
  611. BOOTPROTO="static"
  612. BROADCAST="10.0.2.255"
  613. IPADDR="10.0.2.10"
  614. NETMASK="255.255.0.0"
  615. NETWORK="10.0.2.0"
  616. REMOTE_IPADDR=""
  617. STARTMODE="onboot"
  618. BONDING_MASTER="yes"
  619. BONDING_MODULE_OPTS="mode=active-backup miimon=100"
  620. BONDING_SLAVE0="eth0"
  621. BONDING_SLAVE1="bus-pci-0000:06:08.1"
  622. Replace the sample BROADCAST, IPADDR, NETMASK and NETWORK
  623. values with the appropriate values for your network.
  624. The STARTMODE specifies when the device is brought online.
  625. The possible values are:
  626. onboot: The device is started at boot time. If you're not
  627. sure, this is probably what you want.
  628. manual: The device is started only when ifup is called
  629. manually. Bonding devices may be configured this
  630. way if you do not wish them to start automatically
  631. at boot for some reason.
  632. hotplug: The device is started by a hotplug event. This is not
  633. a valid choice for a bonding device.
  634. off or ignore: The device configuration is ignored.
  635. The line BONDING_MASTER='yes' indicates that the device is a
  636. bonding master device. The only useful value is "yes."
  637. The contents of BONDING_MODULE_OPTS are supplied to the
  638. instance of the bonding module for this device. Specify the options
  639. for the bonding mode, link monitoring, and so on here. Do not include
  640. the max_bonds bonding parameter; this will confuse the configuration
  641. system if you have multiple bonding devices.
  642. Finally, supply one BONDING_SLAVEn="slave device" for each
  643. slave. where "n" is an increasing value, one for each slave. The
  644. "slave device" is either an interface name, e.g., "eth0", or a device
  645. specifier for the network device. The interface name is easier to
  646. find, but the ethN names are subject to change at boot time if, e.g.,
  647. a device early in the sequence has failed. The device specifiers
  648. (bus-pci-0000:06:08.1 in the example above) specify the physical
  649. network device, and will not change unless the device's bus location
  650. changes (for example, it is moved from one PCI slot to another). The
  651. example above uses one of each type for demonstration purposes; most
  652. configurations will choose one or the other for all slave devices.
  653. When all configuration files have been modified or created,
  654. networking must be restarted for the configuration changes to take
  655. effect. This can be accomplished via the following:
  656. # /etc/init.d/network restart
  657. Note that the network control script (/sbin/ifdown) will
  658. remove the bonding module as part of the network shutdown processing,
  659. so it is not necessary to remove the module by hand if, e.g., the
  660. module parameters have changed.
  661. Also, at this writing, YaST/YaST2 will not manage bonding
  662. devices (they do not show bonding interfaces on its list of network
  663. devices). It is necessary to edit the configuration file by hand to
  664. change the bonding configuration.
  665. Additional general options and details of the ifcfg file
  666. format can be found in an example ifcfg template file:
  667. /etc/sysconfig/network/ifcfg.template
  668. Note that the template does not document the various BONDING_
  669. settings described above, but does describe many of the other options.
  670. 3.1.1 Using DHCP with Sysconfig
  671. -------------------------------
  672. Under sysconfig, configuring a device with BOOTPROTO='dhcp'
  673. will cause it to query DHCP for its IP address information. At this
  674. writing, this does not function for bonding devices; the scripts
  675. attempt to obtain the device address from DHCP prior to adding any of
  676. the slave devices. Without active slaves, the DHCP requests are not
  677. sent to the network.
  678. 3.1.2 Configuring Multiple Bonds with Sysconfig
  679. -----------------------------------------------
  680. The sysconfig network initialization system is capable of
  681. handling multiple bonding devices. All that is necessary is for each
  682. bonding instance to have an appropriately configured ifcfg-bondX file
  683. (as described above). Do not specify the "max_bonds" parameter to any
  684. instance of bonding, as this will confuse sysconfig. If you require
  685. multiple bonding devices with identical parameters, create multiple
  686. ifcfg-bondX files.
  687. Because the sysconfig scripts supply the bonding module
  688. options in the ifcfg-bondX file, it is not necessary to add them to
  689. the system /etc/modules.conf or /etc/modprobe.conf configuration file.
  690. 3.2 Configuration with Initscripts Support
  691. ------------------------------------------
  692. This section applies to distros using a recent version of
  693. initscripts with bonding support, for example, Red Hat Enterprise Linux
  694. version 3 or later, Fedora, etc. On these systems, the network
  695. initialization scripts have knowledge of bonding, and can be configured to
  696. control bonding devices. Note that older versions of the initscripts
  697. package have lower levels of support for bonding; this will be noted where
  698. applicable.
  699. These distros will not automatically load the network adapter
  700. driver unless the ethX device is configured with an IP address.
  701. Because of this constraint, users must manually configure a
  702. network-script file for all physical adapters that will be members of
  703. a bondX link. Network script files are located in the directory:
  704. /etc/sysconfig/network-scripts
  705. The file name must be prefixed with "ifcfg-eth" and suffixed
  706. with the adapter's physical adapter number. For example, the script
  707. for eth0 would be named /etc/sysconfig/network-scripts/ifcfg-eth0.
  708. Place the following text in the file:
  709. DEVICE=eth0
  710. USERCTL=no
  711. ONBOOT=yes
  712. MASTER=bond0
  713. SLAVE=yes
  714. BOOTPROTO=none
  715. The DEVICE= line will be different for every ethX device and
  716. must correspond with the name of the file, i.e., ifcfg-eth1 must have
  717. a device line of DEVICE=eth1. The setting of the MASTER= line will
  718. also depend on the final bonding interface name chosen for your bond.
  719. As with other network devices, these typically start at 0, and go up
  720. one for each device, i.e., the first bonding instance is bond0, the
  721. second is bond1, and so on.
  722. Next, create a bond network script. The file name for this
  723. script will be /etc/sysconfig/network-scripts/ifcfg-bondX where X is
  724. the number of the bond. For bond0 the file is named "ifcfg-bond0",
  725. for bond1 it is named "ifcfg-bond1", and so on. Within that file,
  726. place the following text:
  727. DEVICE=bond0
  728. IPADDR=192.168.1.1
  729. NETMASK=255.255.255.0
  730. NETWORK=192.168.1.0
  731. BROADCAST=192.168.1.255
  732. ONBOOT=yes
  733. BOOTPROTO=none
  734. USERCTL=no
  735. Be sure to change the networking specific lines (IPADDR,
  736. NETMASK, NETWORK and BROADCAST) to match your network configuration.
  737. For later versions of initscripts, such as that found with Fedora
  738. 7 (or later) and Red Hat Enterprise Linux version 5 (or later), it is possible,
  739. and, indeed, preferable, to specify the bonding options in the ifcfg-bond0
  740. file, e.g. a line of the format:
  741. BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=192.168.1.254"
  742. will configure the bond with the specified options. The options
  743. specified in BONDING_OPTS are identical to the bonding module parameters
  744. except for the arp_ip_target field when using versions of initscripts older
  745. than and 8.57 (Fedora 8) and 8.45.19 (Red Hat Enterprise Linux 5.2). When
  746. using older versions each target should be included as a separate option and
  747. should be preceded by a '+' to indicate it should be added to the list of
  748. queried targets, e.g.,
  749. arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2
  750. is the proper syntax to specify multiple targets. When specifying
  751. options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or
  752. /etc/modprobe.conf.
  753. For even older versions of initscripts that do not support
  754. BONDING_OPTS, it is necessary to edit /etc/modules.conf (or
  755. /etc/modprobe.conf, depending upon your distro) to load the bonding module
  756. with your desired options when the bond0 interface is brought up. The
  757. following lines in /etc/modules.conf (or modprobe.conf) will load the
  758. bonding module, and select its options:
  759. alias bond0 bonding
  760. options bond0 mode=balance-alb miimon=100
  761. Replace the sample parameters with the appropriate set of
  762. options for your configuration.
  763. Finally run "/etc/rc.d/init.d/network restart" as root. This
  764. will restart the networking subsystem and your bond link should be now
  765. up and running.
  766. 3.2.1 Using DHCP with Initscripts
  767. ---------------------------------
  768. Recent versions of initscripts (the versions supplied with Fedora
  769. Core 3 and Red Hat Enterprise Linux 4, or later versions, are reported to
  770. work) have support for assigning IP information to bonding devices via
  771. DHCP.
  772. To configure bonding for DHCP, configure it as described
  773. above, except replace the line "BOOTPROTO=none" with "BOOTPROTO=dhcp"
  774. and add a line consisting of "TYPE=Bonding". Note that the TYPE value
  775. is case sensitive.
  776. 3.2.2 Configuring Multiple Bonds with Initscripts
  777. -------------------------------------------------
  778. Initscripts packages that are included with Fedora 7 and Red Hat
  779. Enterprise Linux 5 support multiple bonding interfaces by simply
  780. specifying the appropriate BONDING_OPTS= in ifcfg-bondX where X is the
  781. number of the bond. This support requires sysfs support in the kernel,
  782. and a bonding driver of version 3.0.0 or later. Other configurations may
  783. not support this method for specifying multiple bonding interfaces; for
  784. those instances, see the "Configuring Multiple Bonds Manually" section,
  785. below.
  786. 3.3 Configuring Bonding Manually with Ifenslave
  787. -----------------------------------------------
  788. This section applies to distros whose network initialization
  789. scripts (the sysconfig or initscripts package) do not have specific
  790. knowledge of bonding. One such distro is SuSE Linux Enterprise Server
  791. version 8.
  792. The general method for these systems is to place the bonding
  793. module parameters into /etc/modules.conf or /etc/modprobe.conf (as
  794. appropriate for the installed distro), then add modprobe and/or
  795. ifenslave commands to the system's global init script. The name of
  796. the global init script differs; for sysconfig, it is
  797. /etc/init.d/boot.local and for initscripts it is /etc/rc.d/rc.local.
  798. For example, if you wanted to make a simple bond of two e100
  799. devices (presumed to be eth0 and eth1), and have it persist across
  800. reboots, edit the appropriate file (/etc/init.d/boot.local or
  801. /etc/rc.d/rc.local), and add the following:
  802. modprobe bonding mode=balance-alb miimon=100
  803. modprobe e100
  804. ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
  805. ifenslave bond0 eth0
  806. ifenslave bond0 eth1
  807. Replace the example bonding module parameters and bond0
  808. network configuration (IP address, netmask, etc) with the appropriate
  809. values for your configuration.
  810. Unfortunately, this method will not provide support for the
  811. ifup and ifdown scripts on the bond devices. To reload the bonding
  812. configuration, it is necessary to run the initialization script, e.g.,
  813. # /etc/init.d/boot.local
  814. or
  815. # /etc/rc.d/rc.local
  816. It may be desirable in such a case to create a separate script
  817. which only initializes the bonding configuration, then call that
  818. separate script from within boot.local. This allows for bonding to be
  819. enabled without re-running the entire global init script.
  820. To shut down the bonding devices, it is necessary to first
  821. mark the bonding device itself as being down, then remove the
  822. appropriate device driver modules. For our example above, you can do
  823. the following:
  824. # ifconfig bond0 down
  825. # rmmod bonding
  826. # rmmod e100
  827. Again, for convenience, it may be desirable to create a script
  828. with these commands.
  829. 3.3.1 Configuring Multiple Bonds Manually
  830. -----------------------------------------
  831. This section contains information on configuring multiple
  832. bonding devices with differing options for those systems whose network
  833. initialization scripts lack support for configuring multiple bonds.
  834. If you require multiple bonding devices, but all with the same
  835. options, you may wish to use the "max_bonds" module parameter,
  836. documented above.
  837. To create multiple bonding devices with differing options, it is
  838. preferrable to use bonding parameters exported by sysfs, documented in the
  839. section below.
  840. For versions of bonding without sysfs support, the only means to
  841. provide multiple instances of bonding with differing options is to load
  842. the bonding driver multiple times. Note that current versions of the
  843. sysconfig network initialization scripts handle this automatically; if
  844. your distro uses these scripts, no special action is needed. See the
  845. section Configuring Bonding Devices, above, if you're not sure about your
  846. network initialization scripts.
  847. To load multiple instances of the module, it is necessary to
  848. specify a different name for each instance (the module loading system
  849. requires that every loaded module, even multiple instances of the same
  850. module, have a unique name). This is accomplished by supplying multiple
  851. sets of bonding options in /etc/modprobe.conf, for example:
  852. alias bond0 bonding
  853. options bond0 -o bond0 mode=balance-rr miimon=100
  854. alias bond1 bonding
  855. options bond1 -o bond1 mode=balance-alb miimon=50
  856. will load the bonding module two times. The first instance is
  857. named "bond0" and creates the bond0 device in balance-rr mode with an
  858. miimon of 100. The second instance is named "bond1" and creates the
  859. bond1 device in balance-alb mode with an miimon of 50.
  860. In some circumstances (typically with older distributions),
  861. the above does not work, and the second bonding instance never sees
  862. its options. In that case, the second options line can be substituted
  863. as follows:
  864. install bond1 /sbin/modprobe --ignore-install bonding -o bond1 \
  865. mode=balance-alb miimon=50
  866. This may be repeated any number of times, specifying a new and
  867. unique name in place of bond1 for each subsequent instance.
  868. It has been observed that some Red Hat supplied kernels are unable
  869. to rename modules at load time (the "-o bond1" part). Attempts to pass
  870. that option to modprobe will produce an "Operation not permitted" error.
  871. This has been reported on some Fedora Core kernels, and has been seen on
  872. RHEL 4 as well. On kernels exhibiting this problem, it will be impossible
  873. to configure multiple bonds with differing parameters (as they are older
  874. kernels, and also lack sysfs support).
  875. 3.4 Configuring Bonding Manually via Sysfs
  876. ------------------------------------------
  877. Starting with version 3.0.0, Channel Bonding may be configured
  878. via the sysfs interface. This interface allows dynamic configuration
  879. of all bonds in the system without unloading the module. It also
  880. allows for adding and removing bonds at runtime. Ifenslave is no
  881. longer required, though it is still supported.
  882. Use of the sysfs interface allows you to use multiple bonds
  883. with different configurations without having to reload the module.
  884. It also allows you to use multiple, differently configured bonds when
  885. bonding is compiled into the kernel.
  886. You must have the sysfs filesystem mounted to configure
  887. bonding this way. The examples in this document assume that you
  888. are using the standard mount point for sysfs, e.g. /sys. If your
  889. sysfs filesystem is mounted elsewhere, you will need to adjust the
  890. example paths accordingly.
  891. Creating and Destroying Bonds
  892. -----------------------------
  893. To add a new bond foo:
  894. # echo +foo > /sys/class/net/bonding_masters
  895. To remove an existing bond bar:
  896. # echo -bar > /sys/class/net/bonding_masters
  897. To show all existing bonds:
  898. # cat /sys/class/net/bonding_masters
  899. NOTE: due to 4K size limitation of sysfs files, this list may be
  900. truncated if you have more than a few hundred bonds. This is unlikely
  901. to occur under normal operating conditions.
  902. Adding and Removing Slaves
  903. --------------------------
  904. Interfaces may be enslaved to a bond using the file
  905. /sys/class/net/<bond>/bonding/slaves. The semantics for this file
  906. are the same as for the bonding_masters file.
  907. To enslave interface eth0 to bond bond0:
  908. # ifconfig bond0 up
  909. # echo +eth0 > /sys/class/net/bond0/bonding/slaves
  910. To free slave eth0 from bond bond0:
  911. # echo -eth0 > /sys/class/net/bond0/bonding/slaves
  912. When an interface is enslaved to a bond, symlinks between the
  913. two are created in the sysfs filesystem. In this case, you would get
  914. /sys/class/net/bond0/slave_eth0 pointing to /sys/class/net/eth0, and
  915. /sys/class/net/eth0/master pointing to /sys/class/net/bond0.
  916. This means that you can tell quickly whether or not an
  917. interface is enslaved by looking for the master symlink. Thus:
  918. # echo -eth0 > /sys/class/net/eth0/master/bonding/slaves
  919. will free eth0 from whatever bond it is enslaved to, regardless of
  920. the name of the bond interface.
  921. Changing a Bond's Configuration
  922. -------------------------------
  923. Each bond may be configured individually by manipulating the
  924. files located in /sys/class/net/<bond name>/bonding
  925. The names of these files correspond directly with the command-
  926. line parameters described elsewhere in this file, and, with the
  927. exception of arp_ip_target, they accept the same values. To see the
  928. current setting, simply cat the appropriate file.
  929. A few examples will be given here; for specific usage
  930. guidelines for each parameter, see the appropriate section in this
  931. document.
  932. To configure bond0 for balance-alb mode:
  933. # ifconfig bond0 down
  934. # echo 6 > /sys/class/net/bond0/bonding/mode
  935. - or -
  936. # echo balance-alb > /sys/class/net/bond0/bonding/mode
  937. NOTE: The bond interface must be down before the mode can be
  938. changed.
  939. To enable MII monitoring on bond0 with a 1 second interval:
  940. # echo 1000 > /sys/class/net/bond0/bonding/miimon
  941. NOTE: If ARP monitoring is enabled, it will disabled when MII
  942. monitoring is enabled, and vice-versa.
  943. To add ARP targets:
  944. # echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
  945. # echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
  946. NOTE: up to 10 target addresses may be specified.
  947. To remove an ARP target:
  948. # echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
  949. Example Configuration
  950. ---------------------
  951. We begin with the same example that is shown in section 3.3,
  952. executed with sysfs, and without using ifenslave.
  953. To make a simple bond of two e100 devices (presumed to be eth0
  954. and eth1), and have it persist across reboots, edit the appropriate
  955. file (/etc/init.d/boot.local or /etc/rc.d/rc.local), and add the
  956. following:
  957. modprobe bonding
  958. modprobe e100
  959. echo balance-alb > /sys/class/net/bond0/bonding/mode
  960. ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
  961. echo 100 > /sys/class/net/bond0/bonding/miimon
  962. echo +eth0 > /sys/class/net/bond0/bonding/slaves
  963. echo +eth1 > /sys/class/net/bond0/bonding/slaves
  964. To add a second bond, with two e1000 interfaces in
  965. active-backup mode, using ARP monitoring, add the following lines to
  966. your init script:
  967. modprobe e1000
  968. echo +bond1 > /sys/class/net/bonding_masters
  969. echo active-backup > /sys/class/net/bond1/bonding/mode
  970. ifconfig bond1 192.168.2.1 netmask 255.255.255.0 up
  971. echo +192.168.2.100 /sys/class/net/bond1/bonding/arp_ip_target
  972. echo 2000 > /sys/class/net/bond1/bonding/arp_interval
  973. echo +eth2 > /sys/class/net/bond1/bonding/slaves
  974. echo +eth3 > /sys/class/net/bond1/bonding/slaves
  975. 4. Querying Bonding Configuration
  976. =================================
  977. 4.1 Bonding Configuration
  978. -------------------------
  979. Each bonding device has a read-only file residing in the
  980. /proc/net/bonding directory. The file contents include information
  981. about the bonding configuration, options and state of each slave.
  982. For example, the contents of /proc/net/bonding/bond0 after the
  983. driver is loaded with parameters of mode=0 and miimon=1000 is
  984. generally as follows:
  985. Ethernet Channel Bonding Driver: 2.6.1 (October 29, 2004)
  986. Bonding Mode: load balancing (round-robin)
  987. Currently Active Slave: eth0
  988. MII Status: up
  989. MII Polling Interval (ms): 1000
  990. Up Delay (ms): 0
  991. Down Delay (ms): 0
  992. Slave Interface: eth1
  993. MII Status: up
  994. Link Failure Count: 1
  995. Slave Interface: eth0
  996. MII Status: up
  997. Link Failure Count: 1
  998. The precise format and contents will change depending upon the
  999. bonding configuration, state, and version of the bonding driver.
  1000. 4.2 Network configuration
  1001. -------------------------
  1002. The network configuration can be inspected using the ifconfig
  1003. command. Bonding devices will have the MASTER flag set; Bonding slave
  1004. devices will have the SLAVE flag set. The ifconfig output does not
  1005. contain information on which slaves are associated with which masters.
  1006. In the example below, the bond0 interface is the master
  1007. (MASTER) while eth0 and eth1 are slaves (SLAVE). Notice all slaves of
  1008. bond0 have the same MAC address (HWaddr) as bond0 for all modes except
  1009. TLB and ALB that require a unique MAC address for each slave.
  1010. # /sbin/ifconfig
  1011. bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
  1012. inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0
  1013. UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
  1014. RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0
  1015. TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0
  1016. collisions:0 txqueuelen:0
  1017. eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
  1018. UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
  1019. RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0
  1020. TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0
  1021. collisions:0 txqueuelen:100
  1022. Interrupt:10 Base address:0x1080
  1023. eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
  1024. UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
  1025. RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0
  1026. TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0
  1027. collisions:0 txqueuelen:100
  1028. Interrupt:9 Base address:0x1400
  1029. 5. Switch Configuration
  1030. =======================
  1031. For this section, "switch" refers to whatever system the
  1032. bonded devices are directly connected to (i.e., where the other end of
  1033. the cable plugs into). This may be an actual dedicated switch device,
  1034. or it may be another regular system (e.g., another computer running
  1035. Linux),
  1036. The active-backup, balance-tlb and balance-alb modes do not
  1037. require any specific configuration of the switch.
  1038. The 802.3ad mode requires that the switch have the appropriate
  1039. ports configured as an 802.3ad aggregation. The precise method used
  1040. to configure this varies from switch to switch, but, for example, a
  1041. Cisco 3550 series switch requires that the appropriate ports first be
  1042. grouped together in a single etherchannel instance, then that
  1043. etherchannel is set to mode "lacp" to enable 802.3ad (instead of
  1044. standard EtherChannel).
  1045. The balance-rr, balance-xor and broadcast modes generally
  1046. require that the switch have the appropriate ports grouped together.
  1047. The nomenclature for such a group differs between switches, it may be
  1048. called an "etherchannel" (as in the Cisco example, above), a "trunk
  1049. group" or some other similar variation. For these modes, each switch
  1050. will also have its own configuration options for the switch's transmit
  1051. policy to the bond. Typical choices include XOR of either the MAC or
  1052. IP addresses. The transmit policy of the two peers does not need to
  1053. match. For these three modes, the bonding mode really selects a
  1054. transmit policy for an EtherChannel group; all three will interoperate
  1055. with another EtherChannel group.
  1056. 6. 802.1q VLAN Support
  1057. ======================
  1058. It is possible to configure VLAN devices over a bond interface
  1059. using the 8021q driver. However, only packets coming from the 8021q
  1060. driver and passing through bonding will be tagged by default. Self
  1061. generated packets, for example, bonding's learning packets or ARP
  1062. packets generated by either ALB mode or the ARP monitor mechanism, are
  1063. tagged internally by bonding itself. As a result, bonding must
  1064. "learn" the VLAN IDs configured above it, and use those IDs to tag
  1065. self generated packets.
  1066. For reasons of simplicity, and to support the use of adapters
  1067. that can do VLAN hardware acceleration offloading, the bonding
  1068. interface declares itself as fully hardware offloading capable, it gets
  1069. the add_vid/kill_vid notifications to gather the necessary
  1070. information, and it propagates those actions to the slaves. In case
  1071. of mixed adapter types, hardware accelerated tagged packets that
  1072. should go through an adapter that is not offloading capable are
  1073. "un-accelerated" by the bonding driver so the VLAN tag sits in the
  1074. regular location.
  1075. VLAN interfaces *must* be added on top of a bonding interface
  1076. only after enslaving at least one slave. The bonding interface has a
  1077. hardware address of 00:00:00:00:00:00 until the first slave is added.
  1078. If the VLAN interface is created prior to the first enslavement, it
  1079. would pick up the all-zeroes hardware address. Once the first slave
  1080. is attached to the bond, the bond device itself will pick up the
  1081. slave's hardware address, which is then available for the VLAN device.
  1082. Also, be aware that a similar problem can occur if all slaves
  1083. are released from a bond that still has one or more VLAN interfaces on
  1084. top of it. When a new slave is added, the bonding interface will
  1085. obtain its hardware address from the first slave, which might not
  1086. match the hardware address of the VLAN interfaces (which was
  1087. ultimately copied from an earlier slave).
  1088. There are two methods to insure that the VLAN device operates
  1089. with the correct hardware address if all slaves are removed from a
  1090. bond interface:
  1091. 1. Remove all VLAN interfaces then recreate them
  1092. 2. Set the bonding interface's hardware address so that it
  1093. matches the hardware address of the VLAN interfaces.
  1094. Note that changing a VLAN interface's HW address would set the
  1095. underlying device -- i.e. the bonding interface -- to promiscuous
  1096. mode, which might not be what you want.
  1097. 7. Link Monitoring
  1098. ==================
  1099. The bonding driver at present supports two schemes for
  1100. monitoring a slave device's link state: the ARP monitor and the MII
  1101. monitor.
  1102. At the present time, due to implementation restrictions in the
  1103. bonding driver itself, it is not possible to enable both ARP and MII
  1104. monitoring simultaneously.
  1105. 7.1 ARP Monitor Operation
  1106. -------------------------
  1107. The ARP monitor operates as its name suggests: it sends ARP
  1108. queries to one or more designated peer systems on the network, and
  1109. uses the response as an indication that the link is operating. This
  1110. gives some assurance that traffic is actually flowing to and from one
  1111. or more peers on the local network.
  1112. The ARP monitor relies on the device driver itself to verify
  1113. that traffic is flowing. In particular, the driver must keep up to
  1114. date the last receive time, dev->last_rx, and transmit start time,
  1115. dev->trans_start. If these are not updated by the driver, then the
  1116. ARP monitor will immediately fail any slaves using that driver, and
  1117. those slaves will stay down. If networking monitoring (tcpdump, etc)
  1118. shows the ARP requests and replies on the network, then it may be that
  1119. your device driver is not updating last_rx and trans_start.
  1120. 7.2 Configuring Multiple ARP Targets
  1121. ------------------------------------
  1122. While ARP monitoring can be done with just one target, it can
  1123. be useful in a High Availability setup to have several targets to
  1124. monitor. In the case of just one target, the target itself may go
  1125. down or have a problem making it unresponsive to ARP requests. Having
  1126. an additional target (or several) increases the reliability of the ARP
  1127. monitoring.
  1128. Multiple ARP targets must be separated by commas as follows:
  1129. # example options for ARP monitoring with three targets
  1130. alias bond0 bonding
  1131. options bond0 arp_interval=60 arp_ip_target=192.168.0.1,192.168.0.3,192.168.0.9
  1132. For just a single target the options would resemble:
  1133. # example options for ARP monitoring with one target
  1134. alias bond0 bonding
  1135. options bond0 arp_interval=60 arp_ip_target=192.168.0.100
  1136. 7.3 MII Monitor Operation
  1137. -------------------------
  1138. The MII monitor monitors only the carrier state of the local
  1139. network interface. It accomplishes this in one of three ways: by
  1140. depending upon the device driver to maintain its carrier state, by
  1141. querying the device's MII registers, or by making an ethtool query to
  1142. the device.
  1143. If the use_carrier module parameter is 1 (the default value),
  1144. then the MII monitor will rely on the driver for carrier state
  1145. information (via the netif_carrier subsystem). As explained in the
  1146. use_carrier parameter information, above, if the MII monitor fails to
  1147. detect carrier loss on the device (e.g., when the cable is physically
  1148. disconnected), it may be that the driver does not support
  1149. netif_carrier.
  1150. If use_carrier is 0, then the MII monitor will first query the
  1151. device's (via ioctl) MII registers and check the link state. If that
  1152. request fails (not just that it returns carrier down), then the MII
  1153. monitor will make an ethtool ETHOOL_GLINK request to attempt to obtain
  1154. the same information. If both methods fail (i.e., the driver either
  1155. does not support or had some error in processing both the MII register
  1156. and ethtool requests), then the MII monitor will assume the link is
  1157. up.
  1158. 8. Potential Sources of Trouble
  1159. ===============================
  1160. 8.1 Adventures in Routing
  1161. -------------------------
  1162. When bonding is configured, it is important that the slave
  1163. devices not have routes that supersede routes of the master (or,
  1164. generally, not have routes at all). For example, suppose the bonding
  1165. device bond0 has two slaves, eth0 and eth1, and the routing table is
  1166. as follows:
  1167. Kernel IP routing table
  1168. Destination Gateway Genmask Flags MSS Window irtt Iface
  1169. 10.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 eth0
  1170. 10.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 eth1
  1171. 10.0.0.0 0.0.0.0 255.255.0.0 U 40 0 0 bond0
  1172. 127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
  1173. This routing configuration will likely still update the
  1174. receive/transmit times in the driver (needed by the ARP monitor), but
  1175. may bypass the bonding driver (because outgoing traffic to, in this
  1176. case, another host on network 10 would use eth0 or eth1 before bond0).
  1177. The ARP monitor (and ARP itself) may become confused by this
  1178. configuration, because ARP requests (generated by the ARP monitor)
  1179. will be sent on one interface (bond0), but the corresponding reply
  1180. will arrive on a different interface (eth0). This reply looks to ARP
  1181. as an unsolicited ARP reply (because ARP matches replies on an
  1182. interface basis), and is discarded. The MII monitor is not affected
  1183. by the state of the routing table.
  1184. The solution here is simply to insure that slaves do not have
  1185. routes of their own, and if for some reason they must, those routes do
  1186. not supersede routes of their master. This should generally be the
  1187. case, but unusual configurations or errant manual or automatic static
  1188. route additions may cause trouble.
  1189. 8.2 Ethernet Device Renaming
  1190. ----------------------------
  1191. On systems with network configuration scripts that do not
  1192. associate physical devices directly with network interface names (so
  1193. that the same physical device always has the same "ethX" name), it may
  1194. be necessary to add some special logic to either /etc/modules.conf or
  1195. /etc/modprobe.conf (depending upon which is installed on the system).
  1196. For example, given a modules.conf containing the following:
  1197. alias bond0 bonding
  1198. options bond0 mode=some-mode miimon=50
  1199. alias eth0 tg3
  1200. alias eth1 tg3
  1201. alias eth2 e1000
  1202. alias eth3 e1000
  1203. If neither eth0 and eth1 are slaves to bond0, then when the
  1204. bond0 interface comes up, the devices may end up reordered. This
  1205. happens because bonding is loaded first, then its slave device's
  1206. drivers are loaded next. Since no other drivers have been loaded,
  1207. when the e1000 driver loads, it will receive eth0 and eth1 for its
  1208. devices, but the bonding configuration tries to enslave eth2 and eth3
  1209. (which may later be assigned to the tg3 devices).
  1210. Adding the following:
  1211. add above bonding e1000 tg3
  1212. causes modprobe to load e1000 then tg3, in that order, when
  1213. bonding is loaded. This command is fully documented in the
  1214. modules.conf manual page.
  1215. On systems utilizing modprobe.conf (or modprobe.conf.local),
  1216. an equivalent problem can occur. In this case, the following can be
  1217. added to modprobe.conf (or modprobe.conf.local, as appropriate), as
  1218. follows (all on one line; it has been split here for clarity):
  1219. install bonding /sbin/modprobe tg3; /sbin/modprobe e1000;
  1220. /sbin/modprobe --ignore-install bonding
  1221. This will, when loading the bonding module, rather than
  1222. performing the normal action, instead execute the provided command.
  1223. This command loads the device drivers in the order needed, then calls
  1224. modprobe with --ignore-install to cause the normal action to then take
  1225. place. Full documentation on this can be found in the modprobe.conf
  1226. and modprobe manual pages.
  1227. 8.3. Painfully Slow Or No Failed Link Detection By Miimon
  1228. ---------------------------------------------------------
  1229. By default, bonding enables the use_carrier option, which
  1230. instructs bonding to trust the driver to maintain carrier state.
  1231. As discussed in the options section, above, some drivers do
  1232. not support the netif_carrier_on/_off link state tracking system.
  1233. With use_carrier enabled, bonding will always see these links as up,
  1234. regardless of their actual state.
  1235. Additionally, other drivers do support netif_carrier, but do
  1236. not maintain it in real time, e.g., only polling the link state at
  1237. some fixed interval. In this case, miimon will detect failures, but
  1238. only after some long period of time has expired. If it appears that
  1239. miimon is very slow in detecting link failures, try specifying
  1240. use_carrier=0 to see if that improves the failure detection time. If
  1241. it does, then it may be that the driver checks the carrier state at a
  1242. fixed interval, but does not cache the MII register values (so the
  1243. use_carrier=0 method of querying the registers directly works). If
  1244. use_carrier=0 does not improve the failover, then the driver may cache
  1245. the registers, or the problem may be elsewhere.
  1246. Also, remember that miimon only checks for the device's
  1247. carrier state. It has no way to determine the state of devices on or
  1248. beyond other ports of a switch, or if a switch is refusing to pass
  1249. traffic while still maintaining carrier on.
  1250. 9. SNMP agents
  1251. ===============
  1252. If running SNMP agents, the bonding driver should be loaded
  1253. before any network drivers participating in a bond. This requirement
  1254. is due to the interface index (ipAdEntIfIndex) being associated to
  1255. the first interface found with a given IP address. That is, there is
  1256. only one ipAdEntIfIndex for each IP address. For example, if eth0 and
  1257. eth1 are slaves of bond0 and the driver for eth0 is loaded before the
  1258. bonding driver, the interface for the IP address will be associated
  1259. with the eth0 interface. This configuration is shown below, the IP
  1260. address 192.168.1.1 has an interface index of 2 which indexes to eth0
  1261. in the ifDescr table (ifDescr.2).
  1262. interfaces.ifTable.ifEntry.ifDescr.1 = lo
  1263. interfaces.ifTable.ifEntry.ifDescr.2 = eth0
  1264. interfaces.ifTable.ifEntry.ifDescr.3 = eth1
  1265. interfaces.ifTable.ifEntry.ifDescr.4 = eth2
  1266. interfaces.ifTable.ifEntry.ifDescr.5 = eth3
  1267. interfaces.ifTable.ifEntry.ifDescr.6 = bond0
  1268. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 5
  1269. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
  1270. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 4
  1271. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
  1272. This problem is avoided by loading the bonding driver before
  1273. any network drivers participating in a bond. Below is an example of
  1274. loading the bonding driver first, the IP address 192.168.1.1 is
  1275. correctly associated with ifDescr.2.
  1276. interfaces.ifTable.ifEntry.ifDescr.1 = lo
  1277. interfaces.ifTable.ifEntry.ifDescr.2 = bond0
  1278. interfaces.ifTable.ifEntry.ifDescr.3 = eth0
  1279. interfaces.ifTable.ifEntry.ifDescr.4 = eth1
  1280. interfaces.ifTable.ifEntry.ifDescr.5 = eth2
  1281. interfaces.ifTable.ifEntry.ifDescr.6 = eth3
  1282. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.10.10.10 = 6
  1283. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.1.1 = 2
  1284. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.10.74.20.94 = 5
  1285. ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
  1286. While some distributions may not report the interface name in
  1287. ifDescr, the association between the IP address and IfIndex remains
  1288. and SNMP functions such as Interface_Scan_Next will report that
  1289. association.
  1290. 10. Promiscuous mode
  1291. ====================
  1292. When running network monitoring tools, e.g., tcpdump, it is
  1293. common to enable promiscuous mode on the device, so that all traffic
  1294. is seen (instead of seeing only traffic destined for the local host).
  1295. The bonding driver handles promiscuous mode changes to the bonding
  1296. master device (e.g., bond0), and propagates the setting to the slave
  1297. devices.
  1298. For the balance-rr, balance-xor, broadcast, and 802.3ad modes,
  1299. the promiscuous mode setting is propagated to all slaves.
  1300. For the active-backup, balance-tlb and balance-alb modes, the
  1301. promiscuous mode setting is propagated only to the active slave.
  1302. For balance-tlb mode, the active slave is the slave currently
  1303. receiving inbound traffic.
  1304. For balance-alb mode, the active slave is the slave used as a
  1305. "primary." This slave is used for mode-specific control traffic, for
  1306. sending to peers that are unassigned or if the load is unbalanced.
  1307. For the active-backup, balance-tlb and balance-alb modes, when
  1308. the active slave changes (e.g., due to a link failure), the
  1309. promiscuous setting will be propagated to the new active slave.
  1310. 11. Configuring Bonding for High Availability
  1311. =============================================
  1312. High Availability refers to configurations that provide
  1313. maximum network availability by having redundant or backup devices,
  1314. links or switches between the host and the rest of the world. The
  1315. goal is to provide the maximum availability of network connectivity
  1316. (i.e., the network always works), even though other configurations
  1317. could provide higher throughput.
  1318. 11.1 High Availability in a Single Switch Topology
  1319. --------------------------------------------------
  1320. If two hosts (or a host and a single switch) are directly
  1321. connected via multiple physical links, then there is no availability
  1322. penalty to optimizing for maximum bandwidth. In this case, there is
  1323. only one switch (or peer), so if it fails, there is no alternative
  1324. access to fail over to. Additionally, the bonding load balance modes
  1325. support link monitoring of their members, so if individual links fail,
  1326. the load will be rebalanced across the remaining devices.
  1327. See Section 13, "Configuring Bonding for Maximum Throughput"
  1328. for information on configuring bonding with one peer device.
  1329. 11.2 High Availability in a Multiple Switch Topology
  1330. ----------------------------------------------------
  1331. With multiple switches, the configuration of bonding and the
  1332. network changes dramatically. In multiple switch topologies, there is
  1333. a trade off between network availability and usable bandwidth.
  1334. Below is a sample network, configured to maximize the
  1335. availability of the network:
  1336. | |
  1337. |port3 port3|
  1338. +-----+----+ +-----+----+
  1339. | |port2 ISL port2| |
  1340. | switch A +--------------------------+ switch B |
  1341. | | | |
  1342. +-----+----+ +-----++---+
  1343. |port1 port1|
  1344. | +-------+ |
  1345. +-------------+ host1 +---------------+
  1346. eth0 +-------+ eth1
  1347. In this configuration, there is a link between the two
  1348. switches (ISL, or inter switch link), and multiple ports connecting to
  1349. the outside world ("port3" on each switch). There is no technical
  1350. reason that this could not be extended to a third switch.
  1351. 11.2.1 HA Bonding Mode Selection for Multiple Switch Topology
  1352. -------------------------------------------------------------
  1353. In a topology such as the example above, the active-backup and
  1354. broadcast modes are the only useful bonding modes when optimizing for
  1355. availability; the other modes require all links to terminate on the
  1356. same peer for them to behave rationally.
  1357. active-backup: This is generally the preferred mode, particularly if
  1358. the switches have an ISL and play together well. If the
  1359. network configuration is such that one switch is specifically
  1360. a backup switch (e.g., has lower capacity, higher cost, etc),
  1361. then the primary option can be used to insure that the
  1362. preferred link is always used when it is available.
  1363. broadcast: This mode is really a special purpose mode, and is suitable
  1364. only for very specific needs. For example, if the two
  1365. switches are not connected (no ISL), and the networks beyond
  1366. them are totally independent. In this case, if it is
  1367. necessary for some specific one-way traffic to reach both
  1368. independent networks, then the broadcast mode may be suitable.
  1369. 11.2.2 HA Link Monitoring Selection for Multiple Switch Topology
  1370. ----------------------------------------------------------------
  1371. The choice of link monitoring ultimately depends upon your
  1372. switch. If the switch can reliably fail ports in response to other
  1373. failures, then either the MII or ARP monitors should work. For
  1374. example, in the above example, if the "port3" link fails at the remote
  1375. end, the MII monitor has no direct means to detect this. The ARP
  1376. monitor could be configured with a target at the remote end of port3,
  1377. thus detecting that failure without switch support.
  1378. In general, however, in a multiple switch topology, the ARP
  1379. monitor can provide a higher level of reliability in detecting end to
  1380. end connectivity failures (which may be caused by the failure of any
  1381. individual component to pass traffic for any reason). Additionally,
  1382. the ARP monitor should be configured with multiple targets (at least
  1383. one for each switch in the network). This will insure that,
  1384. regardless of which switch is active, the ARP monitor has a suitable
  1385. target to query.
  1386. Note, also, that of late many switches now support a functionality
  1387. generally referred to as "trunk failover." This is a feature of the
  1388. switch that causes the link state of a particular switch port to be set
  1389. down (or up) when the state of another switch port goes down (or up).
  1390. It's purpose is to propogate link failures from logically "exterior" ports
  1391. to the logically "interior" ports that bonding is able to monitor via
  1392. miimon. Availability and configuration for trunk failover varies by
  1393. switch, but this can be a viable alternative to the ARP monitor when using
  1394. suitable switches.
  1395. 12. Configuring Bonding for Maximum Throughput
  1396. ==============================================
  1397. 12.1 Maximizing Throughput in a Single Switch Topology
  1398. ------------------------------------------------------
  1399. In a single switch configuration, the best method to maximize
  1400. throughput depends upon the application and network environment. The
  1401. various load balancing modes each have strengths and weaknesses in
  1402. different environments, as detailed below.
  1403. For this discussion, we will break down the topologies into
  1404. two categories. Depending upon the destination of most traffic, we
  1405. categorize them into either "gatewayed" or "local" configurations.
  1406. In a gatewayed configuration, the "switch" is acting primarily
  1407. as a router, and the majority of traffic passes through this router to
  1408. other networks. An example would be the following:
  1409. +----------+ +----------+
  1410. | |eth0 port1| | to other networks
  1411. | Host A +---------------------+ router +------------------->
  1412. | +---------------------+ | Hosts B and C are out
  1413. | |eth1 port2| | here somewhere
  1414. +----------+ +----------+
  1415. The router may be a dedicated router device, or another host
  1416. acting as a gateway. For our discussion, the important point is that
  1417. the majority of traffic from Host A will pass through the router to
  1418. some other network before reaching its final destination.
  1419. In a gatewayed network configuration, although Host A may
  1420. communicate with many other systems, all of its traffic will be sent
  1421. and received via one other peer on the local network, the router.
  1422. Note that the case of two systems connected directly via
  1423. multiple physical links is, for purposes of configuring bonding, the
  1424. same as a gatewayed configuration. In that case, it happens that all
  1425. traffic is destined for the "gateway" itself, not some other network
  1426. beyond the gateway.
  1427. In a local configuration, the "switch" is acting primarily as
  1428. a switch, and the majority of traffic passes through this switch to
  1429. reach other stations on the same network. An example would be the
  1430. following:
  1431. +----------+ +----------+ +--------+
  1432. | |eth0 port1| +-------+ Host B |
  1433. | Host A +------------+ switch |port3 +--------+
  1434. | +------------+ | +--------+
  1435. | |eth1 port2| +------------------+ Host C |
  1436. +----------+ +----------+port4 +--------+
  1437. Again, the switch may be a dedicated switch device, or another
  1438. host acting as a gateway. For our discussion, the important point is
  1439. that the majority of traffic from Host A is destined for other hosts
  1440. on the same local network (Hosts B and C in the above example).
  1441. In summary, in a gatewayed configuration, traffic to and from
  1442. the bonded device will be to the same MAC level peer on the network
  1443. (the gateway itself, i.e., the router), regardless of its final
  1444. destination. In a local configuration, traffic flows directly to and
  1445. from the final destinations, thus, each destination (Host B, Host C)
  1446. will be addressed directly by their individual MAC addresses.
  1447. This distinction between a gatewayed and a local network
  1448. configuration is important because many of the load balancing modes
  1449. available use the MAC addresses of the local network source and
  1450. destination to make load balancing decisions. The behavior of each
  1451. mode is described below.
  1452. 12.1.1 MT Bonding Mode Selection for Single Switch Topology
  1453. -----------------------------------------------------------
  1454. This configuration is the easiest to set up and to understand,
  1455. although you will have to decide which bonding mode best suits your
  1456. needs. The trade offs for each mode are detailed below:
  1457. balance-rr: This mode is the only mode that will permit a single
  1458. TCP/IP connection to stripe traffic across multiple
  1459. interfaces. It is therefore the only mode that will allow a
  1460. single TCP/IP stream to utilize more than one interface's
  1461. worth of throughput. This comes at a cost, however: the
  1462. striping generally results in peer systems receiving packets out
  1463. of order, causing TCP/IP's congestion control system to kick
  1464. in, often by retransmitting segments.
  1465. It is possible to adjust TCP/IP's congestion limits by
  1466. altering the net.ipv4.tcp_reordering sysctl parameter. The
  1467. usual default value is 3, and the maximum useful value is 127.
  1468. For a four interface balance-rr bond, expect that a single
  1469. TCP/IP stream will utilize no more than approximately 2.3
  1470. interface's worth of throughput, even after adjusting
  1471. tcp_reordering.
  1472. Note that the fraction of packets that will be delivered out of
  1473. order is highly variable, and is unlikely to be zero. The level
  1474. of reordering depends upon a variety of factors, including the
  1475. networking interfaces, the switch, and the topology of the
  1476. configuration. Speaking in general terms, higher speed network
  1477. cards produce more reordering (due to factors such as packet
  1478. coalescing), and a "many to many" topology will reorder at a
  1479. higher rate than a "many slow to one fast" configuration.
  1480. Many switches do not support any modes that stripe traffic
  1481. (instead choosing a port based upon IP or MAC level addresses);
  1482. for those devices, traffic for a particular connection flowing
  1483. through the switch to a balance-rr bond will not utilize greater
  1484. than one interface's worth of bandwidth.
  1485. If you are utilizing protocols other than TCP/IP, UDP for
  1486. example, and your application can tolerate out of order
  1487. delivery, then this mode can allow for single stream datagram
  1488. performance that scales near linearly as interfaces are added
  1489. to the bond.
  1490. This mode requires the switch to have the appropriate ports
  1491. configured for "etherchannel" or "trunking."
  1492. active-backup: There is not much advantage in this network topology to
  1493. the active-backup mode, as the inactive backup devices are all
  1494. connected to the same peer as the primary. In this case, a
  1495. load balancing mode (with link monitoring) will provide the
  1496. same level of network availability, but with increased
  1497. available bandwidth. On the plus side, active-backup mode
  1498. does not require any configuration of the switch, so it may
  1499. have value if the hardware available does not support any of
  1500. the load balance modes.
  1501. balance-xor: This mode will limit traffic such that packets destined
  1502. for specific peers will always be sent over the same
  1503. interface. Since the destination is determined by the MAC
  1504. addresses involved, this mode works best in a "local" network
  1505. configuration (as described above), with destinations all on
  1506. the same local network. This mode is likely to be suboptimal
  1507. if all your traffic is passed through a single router (i.e., a
  1508. "gatewayed" network configuration, as described above).
  1509. As with balance-rr, the switch ports need to be configured for
  1510. "etherchannel" or "trunking."
  1511. broadcast: Like active-backup, there is not much advantage to this
  1512. mode in this type of network topology.
  1513. 802.3ad: This mode can be a good choice for this type of network
  1514. topology. The 802.3ad mode is an IEEE standard, so all peers
  1515. that implement 802.3ad should interoperate well. The 802.3ad
  1516. protocol includes automatic configuration of the aggregates,
  1517. so minimal manual configuration of the switch is needed
  1518. (typically only to designate that some set of devices is
  1519. available for 802.3ad). The 802.3ad standard also mandates
  1520. that frames be delivered in order (within certain limits), so
  1521. in general single connections will not see misordering of
  1522. packets. The 802.3ad mode does have some drawbacks: the
  1523. standard mandates that all devices in the aggregate operate at
  1524. the same speed and duplex. Also, as with all bonding load
  1525. balance modes other than balance-rr, no single connection will
  1526. be able to utilize more than a single interface's worth of
  1527. bandwidth.
  1528. Additionally, the linux bonding 802.3ad implementation
  1529. distributes traffic by peer (using an XOR of MAC addresses),
  1530. so in a "gatewayed" configuration, all outgoing traffic will
  1531. generally use the same device. Incoming traffic may also end
  1532. up on a single device, but that is dependent upon the
  1533. balancing policy of the peer's 8023.ad implementation. In a
  1534. "local" configuration, traffic will be distributed across the
  1535. devices in the bond.
  1536. Finally, the 802.3ad mode mandates the use of the MII monitor,
  1537. therefore, the ARP monitor is not available in this mode.
  1538. balance-tlb: The balance-tlb mode balances outgoing traffic by peer.
  1539. Since the balancing is done according to MAC address, in a
  1540. "gatewayed" configuration (as described above), this mode will
  1541. send all traffic across a single device. However, in a
  1542. "local" network configuration, this mode balances multiple
  1543. local network peers across devices in a vaguely intelligent
  1544. manner (not a simple XOR as in balance-xor or 802.3ad mode),
  1545. so that mathematically unlucky MAC addresses (i.e., ones that
  1546. XOR to the same value) will not all "bunch up" on a single
  1547. interface.
  1548. Unlike 802.3ad, interfaces may be of differing speeds, and no
  1549. special switch configuration is required. On the down side,
  1550. in this mode all incoming traffic arrives over a single
  1551. interface, this mode requires certain ethtool support in the
  1552. network device driver of the slave interfaces, and the ARP
  1553. monitor is not available.
  1554. balance-alb: This mode is everything that balance-tlb is, and more.
  1555. It has all of the features (and restrictions) of balance-tlb,
  1556. and will also balance incoming traffic from local network
  1557. peers (as described in the Bonding Module Options section,
  1558. above).
  1559. The only additional down side to this mode is that the network
  1560. device driver must support changing the hardware address while
  1561. the device is open.
  1562. 12.1.2 MT Link Monitoring for Single Switch Topology
  1563. ----------------------------------------------------
  1564. The choice of link monitoring may largely depend upon which
  1565. mode you choose to use. The more advanced load balancing modes do not
  1566. support the use of the ARP monitor, and are thus restricted to using
  1567. the MII monitor (which does not provide as high a level of end to end
  1568. assurance as the ARP monitor).
  1569. 12.2 Maximum Throughput in a Multiple Switch Topology
  1570. -----------------------------------------------------
  1571. Multiple switches may be utilized to optimize for throughput
  1572. when they are configured in parallel as part of an isolated network
  1573. between two or more systems, for example:
  1574. +-----------+
  1575. | Host A |
  1576. +-+---+---+-+
  1577. | | |
  1578. +--------+ | +---------+
  1579. | | |
  1580. +------+---+ +-----+----+ +-----+----+
  1581. | Switch A | | Switch B | | Switch C |
  1582. +------+---+ +-----+----+ +-----+----+
  1583. | | |
  1584. +--------+ | +---------+
  1585. | | |
  1586. +-+---+---+-+
  1587. | Host B |
  1588. +-----------+
  1589. In this configuration, the switches are isolated from one
  1590. another. One reason to employ a topology such as this is for an
  1591. isolated network with many hosts (a cluster configured for high
  1592. performance, for example), using multiple smaller switches can be more
  1593. cost effective than a single larger switch, e.g., on a network with 24
  1594. hosts, three 24 port switches can be significantly less expensive than
  1595. a single 72 port switch.
  1596. If access beyond the network is required, an individual host
  1597. can be equipped with an additional network device connected to an
  1598. external network; this host then additionally acts as a gateway.
  1599. 12.2.1 MT Bonding Mode Selection for Multiple Switch Topology
  1600. -------------------------------------------------------------
  1601. In actual practice, the bonding mode typically employed in
  1602. configurations of this type is balance-rr. Historically, in this
  1603. network configuration, the usual caveats about out of order packet
  1604. delivery are mitigated by the use of network adapters that do not do
  1605. any kind of packet coalescing (via the use of NAPI, or because the
  1606. device itself does not generate interrupts until some number of
  1607. packets has arrived). When employed in this fashion, the balance-rr
  1608. mode allows individual connections between two hosts to effectively
  1609. utilize greater than one interface's bandwidth.
  1610. 12.2.2 MT Link Monitoring for Multiple Switch Topology
  1611. ------------------------------------------------------
  1612. Again, in actual practice, the MII monitor is most often used
  1613. in this configuration, as performance is given preference over
  1614. availability. The ARP monitor will function in this topology, but its
  1615. advantages over the MII monitor are mitigated by the volume of probes
  1616. needed as the number of systems involved grows (remember that each
  1617. host in the network is configured with bonding).
  1618. 13. Switch Behavior Issues
  1619. ==========================
  1620. 13.1 Link Establishment and Failover Delays
  1621. -------------------------------------------
  1622. Some switches exhibit undesirable behavior with regard to the
  1623. timing of link up and down reporting by the switch.
  1624. First, when a link comes up, some switches may indicate that
  1625. the link is up (carrier available), but not pass traffic over the
  1626. interface for some period of time. This delay is typically due to
  1627. some type of autonegotiation or routing protocol, but may also occur
  1628. during switch initialization (e.g., during recovery after a switch
  1629. failure). If you find this to be a problem, specify an appropriate
  1630. value to the updelay bonding module option to delay the use of the
  1631. relevant interface(s).
  1632. Second, some switches may "bounce" the link state one or more
  1633. times while a link is changing state. This occurs most commonly while
  1634. the switch is initializing. Again, an appropriate updelay value may
  1635. help.
  1636. Note that when a bonding interface has no active links, the
  1637. driver will immediately reuse the first link that goes up, even if the
  1638. updelay parameter has been specified (the updelay is ignored in this
  1639. case). If there are slave interfaces waiting for the updelay timeout
  1640. to expire, the interface that first went into that state will be
  1641. immediately reused. This reduces down time of the network if the
  1642. value of updelay has been overestimated, and since this occurs only in
  1643. cases with no connectivity, there is no additional penalty for
  1644. ignoring the updelay.
  1645. In addition to the concerns about switch timings, if your
  1646. switches take a long time to go into backup mode, it may be desirable
  1647. to not activate a backup interface immediately after a link goes down.
  1648. Failover may be delayed via the downdelay bonding module option.
  1649. 13.2 Duplicated Incoming Packets
  1650. --------------------------------
  1651. NOTE: Starting with version 3.0.2, the bonding driver has logic to
  1652. suppress duplicate packets, which should largely eliminate this problem.
  1653. The following description is kept for reference.
  1654. It is not uncommon to observe a short burst of duplicated
  1655. traffic when the bonding device is first used, or after it has been
  1656. idle for some period of time. This is most easily observed by issuing
  1657. a "ping" to some other host on the network, and noticing that the
  1658. output from ping flags duplicates (typically one per slave).
  1659. For example, on a bond in active-backup mode with five slaves
  1660. all connected to one switch, the output may appear as follows:
  1661. # ping -n 10.0.4.2
  1662. PING 10.0.4.2 (10.0.4.2) from 10.0.3.10 : 56(84) bytes of data.
  1663. 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.7 ms
  1664. 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
  1665. 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
  1666. 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
  1667. 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!)
  1668. 64 bytes from 10.0.4.2: icmp_seq=2 ttl=64 time=0.216 ms
  1669. 64 bytes from 10.0.4.2: icmp_seq=3 ttl=64 time=0.267 ms
  1670. 64 bytes from 10.0.4.2: icmp_seq=4 ttl=64 time=0.222 ms
  1671. This is not due to an error in the bonding driver, rather, it
  1672. is a side effect of how many switches update their MAC forwarding
  1673. tables. Initially, the switch does not associate the MAC address in
  1674. the packet with a particular switch port, and so it may send the
  1675. traffic to all ports until its MAC forwarding table is updated. Since
  1676. the interfaces attached to the bond may occupy multiple ports on a
  1677. single switch, when the switch (temporarily) floods the traffic to all
  1678. ports, the bond device receives multiple copies of the same packet
  1679. (one per slave device).
  1680. The duplicated packet behavior is switch dependent, some
  1681. switches exhibit this, and some do not. On switches that display this
  1682. behavior, it can be induced by clearing the MAC forwarding table (on
  1683. most Cisco switches, the privileged command "clear mac address-table
  1684. dynamic" will accomplish this).
  1685. 14. Hardware Specific Considerations
  1686. ====================================
  1687. This section contains additional information for configuring
  1688. bonding on specific hardware platforms, or for interfacing bonding
  1689. with particular switches or other devices.
  1690. 14.1 IBM BladeCenter
  1691. --------------------
  1692. This applies to the JS20 and similar systems.
  1693. On the JS20 blades, the bonding driver supports only
  1694. balance-rr, active-backup, balance-tlb and balance-alb modes. This is
  1695. largely due to the network topology inside the BladeCenter, detailed
  1696. below.
  1697. JS20 network adapter information
  1698. --------------------------------
  1699. All JS20s come with two Broadcom Gigabit Ethernet ports
  1700. integrated on the planar (that's "motherboard" in IBM-speak). In the
  1701. BladeCenter chassis, the eth0 port of all JS20 blades is hard wired to
  1702. I/O Module #1; similarly, all eth1 ports are wired to I/O Module #2.
  1703. An add-on Broadcom daughter card can be installed on a JS20 to provide
  1704. two more Gigabit Ethernet ports. These ports, eth2 and eth3, are
  1705. wired to I/O Modules 3 and 4, respectively.
  1706. Each I/O Module may contain either a switch or a passthrough
  1707. module (which allows ports to be directly connected to an external
  1708. switch). Some bonding modes require a specific BladeCenter internal
  1709. network topology in order to function; these are detailed below.
  1710. Additional BladeCenter-specific networking information can be
  1711. found in two IBM Redbooks (www.ibm.com/redbooks):
  1712. "IBM eServer BladeCenter Networking Options"
  1713. "IBM eServer BladeCenter Layer 2-7 Network Switching"
  1714. BladeCenter networking configuration
  1715. ------------------------------------
  1716. Because a BladeCenter can be configured in a very large number
  1717. of ways, this discussion will be confined to describing basic
  1718. configurations.
  1719. Normally, Ethernet Switch Modules (ESMs) are used in I/O
  1720. modules 1 and 2. In this configuration, the eth0 and eth1 ports of a
  1721. JS20 will be connected to different internal switches (in the
  1722. respective I/O modules).
  1723. A passthrough module (OPM or CPM, optical or copper,
  1724. passthrough module) connects the I/O module directly to an external
  1725. switch. By using PMs in I/O module #1 and #2, the eth0 and eth1
  1726. interfaces of a JS20 can be redirected to the outside world and
  1727. connected to a common external switch.
  1728. Depending upon the mix of ESMs and PMs, the network will
  1729. appear to bonding as either a single switch topology (all PMs) or as a
  1730. multiple switch topology (one or more ESMs, zero or more PMs). It is
  1731. also possible to connect ESMs together, resulting in a configuration
  1732. much like the example in "High Availability in a Multiple Switch
  1733. Topology," above.
  1734. Requirements for specific modes
  1735. -------------------------------
  1736. The balance-rr mode requires the use of passthrough modules
  1737. for devices in the bond, all connected to an common external switch.
  1738. That switch must be configured for "etherchannel" or "trunking" on the
  1739. appropriate ports, as is usual for balance-rr.
  1740. The balance-alb and balance-tlb modes will function with
  1741. either switch modules or passthrough modules (or a mix). The only
  1742. specific requirement for these modes is that all network interfaces
  1743. must be able to reach all destinations for traffic sent over the
  1744. bonding device (i.e., the network must converge at some point outside
  1745. the BladeCenter).
  1746. The active-backup mode has no additional requirements.
  1747. Link monitoring issues
  1748. ----------------------
  1749. When an Ethernet Switch Module is in place, only the ARP
  1750. monitor will reliably detect link loss to an external switch. This is
  1751. nothing unusual, but examination of the BladeCenter cabinet would
  1752. suggest that the "external" network ports are the ethernet ports for
  1753. the system, when it fact there is a switch between these "external"
  1754. ports and the devices on the JS20 system itself. The MII monitor is
  1755. only able to detect link failures between the ESM and the JS20 system.
  1756. When a passthrough module is in place, the MII monitor does
  1757. detect failures to the "external" port, which is then directly
  1758. connected to the JS20 system.
  1759. Other concerns
  1760. --------------
  1761. The Serial Over LAN (SoL) link is established over the primary
  1762. ethernet (eth0) only, therefore, any loss of link to eth0 will result
  1763. in losing your SoL connection. It will not fail over with other
  1764. network traffic, as the SoL system is beyond the control of the
  1765. bonding driver.
  1766. It may be desirable to disable spanning tree on the switch
  1767. (either the internal Ethernet Switch Module, or an external switch) to
  1768. avoid fail-over delay issues when using bonding.
  1769. 15. Frequently Asked Questions
  1770. ==============================
  1771. 1. Is it SMP safe?
  1772. Yes. The old 2.0.xx channel bonding patch was not SMP safe.
  1773. The new driver was designed to be SMP safe from the start.
  1774. 2. What type of cards will work with it?
  1775. Any Ethernet type cards (you can even mix cards - a Intel
  1776. EtherExpress PRO/100 and a 3com 3c905b, for example). For most modes,
  1777. devices need not be of the same speed.
  1778. Starting with version 3.2.1, bonding also supports Infiniband
  1779. slaves in active-backup mode.
  1780. 3. How many bonding devices can I have?
  1781. There is no limit.
  1782. 4. How many slaves can a bonding device have?
  1783. This is limited only by the number of network interfaces Linux
  1784. supports and/or the number of network cards you can place in your
  1785. system.
  1786. 5. What happens when a slave link dies?
  1787. If link monitoring is enabled, then the failing device will be
  1788. disabled. The active-backup mode will fail over to a backup link, and
  1789. other modes will ignore the failed link. The link will continue to be
  1790. monitored, and should it recover, it will rejoin the bond (in whatever
  1791. manner is appropriate for the mode). See the sections on High
  1792. Availability and the documentation for each mode for additional
  1793. information.
  1794. Link monitoring can be enabled via either the miimon or
  1795. arp_interval parameters (described in the module parameters section,
  1796. above). In general, miimon monitors the carrier state as sensed by
  1797. the underlying network device, and the arp monitor (arp_interval)
  1798. monitors connectivity to another host on the local network.
  1799. If no link monitoring is configured, the bonding driver will
  1800. be unable to detect link failures, and will assume that all links are
  1801. always available. This will likely result in lost packets, and a
  1802. resulting degradation of performance. The precise performance loss
  1803. depends upon the bonding mode and network configuration.
  1804. 6. Can bonding be used for High Availability?
  1805. Yes. See the section on High Availability for details.
  1806. 7. Which switches/systems does it work with?
  1807. The full answer to this depends upon the desired mode.
  1808. In the basic balance modes (balance-rr and balance-xor), it
  1809. works with any system that supports etherchannel (also called
  1810. trunking). Most managed switches currently available have such
  1811. support, and many unmanaged switches as well.
  1812. The advanced balance modes (balance-tlb and balance-alb) do
  1813. not have special switch requirements, but do need device drivers that
  1814. support specific features (described in the appropriate section under
  1815. module parameters, above).
  1816. In 802.3ad mode, it works with systems that support IEEE
  1817. 802.3ad Dynamic Link Aggregation. Most managed and many unmanaged
  1818. switches currently available support 802.3ad.
  1819. The active-backup mode should work with any Layer-II switch.
  1820. 8. Where does a bonding device get its MAC address from?
  1821. When using slave devices that have fixed MAC addresses, or when
  1822. the fail_over_mac option is enabled, the bonding device's MAC address is
  1823. the MAC address of the active slave.
  1824. For other configurations, if not explicitly configured (with
  1825. ifconfig or ip link), the MAC address of the bonding device is taken from
  1826. its first slave device. This MAC address is then passed to all following
  1827. slaves and remains persistent (even if the first slave is removed) until
  1828. the bonding device is brought down or reconfigured.
  1829. If you wish to change the MAC address, you can set it with
  1830. ifconfig or ip link:
  1831. # ifconfig bond0 hw ether 00:11:22:33:44:55
  1832. # ip link set bond0 address 66:77:88:99:aa:bb
  1833. The MAC address can be also changed by bringing down/up the
  1834. device and then changing its slaves (or their order):
  1835. # ifconfig bond0 down ; modprobe -r bonding
  1836. # ifconfig bond0 .... up
  1837. # ifenslave bond0 eth...
  1838. This method will automatically take the address from the next
  1839. slave that is added.
  1840. To restore your slaves' MAC addresses, you need to detach them
  1841. from the bond (`ifenslave -d bond0 eth0'). The bonding driver will
  1842. then restore the MAC addresses that the slaves had before they were
  1843. enslaved.
  1844. 16. Resources and Links
  1845. =======================
  1846. The latest version of the bonding driver can be found in the latest
  1847. version of the linux kernel, found on http://kernel.org
  1848. The latest version of this document can be found in either the latest
  1849. kernel source (named Documentation/networking/bonding.txt), or on the
  1850. bonding sourceforge site:
  1851. http://www.sourceforge.net/projects/bonding
  1852. Discussions regarding the bonding driver take place primarily on the
  1853. bonding-devel mailing list, hosted at sourceforge.net. If you have
  1854. questions or problems, post them to the list. The list address is:
  1855. bonding-devel@lists.sourceforge.net
  1856. The administrative interface (to subscribe or unsubscribe) can
  1857. be found at:
  1858. https://lists.sourceforge.net/lists/listinfo/bonding-devel
  1859. Donald Becker's Ethernet Drivers and diag programs may be found at :
  1860. - http://www.scyld.com/network/
  1861. You will also find a lot of information regarding Ethernet, NWay, MII,
  1862. etc. at www.scyld.com.
  1863. -- END --