diff options
Diffstat (limited to 'Documentation/networking/bonding.txt')
-rw-r--r-- | Documentation/networking/bonding.txt | 84 |
1 files changed, 82 insertions, 2 deletions
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 61f516b135b4..d0914781830e 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -49,6 +49,7 @@ Table of Contents | |||
49 | 3.3 Configuring Bonding Manually with Ifenslave | 49 | 3.3 Configuring Bonding Manually with Ifenslave |
50 | 3.3.1 Configuring Multiple Bonds Manually | 50 | 3.3.1 Configuring Multiple Bonds Manually |
51 | 3.4 Configuring Bonding Manually via Sysfs | 51 | 3.4 Configuring Bonding Manually via Sysfs |
52 | 3.5 Overriding Configuration for Special Cases | ||
52 | 53 | ||
53 | 4. Querying Bonding Configuration | 54 | 4. Querying Bonding Configuration |
54 | 4.1 Bonding Configuration | 55 | 4.1 Bonding Configuration |
@@ -1318,8 +1319,87 @@ echo 2000 > /sys/class/net/bond1/bonding/arp_interval | |||
1318 | echo +eth2 > /sys/class/net/bond1/bonding/slaves | 1319 | echo +eth2 > /sys/class/net/bond1/bonding/slaves |
1319 | echo +eth3 > /sys/class/net/bond1/bonding/slaves | 1320 | echo +eth3 > /sys/class/net/bond1/bonding/slaves |
1320 | 1321 | ||
1321 | 1322 | 3.5 Overriding Configuration for Special Cases | |
1322 | 4. Querying Bonding Configuration | 1323 | ---------------------------------------------- |
1324 | When using the bonding driver, the physical port which transmits a frame is | ||
1325 | typically selected by the bonding driver, and is not relevant to the user or | ||
1326 | system administrator. The output port is simply selected using the policies of | ||
1327 | the selected bonding mode. On occasion however, it is helpful to direct certain | ||
1328 | classes of traffic to certain physical interfaces on output to implement | ||
1329 | slightly more complex policies. For example, to reach a web server over a | ||
1330 | bonded interface in which eth0 connects to a private network, while eth1 | ||
1331 | connects via a public network, it may be desirous to bias the bond to send said | ||
1332 | traffic over eth0 first, using eth1 only as a fall back, while all other traffic | ||
1333 | can safely be sent over either interface. Such configurations may be achieved | ||
1334 | using the traffic control utilities inherent in linux. | ||
1335 | |||
1336 | By default the bonding driver is multiqueue aware and 16 queues are created | ||
1337 | when the driver initializes (see Documentation/networking/multiqueue.txt | ||
1338 | for details). If more or less queues are desired the module parameter | ||
1339 | tx_queues can be used to change this value. There is no sysfs parameter | ||
1340 | available as the allocation is done at module init time. | ||
1341 | |||
1342 | The output of the file /proc/net/bonding/bondX has changed so the output Queue | ||
1343 | ID is now printed for each slave: | ||
1344 | |||
1345 | Bonding Mode: fault-tolerance (active-backup) | ||
1346 | Primary Slave: None | ||
1347 | Currently Active Slave: eth0 | ||
1348 | MII Status: up | ||
1349 | MII Polling Interval (ms): 0 | ||
1350 | Up Delay (ms): 0 | ||
1351 | Down Delay (ms): 0 | ||
1352 | |||
1353 | Slave Interface: eth0 | ||
1354 | MII Status: up | ||
1355 | Link Failure Count: 0 | ||
1356 | Permanent HW addr: 00:1a:a0:12:8f:cb | ||
1357 | Slave queue ID: 0 | ||
1358 | |||
1359 | Slave Interface: eth1 | ||
1360 | MII Status: up | ||
1361 | Link Failure Count: 0 | ||
1362 | Permanent HW addr: 00:1a:a0:12:8f:cc | ||
1363 | Slave queue ID: 2 | ||
1364 | |||
1365 | The queue_id for a slave can be set using the command: | ||
1366 | |||
1367 | # echo "eth1:2" > /sys/class/net/bond0/bonding/queue_id | ||
1368 | |||
1369 | Any interface that needs a queue_id set should set it with multiple calls | ||
1370 | like the one above until proper priorities are set for all interfaces. On | ||
1371 | distributions that allow configuration via initscripts, multiple 'queue_id' | ||
1372 | arguments can be added to BONDING_OPTS to set all needed slave queues. | ||
1373 | |||
1374 | These queue id's can be used in conjunction with the tc utility to configure | ||
1375 | a multiqueue qdisc and filters to bias certain traffic to transmit on certain | ||
1376 | slave devices. For instance, say we wanted, in the above configuration to | ||
1377 | force all traffic bound to 192.168.1.100 to use eth1 in the bond as its output | ||
1378 | device. The following commands would accomplish this: | ||
1379 | |||
1380 | # tc qdisc add dev bond0 handle 1 root multiq | ||
1381 | |||
1382 | # tc filter add dev bond0 protocol ip parent 1: prio 1 u32 match ip dst \ | ||
1383 | 192.168.1.100 action skbedit queue_mapping 2 | ||
1384 | |||
1385 | These commands tell the kernel to attach a multiqueue queue discipline to the | ||
1386 | bond0 interface and filter traffic enqueued to it, such that packets with a dst | ||
1387 | ip of 192.168.1.100 have their output queue mapping value overwritten to 2. | ||
1388 | This value is then passed into the driver, causing the normal output path | ||
1389 | selection policy to be overridden, selecting instead qid 2, which maps to eth1. | ||
1390 | |||
1391 | Note that qid values begin at 1. Qid 0 is reserved to initiate to the driver | ||
1392 | that normal output policy selection should take place. One benefit to simply | ||
1393 | leaving the qid for a slave to 0 is the multiqueue awareness in the bonding | ||
1394 | driver that is now present. This awareness allows tc filters to be placed on | ||
1395 | slave devices as well as bond devices and the bonding driver will simply act as | ||
1396 | a pass-through for selecting output queues on the slave device rather than | ||
1397 | output port selection. | ||
1398 | |||
1399 | This feature first appeared in bonding driver version 3.7.0 and support for | ||
1400 | output slave selection was limited to round-robin and active-backup modes. | ||
1401 | |||
1402 | 4 Querying Bonding Configuration | ||
1323 | ================================= | 1403 | ================================= |
1324 | 1404 | ||
1325 | 4.1 Bonding Configuration | 1405 | 4.1 Bonding Configuration |