Dual NIC bindings under CentOS

Source: Internet
Author: User

Servers such as streaming media use a single network card load is too high, may cause a picture of the situation, in order to alleviate network pressure, special dual-NIC binding.

Here we bind 2 1GB of network card, so that its bandwidth reaches 2GB, thus reducing network congestion.


1. Modify the/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ETH0/1 configuration document with the following contents:

Bootproto=none Onboot=yes master=bond0 Slave=yes


2. Create a binding network port configuration document/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-BOND0, which reads as follows:

Device=bond0bootproto=static ipaddr=52.110.1.2netmask=255.255.255.0gateway=52.110.1.1boradcast= 52.110.1.255onboot=yestype=ethernet


3. Modify/etc/modprobe.d/dist.conf, configure the binding model, and finally add the following to the configuration file:

Alias Bond0 bondingoptions bond0 miimon=100 mode=0

#选项 Millmon is the specified interval for how long the link is monitored, in Ms.

#选项 mode is the operating mode of the binding port, there are 0-7 total 7 modes, commonly used in 0 and 1 mode, mode=0 means "round-robin" strategy, two cards work simultaneously in load balancing state. The mode=1 represents the "active-backup" policy, and the backup status of the two cards is one with one standby.


4. Modify the/etc/rc.local, which is responsible for binding the virtual network card and two physical network card when the system starts up, add the following content:

echo "Ifenslave bond0 eth0 eth1" >>/etc/rc.local


5. Restart the network card to make it effective

Service Network restart


Note: The NetworkManager service is turned off and set to on without booting to prevent interference-related actions

Service NetworkManager Stopchkconfig NetworkManager off


Test: Turn off any of the bundled network cards and the networks are unaffected.


Attached: Test NIC interface Speed Ethtool

[[email protected] ~]# ethtool eth0settings for eth0:         Supported ports: [ TP ]         Supported link modes:   10baseT/Half 10baseT/Full                                   100baseT/Half 100baseT/Full                                   1000baseT/Full          Supported pause frame use: No         Supports auto-negotiation: Yes         advertised link modes:  10baset/half 10baset/full                                   100baseT/Half 100baseT/Full                                   1000baseT/Full          Advertised pause frame use: No         advertised auto-negotiation: yes        speed: 1000mb/s         Duplex: Full         Port: Twisted Pair        PHYAD: 1       &nBsp; transceiver: internal        auto-negotiation: on         MDI-X: off         Supports Wake-on: pumbg        Wake-on: g         Current message level: 0x00000007  (7)                                  drv probe link         link detected: yes



This article is from the "Dream Life" blog, please be sure to keep this source http://hzde0128.blog.51cto.com/918211/1836378

Dual NIC bindings under CentOS

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.