~ubuntu-branches/ubuntu/precise/ifenslave-2.6/precise

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
ifenslave for Debian
----------------------

The ifenslave program distributed with the Linux kernel sources has not always
been up to date, and several modified versions have been floating around. The
latest kernels now contain an updated version though.  The Debian package
ifenslave will now use the version found in the kernel, without any patches.

You can also enslave interfaces using Debian's /etc/network/interfaces file
by creating a stanza for the bonding interface and a stanza for each regular
interface that should be enslaved to the bonding master.

For a list of the supported bonding related options that can be used in
/etc/network/interfaces, see "List of bonding related options" below.

See also the examples directory for some common configurations.

--------------------------------------------------------------------------------

A bonding master is defined like this:

iface bond0 inet static
	address 208.77.188.166
	...
	bond_slaves none

The bonding slaves should then be defined like this:

auto eth0
iface eth0 inet manual
	bond-master bond0
	bond-primary eth0 eth1

auto eth1
iface eth1 inet manual
	bond-master bond0
	bond-primary eth0 eth1

Previous versions of the package supported specifying the slaves all in the
stanza for the bonding interface, using the "bond_slaves" option.  However,
in such a configuration there is a race condition between bringing up the
hardware driver for the ethernet devices and attempting to bring up the
bonded interface; the bonding interface needs to be initiated from the slave
interfaces instead.

You can set additional bonding options by adding them to the interface
section:

	bond_mode    active-backup
	bond_primary eth0

This would run the bonding device in active backup mode with eth0 as primary.

If the master interface is not available at the time the first slave is setup,
it will be created and setup according to bond_* options in the *slave* stanza.
For this reason, in order to get consistent results, the values of all the
bond_* options should normally be identical in the master stanza and in all the
possible slave stanzas. However, there exists some good reasons to have
different options in different stanza, for example, to change the primary slave
when hotpluging a new slave.

Using ifup on a master interface will call ifup for all slaves that are
flagged with allow-bondX. (bondX being replaced by the master interface
name). This will allow for extra setup for special slave interfaces.

Using ifdown on a master interface will cause all slaves to be freed and
disabled. The master is also cleaned-up to ensure reliable results if the
master is brought up later.

Using ifup on a slave interface will bring the master interface up if not already
up, but without calling ifup for the master interface, to avoid an infinite loop.

Using ifdown on a slave interface will cause this interface to be freed but
won't change the master in any other way.

--------------------------------------------------------------------------------
List of bonding related options.
--------------------------------------------------------------------------------

The following is the list of bond-* options that can be used in a stanza in
/etc/network/interfaces. For a more general description of the interfaces file,
read the man for interfaces(5).

Most of these options are used to write into bonding related files in some
subdirectories of /sys.

For the expected effects of writing into bonding related /sys files, please read
the bonding documentation (Documentation/networking/bonding.txt) in the linux
Kernel source tree.

If you think that a bond-* option should exist to write into a bonding related
*writable* file in /sys, but no bond-* option exists for that, please report a
bug on the ifenslave-2.6 package.

Last checked for kernel version 2.6.35-rc1.

* bond-active-slave:
	Write into /sys/class/net/<bond>/bonding/active_slave
	Also force the slave to be up.

* bond-ad-select:
	Write into /sys/class/net/<bond>/bonding/ad_select

* bond-arp-interval:
	Write into /sys/class/net/<bond>/bonding/arp_interval
	One of bond-miimon or bond-arp-interval should be given, otherwise,
	bonding wont detect link failure. If using bond-arp-interval,
	bond-arp-ip-target must also be used.
	If both bond-arp-interval and bond-miimon options are given,
	bond-arp-interval will be ignored.

* bond-arp-ip-target:
	Write into /sys/class/net/<bond>/bonding/arp_ip_target
	Several IP addresses can be given to bond-arp-ip-target.
	You must not add a + sign in front of the target ip addresses.

* bond-arp-validate:
	Write into /sys/class/net/<bond>/bonding/arp_validate

* bond-downdelay:
	Write into /sys/class/net/<bond>/bonding/downdelay

* bond-fail-over-mac:
	Write into /sys/class/net/<bond>/bonding/fail_over_mac

* bond-give-a-chance:
	This option is designed to workaround a bug in wpa_supplicant, when used with
	bonding:
	With some version of the Linux Kernel, one must use the -b option of
	wpa_supplicant to tell wpa_supplicant that it must expect wifi authentication
	packets on the master interface. This is required because until recently
	(2.6.30 ?) it was not possible to receive a packet on a slave interface.
	Unfortunately, this -b option has the side effect of also *sending* wifi
	authentication packets on the master interface.  If the active interface is
	not the wifi interface at the time wpa_supplicant tries to authenticate, the
	wifi AP won't receive anything, causing the authentication to fail.

	If the option bond-give-a-chance is set for a slave interface, then this
	interface will be forced to be the primary (and so active) interface for the
	given number of seconds or until the wifi link is up, whichever comes first.
	This will give a chance for the wifi authentication to succeed, hence the name
	of the option.

	You should use the bond-give-a-chance option if you also use the wpa-bridge
	option from wpasupplicant package, that set the -b option of wpa_supplicant.

	If you don't use the wap-bridge option, you probably don't need the
	bond-give-a-chance option.

* bond-lacp-rate:
	Write into /sys/class/net/<bond>/bonding/lacp_rate

* bond-master:
	Write into /sys/class/net/<bond>/bonding/slaves
	The bond-master option is used in slave stanza, to give the name of
	the master (bonding) interface to which this slave should be enslaved.
	One of bond-master or bond-slaves must be given for all other bond-*
	options to have any effect.
	If both bond-master and bond-slaves options are given, bond-slaves will
	be ignored.

* bond-miimon:
	Write into /sys/class/net/<bond>/bonding/miimon
	One of bond-miimon or bond-arp-interval should be given, otherwise,
	bonding wont detect link failure.

* bond-mode:
	Write into /sys/class/net/<bond>/bonding/mode

* bond-num-grat-arp:
	Write into /sys/class/net/<bond>/bonding/num_grat_arp

* bond-num-unsol-na:
	Write into /sys/class/net/<bond>/bonding/num_unsol_na

* bond-primary:
	Write into /sys/class/net/<bond>/bonding/primary
	Several interfaces can be given to bond-primary. The first interface
	that is found to be enslaved would become the primary. If no slave
	in bond-primary is found, then primary does not change.
	You must not add a + sign in front of the slave interface names.

* bond-primary-reselect:
	Write into /sys/class/net/<bond>/bonding/primary_reselect

* bond-queue-id:
	Write into /sys/class/net/<bond>/bonding/queue_id
	Several <interface>:<queue_id> pairs can be given to bond-queue-id,
	separated by space.

* bond-slaves:
	Write into /sys/class/net/<bond>/bonding/slaves
	The bond-master option is used in master stanza, to give the names of
	the slave interfaces to enslave to this master (bonding) interface.
	One of bond-master or bond-slaves must be given for all other bond-*
	options to have any effect.
	If both bond-master and bond-slaves options are given, bond-slaves will
	be ignored.
	You must not add a + sign in front of the slave interface names.

* bond-updelay:
	Write into /sys/class/net/<bond>/bonding/updelay

* bond-use-carrier:
	Write into /sys/class/net/<bond>/bonding/use_carrier

* bond-xmit_hash_policy:
	Write into /sys/class/net/<bond>/bonding/xmit_hash_policy

--------------------------------------------------------------------------------

The following files in /sys/class/net/bond*/bonding are read-only, so no
corresponding bond-* option exists to write into them.

* ad_actor_key
* ad_aggregator
* ad_num_ports
* ad_partner_key
* ad_partner_mac
* mii_status

Please report a bug on package ifenslave-2.6, if one of them happens to become
writable but no corresponding bond-* option exist.

--------------------------------------------------------------------------------

Guus Sliepen <guus@debian.org>, Tue, 17 Mar 2009 18:33:43 +0100
Nicolas de Pesloüan <nicolas.2p.debian@free.fr>, Sun, 19 Dec 2010 19:00:00 +0100