⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bonding.txt

📁 Linux Kernel 2.6.9 for OMAP1710
💻 TXT
📖 第 1 页 / 共 3 页
字号:
	  # ifconfig bond0 .... up	  # ifenslave bond0 eth...	This method will automatically take the address from the next slave	that will be added.	To restore your slaves' MAC addresses, you need to detach them	from the bond (`ifenslave -d bond0 eth0'). The bonding driver will then	restore the MAC addresses that the slaves had before they were enslaved.9.  Which transmit polices can be used?	Round-robin, based on the order of enslaving, the output device	is selected base on the next available slave. Regardless of	the source and/or destination of the packet.	Active-backup policy that ensures that one and only one device will	transmit at any given moment. Active-backup policy is useful for	implementing high availability solutions using two hubs (see	section on High Availability).	XOR, based on (src hw addr XOR dst hw addr) % slave count. This	policy selects the same slave for each destination hw address.	Broadcast policy transmits everything on all slave interfaces.	802.3ad, based on XOR but distributes traffic among all interfaces	in the active aggregator.	Transmit load balancing (balance-tlb) balances the traffic	according to the current load on each slave. The balancing is	clients based and the least loaded slave is selected for each new	client. The load of each slave is calculated relative to its speed	and enables load balancing in mixed speed teams.	Adaptive load balancing (balance-alb) uses the Transmit load	balancing for the transmit load. The receive load is balanced only	among the group of highest speed active slaves in the bond. The	load is distributed with round-robin i.e. next available slave in	the high speed group of active slaves.High Availability=================To implement high availability using the bonding driver, the driver needs to becompiled as a module, because currently it is the only way to pass parametersto the driver. This may change in the future.High availability is achieved by using MII or ETHTOOL status reporting. Youneed to verify that all your interfaces support MII or ETHTOOL link statusreporting.  On Linux kernel 2.2.17, all the 100 Mbps capable drivers andyellowfin gigabit driver support MII. To determine if ETHTOOL link reportingis available for interface eth0, type "ethtool eth0" and the "Link detected:"line should contain the correct link status. If your system has an interfacethat does not support MII or ETHTOOL status reporting, a failure of its linkwill not be detected! A message indicating MII and ETHTOOL is not supported bya network driver is logged when the bonding driver is loaded with a non-zeromiimon value.The bonding driver can regularly check all its slaves links using the ETHTOOLIOCTL (ETHTOOL_GLINK command) or by checking the MII status registers. Thecheck interval is specified by the module argument "miimon" (MII monitoring).It takes an integer that represents the checking time in milliseconds. Itshould not come to close to (1000/HZ) (10 milli-seconds on i386) because itmay then reduce the system interactivity. A value of 100 seems to be a goodstarting point. It means that a dead link will be detected at most 100milli-seconds after it goes down.Example:   # modprobe bonding miimon=100Or, put the following line in /etc/modprobe.conf:   options bond0 miimon=100There are currently two policies for high availability. They are dependent onwhether:   a) hosts are connected to a single host or switch that support trunking   b) hosts are connected to several different switches or a single switch that      does not support trunking1) High Availability on a single switch or host - load balancing----------------------------------------------------------------It is the easiest to set up and to understand. Simply configure theremote equipment (host or switch) to aggregate traffic over severalports (Trunk, EtherChannel, etc.) and configure the bonding interfaces.If the module has been loaded with the proper MII option, it will workautomatically. You can then try to remove and restore different linksand see in your logs what the driver detects. When testing, you mayencounter problems on some buggy switches that disable the trunk for along time if all ports in a trunk go down. This is not Linux, but reallythe switch (reboot it to ensure).Example 1 : host to host at twice the speed          +----------+                          +----------+          |          |eth0                  eth0|          |          | Host A   +--------------------------+  Host B  |          |          +--------------------------+          |          |          |eth1                  eth1|          |          +----------+                          +----------+  On each host :     # modprobe bonding miimon=100     # ifconfig bond0 addr     # ifenslave bond0 eth0 eth1Example 2 : host to switch at twice the speed          +----------+                          +----------+          |          |eth0                 port1|          |          | Host A   +--------------------------+  switch  |          |          +--------------------------+          |          |          |eth1                 port2|          |          +----------+                          +----------+  On host A :                             On the switch :     # modprobe bonding miimon=100           # set up a trunk on port1     # ifconfig bond0 addr                     and port2     # ifenslave bond0 eth0 eth12) High Availability on two or more switches (or a single switch without   trunking support)---------------------------------------------------------------------------This mode is more problematic because it relies on the fact that thereare multiple ports and the host's MAC address should be visible on oneport only to avoid confusing the switches.If you need to know which interface is the active one, and which ones arebackup, use ifconfig. All backup interfaces have the NOARP flag set.To use this mode, pass "mode=1" to the module at load time :    # modprobe bonding miimon=100 mode=active-backup	or:    # modprobe bonding miimon=100 mode=1Or, put in your /etc/modprobe.conf :    options bond0 miimon=100 mode=active-backupExample 1: Using multiple host and multiple switches to build a "no singlepoint of failure" solution.                |                                     |                |port3                           port3|          +-----+----+                          +-----+----+          |          |port7       ISL      port7|          |          | switch A +--------------------------+ switch B |          |          +--------------------------+          |          |          |port8                port8|          |          +----++----+                          +-----++---+          port2||port1                           port1||port2               ||             +-------+               ||               |+-------------+ host1 +---------------+|               |         eth0 +-------+ eth1           |               |                                       |               |              +-------+                |               +--------------+ host2 +----------------+                         eth0 +-------+ eth1In this configuration, there is an ISL - Inter Switch Link (could be a trunk),several servers (host1, host2 ...) attached to both switches each, and one ormore ports to the outside world (port3...). One and only one slave on each hostis active at a time, while all links are still monitored (the system candetect a failure of active and backup links).Each time a host changes its active interface, it sticks to the new one untilit goes down. In this example, the hosts are negligibly affected by theexpiration time of the switches' forwarding tables.If host1 and host2 have the same functionality and are used in load balancingby another external mechanism, it is good to have host1's active interfaceconnected to one switch and host2's to the other. Such system will survivea failure of a single host, cable, or switch. The worst thing that may happenin the case of a switch failure is that half of the hosts will be temporarilyunreachable until the other switch expires its tables.Example 2: Using multiple ethernet cards connected to a switch to configure           NIC failover (switch is not required to support trunking).          +----------+                          +----------+          |          |eth0                 port1|          |          | Host A   +--------------------------+  switch  |          |          +--------------------------+          |          |          |eth1                 port2|          |          +----------+                          +----------+  On host A :                                 On the switch :     # modprobe bonding miimon=100 mode=1     # (optional) minimize the time     # ifconfig bond0 addr                    # for table expiration     # ifenslave bond0 eth0 eth1Each time the host changes its active interface, it sticks to the new one untilit goes down. In this example, the host is strongly affected by the expirationtime of the switch forwarding table.3) Adapting to your switches' timing------------------------------------If your switches take a long time to go into backup mode, it may bedesirable not to activate a backup interface immediately after a link goesdown. It is possible to delay the moment at which a link will becompletely disabled by passing the module parameter "downdelay" (inmilliseconds, must be a multiple of miimon).When a switch reboots, it is possible that its ports report "link up" statusbefore they become usable. This could fool a bond device by causing it touse some ports that are not ready yet. It is possible to delay the moment atwhich an active link will be reused by passing the module parameter "updelay"(in milliseconds, must be a multiple of miimon).A similar situation can occur when a host re-negotiates a lost link with theswitch (a case of cable replacement).A special case is when a bonding interface has lost all slave links. Then thedriver will immediately reuse the first link that goes up, even if updelayparameter was specified. (If there are slave interfaces in the "updelay" state,the interface that first went into that state will be immediately reused.) Thisallows to reduce down-time if the value of updelay has been overestimated.Examples :    # modprobe bonding miimon=100 mode=1 downdelay=2000 updelay=5000    # modprobe bonding miimon=100 mode=balance-rr downdelay=0 updelay=5000Promiscuous Sniffing notes==========================If you wish to bond channels together for a network sniffingapplication --- you wish to run tcpdump, or ethereal, or an IDS likesnort, with its input aggregated from multiple interfaces using thebonding driver --- then you need to handle the Promiscuous interfacesetting by hand. Specifically, when you "ifconfing bond0 up" youmust add the promisc flag there; it will be propagated down to theslave interfaces at ifenslave time; a full example might look like:   ifconfig bond0 promisc up   for if in eth1 eth2 ...;do       ifconfig $if up       ifenslave bond0 $if   done   snort ... -i bond0 ...Ifenslave also wants to propagate addresses from interface tointerface, appropriately for its design functions in HA and channelcapacity aggregating; but it works fine for unnumbered interfaces;just ignore all the warnings it emits.8021q VLAN support==================It is possible to configure VLAN devices over a bond interface using the 8021qdriver. However, only packets coming from the 8021q driver and passing throughbonding will be tagged by default. Self generated packets, like bonding'slearning packets or ARP packets generated by either ALB mode or the ARPmonitor mechanism, are tagged internally by bonding itself. As a result,bonding has to "learn" what VLAN IDs are configured on top of it, and it usesthose IDs to tag self generated packets.For simplicity reasons, and to support the use of adapters that can do VLANhardware acceleration offloding, the bonding interface declares itself asfully hardware offloaing capable, it gets the add_vid/kill_vid notificationsto gather the necessary information, and it propagates those actions to theslaves.In case of mixed adapter types, hardware accelerated tagged packets that shouldgo through an adapter that is not offloading capable are "un-accelerated" by thebonding driver so the VLAN tag sits in the regular location.VLAN interfaces *must* be added on top of a bonding interface only afterenslaving at least one slave. This is because until the first slave is added thebonding interface has a HW address of 00:00:00:00:00:00, which will be copied bythe VLAN interface when it is created.Notice that a problem would occur if all slaves are released from a bond thatstill has VLAN interfaces on top of it. When later coming to add new slaves, thebonding interface would get a HW address from the first slave, which might notmatch that of the VLAN interfaces. It is recommended that either all VLANs areremoved and then re-added, or to manually set the bonding interface's HWaddress so it matches the VLAN's. (Note: changing a VLAN interface's HW addresswould set the underlying device -- i.e. the bonding interface -- to promiscouosmode, which might not be what you want).Limitations===========The main limitations are :  - only the link status is monitored. If the switch on the other side is    partially down (e.g. doesn't forward anymore, but the link is OK), the link    won't be disabled. Another way to check for a dead link could be to count    incoming frames on a heavily loaded host. This is not applicable to small    servers, but may be useful when the front switches send multicast    information on their links (e.g. VRRP), or even health-check the servers.    Use the arp_interval/arp_ip_target parameters to count incoming/outgoing    frames.Resources and Links===================Current development on this driver is posted to: - http://www.sourceforge.net/projects/bonding/Donald Becker's Ethernet Drivers and diag programs may be found at : - http://www.scyld.com/network/You will also find a lot of information regarding Ethernet, NWay, MII, etc. atwww.scyld.com.Patches for 2.2 kernels are at Willy Tarreau's site : - http://wtarreau.free.fr/pub/bonding/ - http://www-miaif.lip6.fr/~tarreau/pub/bonding/To get latest informations about Linux Kernel development, please consultthe Linux Kernel Mailing List Archives at :   http://www.ussg.iu.edu/hypermail/linux/kernel/-- END --

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -