How to bind a CentOS Nic

Source: Internet
Author: User
NICchannelbondingallowsmultiplenetworkcardstoactasone, allowingincreasedbandwidthandredundancy. let & #39; sassumewehavetwonetworkinterfaces (& quot; eth0 & quot; and & quot; eth1 & quot;) a NIC channel bonding allows multiple network cards to act as one, allowing increased bandwidth and redundancy. let's assume we have two network interfaces ("eth0" and "eth1") and we want to bond them so they look like a single in Terface ("bond0 "). add the following line to the "/etc/modprobe. conf "file. ============================ alias bond0 bonding ======== ============================== The files defining the regular and bonded interfaces are located in the "/etc/sysconfig/network -scripts "directory. create a new file called "ifcfg-bond0" for the bonded interface with the following contents (adjust the network parameters as appli Cable ). ============================ [root @ rhel5 network-scripts] # cat ifcfg-bond0 # Intel Corporation 82540EM Gigabit Ethernet ControllerDEVICE = bond0BOOTPROTO = staticONBOOT = yesUSERCTL = noIPADDR = mask = 255.255.255.0BONDING _ OPTS = "mode = 1 miimon = 100" ============ ============================== description: miimon is used for link monitoring. For example: miimon = 100, the system monitors the link connection status every MS. If one line fails, it is transferred to another line. The value of mode indicates the working mode, which has a total, two or three modes, commonly used: 0, 1. Mode = 0 indicates that the load balancing (round-robin) method is load balancing, and both NICs work. Mode = 1 indicates that fault-tolerance (active-backup) provides redundancy, working in the active/standby mode. that is to say, by default, only one network card works and the other is used for backup. bonding can only provide link monitoring, that is, whether the link from the host to the switch is connected. If only the Switch's external link is down and the switch itself is not faulty, bonding considers the link to be okay and continues to use Amend the existing "ifcfg-eth0" and "ifcfg-eth1" files, adding the "MASTER" and "SLAVE" parameters. the contents of these files shoshould look like this. ============================ [root @ rhel5 network-scripts] # cat ifcfg-eth0 # Intel Corporation 82540EM Gigabit Ethernet ControllerDEVICE = drivers = noneUSERCTL = noONBOOT = yesMASTER = drivers = yes [root @ rhel5 network-scripts] # cat ifcfg-eth1 # Intel Corporation 82540EM Gigabit Ethernet ControllerDEVICE = eth1BOOTPROTO = noneONBOOT = yesUSERCTL = noneMASTER = bond0SLAVE = yes ======================= Restart network service. ===========================# service network restart ======== ============================ Once the bond is configured it acts like any other Ethernet device. for example, you can configure alias interfaces to handle multiple IP addresses, as shown below. create the "ifcfg-bond0: 1" and "ifcfg-bond0: 2" files in the "/etc/sysconfig/network-scripts" directory with the following contents. ===============================# ifcfg-bond0: 1 file contentsDEVICE = bond0: 1 BOOTPROTO = noneONBOOT = yesNETWORK = 192.168.0.0NETMASK = 255.255.255.0IPADDR = 192.168.0.172USERCTL = noBONDING_OPTS = "mode = 1 miimon = 100" # ifcfg-bond0: 2 file contentsDEVICE = bond0: 2 BOOTPROTO = noneONBOOT = yesNETWORK = 192.168.0.0NETMASK = 255.255.255.0IPADDR = 192.168.0.173USERCTL = noBONDING_OPTS = "mode = 1 miimon = 100" ============ ============= Restart the network service for the changes to take effect. you can view bond0's working Status query to learn the working status of bonding in detail [root @ redflag bonding] # cat/proc/net/bonding/bond0bonding. c: v2.4.1 (September 15,200 3) Bonding Mode: load balancing (round-robin) MII Status: upMII Polling Interval (MS): 0Up Delay (MS): 0 Down Delay (MS): 0 Multicast Mode: all slavesSlave Interface: eth1MII Status: upLink Failure Count: 0 Permanent HW addr: 00: 0e: 7f: 25: d9: 8 aSlave Interface: eth0MII Status: upLink Failure Count: 0 Permanent HW addr: 00: 0e: 7f: 25: d9: 8b


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.