bonding.rst 114 KB

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