Configure multi-nic aggregation (bonding) in CentOS)

Source: Internet
Author: User

Configure multi-nic aggregation (bonding) in CentOS)
Some applications may have the biggest bottleneck in network data transmission (such as diskless network systems in some places). To solve this bottleneck, the convergence technology of multiple network cards is amazing here, aggregation can be understood as the combination of multiple NICs into a parallel logical Nic, And the transmitted traffic is the sum of these NICs (of course, it depends on your Nic aggregation Mode)

There are 7 clustering modes in Linux, the most common ones are 0, 1, and 6. We mainly introduce these three modes:
0 (balance-rr) is also the round robin (RR) mode, it is very familiar with the contact ipvs, the traffic of each network card in this mode is almost equal. Vswitch support is required.
1 (active-backup) redundancy mode, that is, only one network card is working. When a work network card fails, it is immediately replaced. It is mostly used in high-availability environments.
6 (balance-alb) Adaptive Load, send the packet to transfer the first network card, if full, the remaining two, and so on.

1. enable the system to boot the bonding kernel and specify its working mode.
 

[Root @ vqiu ~] # Vi/etc/modprobe. d/bonding. conf alias bond0 bonding opentions bond0 miimon = 100 mode = [, 6]

2. Edit the NIC (pay attention to the red part)
 

[Root @ vqiu ~] # Vi/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0 TYPE = Ethernet ONBOOT = yes NM_CONTROLLED = yes USERCTL = no SLAVE 6init = no MASTER = bond0 SLAVE = yes

[root@vqiu ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1DEVICE=eth1TYPE=EthernetONBOOT=yesNM_CONTROLLED=yesUSERCTL=noIPV6INIT=noMASTER=bond0SLAVE=yes

 

[Root @ vqiu ~] # Vi/etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE = bond0 NAME = bond0 TYPE = Ethernet ONBOOT = yes BOOTPROTO = static USERCTL = no route 6init = no IPADDR = 10.0.2.15 PREFIX = 24 GATEWAY = 10.0.2.2 DNS1 = 8.8.8.8 DNS1 = 8.8.4.4

3. restart the system to view the traffic of each Nic [root @ vqiu ~] # Netstat-I | grep-v 'lo' Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP Flg bond0 1500 0 3301 0 0 3278 0 0 0 BMmRU eth0 1500 0 2248 0 0 0 2192 0 0 0 0 BMsRU eth1 1500 0 1053 0 0 1086 0 0 0 BMsU

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.