Ubuntu multi-Network port binding bond

Source: Internet
Author: User

Http://www.cnblogs.com/khldragon/p/3642367.html

http://my.oschina.net/zphj1987/blog/77890

Http://www.linuxidc.com/Linux/2011-01/31048.htm

Official Document: Https://www.kernel.org/doc/Documentation/networking/bonding.txt

http://blog.csdn.net/fyang2007/article/details/5964357 MII (Media independent Interface (medium Independent interface);

http://blog.chinaunix.net/uid-49097-id-78251.html Linux Bonding Model Chinese Manual

What is bonding

The Linux bonding driver provides a bundle of multiple network interface devices into a single network interface setting for Network Load Balancing and network redundancy.
Bonding mode of operation

Bonding There are 7 different modes of operation

0: (BALANCE-RR) round-robin policy: (Balanced polling strategy): The transmit packet order is transmitted sequentially until the last transmission is complete, which provides load balancing and fault tolerance.
1: (active-backup) active-backup policy: (Active backup policy): Only one device is active. One goes down and the other immediately transforms the primary device from the backup. The MAC address is externally visible. This mode provides fault tolerance.
2: (Balance-xor) XOR policy: (Balanced strategy): transmits a transmission device based on a Boolean value [(Source MAC address Xor destination MAC address) mod device number]. This mode provides load balancing and fault tolerance.
3: (broadcast) broadcast policy: (Broadcast policy): Transfers all packets to all devices. This mode provides fault tolerance.
4: (802.3AD) IEEE 802.3ad Dynamic link aggregation. IEEE 802.3ad Dynamic Link aggregation: Create an aggregation group that shares the same speed and duplex settings. This mode provides fault tolerance. Each device requires drive-based re-acquisition speed and full-duplex support, and if the switch is used, the switch also needs to enable 802.3AD mode.
5: (balance-tlb) Adaptive Transmit load balancing (adapter transport load balancer): Channel bindings do not require dedicated switch support. The traffic emitted is assigned to each device according to the current load. Received by the current device, if the accepted device does not pass, use another device to take over the MAC address that the current device is processing.
6: (BALANCE-ALB) Adaptive load Balancing: (Adapter Load Balancer): Includes MODE5, the payload that is received by the ARP negotiation. The bonding driver intercepts the request sent by ARP on the local system, overwriting the original address of the subordinate device with one of the hardware addresses. It's like a different person on the server using a different hardware address.

1. Install the software

Ifenslave is a bonded and decoupled software that effectively distributes packets to the bonding driver.

Apt-get Install Ifenslave

2, modify the configuration file, according to their own needs to modify.

Vi/etc/network/interfaces
 
# This file describes the network interfaces available on your system # and what to
ACTI Vate them. For more information, see Interfaces (5).
 
# The Loopback network interface
Auto lo
iface lo inet loopback
 
#注释掉原来的eth0, eth1 configuration
# The primary network I Nterface
#auto eth0
#iface eth0 inet dhcp
 
#auto eth1
#iface eth1 inet DHCP
 
#这里配置模式为轮询策略, the pattern code is 0, The polling interval is 100ms (milliseconds). Up
ifenslave bond0 eth0 eth1 down
ifenslave bond0-d eth0 eth1
bond-mode 0
Bond-miimon
 
#配置b Ond ip
auto bond0
iface bond0 inet static
address 192.168.0.201
netmask 255.255.255.0
Gateway 192.168.0.1
 
#配置bond的虚拟IP (not required)
auto bond0:1
iface bond0:1 inet static
address 192.168.1.201
netmask 255.255.255.0
Gateway 192.168.1.1
3. Load Bonding Module
sudo gedit/etc/modules
bonding
4, restart the computer, if successful, bond0, eth0, eth1 MAC address will become the original Eth0 Mac.
sudo shutdown-r now

5. View bonding Status

Cat/proc/net/bonding/bond0

can also be viewed with ifconfig.

Executive wrote/etc/init.d/networking restart

When you are done, you can also check the status of bonding

Wrote root@132:/etc/network# cat/proc/net/bonding/bond0
Ethernet Channel Bonding driver:v3.7.1 (April 27, 2011)

Bonding mode:load Balancing (round-robin)
MII Status:up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface:eth0
MII Status:up
speed:100 Mbps
Duplex:full
Link Failure count:0
Permanent HW ADDR:00:10:5C:EF:B2:A2
Slave Queue id:0

Slave interface:eth1
MII Status:up
speed:1000 Mbps
Duplex:full
Link Failure count:0
Permanent HW Addr:00:10:5c:ef:b2:a3
Slave Queue id:0


Reference documents:

1, http://blog.csdn.net/sven_007/article/details/7744416

2, http://www.mike.org.cn/articles/ubuntu-nic-balancing/



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.