System: CentOS or RHEL5 Series systems
Configuration file:/etc/modprobe.conf
----------------------------------------
System: CentOS or RHEL6 Series systems
Configuration file:/etc/modprobe.d/dist.conf
Linux bonding provides the use of bundling multiple network interface devices into a single network interface setting.
For Network Load Balancing and network redundancy.
Nic binding mainly has 0~6 seven kinds of modes, commonly used in 3 kinds:
0: Load balancing, two network cards are working, when a problem occurs, another will continue to work, need to do port aggregation configuration on the switch, because the two network cards are using the same MAC address, 1: The main standby mode, and only one card work; 6: Load balancing, two network cards are working, However, there is no need to configure the switch in this mode, because the two NICs that do bonding use different MAC addresses;
First, check whether the system supports NIC binding
#modinfo Bondingilename:/lib/modules/3.0.13-0.27-xen/kernel/drivers/net/bonding/bonding.koalias:rtnl-lin K-bondauthor:thomas Davis, [email protected] and many othersdescription:ethernet Channel Bonding Driver, v3.7 .1version:3.7.1license:gplsrcversion:7a8a0ef8b35b2de05bc5e19depends:supported:yesvermag Ic:3.0.13-0.27-xen SMP mod_unload modversions Xen
There is an information output stating that the system supports, if not supported, the need to recompile the kernel to find bonding driver support. Your output information may be different from here, but it's okay.
Ii. setting up a binding port configuration file
# cd/etc/sysconfig/network-scripts# cp-a ifcfg-eth0 ifcfg-bond0# vi ifcfg-bond0# Broadcom Corporation netxtreme II BCM57 Gigabitethernetdevice=bond0 #修改设备名称为bond0, be sure to remove the HWADDR network card hardware address Bootproto=none #修改为none或staticONBOOT =yes #修改成yesIPADDR =192.168.56.100 #网卡IP地址NETMASK =255.255.255.0 #网卡掩码GATEWAY =192.168.56.1 #网关地址DNS1 =192.168 .56.254 #DNS地址
Third, modify the physical network card configuration file
To bind eth0 and eth1 as an example:
# vi ifcfg-eth0# Broadcom Corporation netxtreme II BCM5709 gigabitethernetdevice=eth0type=ethernetbootproto=none #修改成n One or Staticonboot=yes #修改成yesMASTER =bond0 #指定主设备名称SLAVE =yes
# vi ifcfg-eth1# Broadcom Corporation netxtreme II BCM5709 gigabitethernetdevice=eth1type=ethernetbootproto=noneonboot =yesmaster=bond0slave=yes
Iv. Loading Module
# Vim/etc/modprobe.confalias bond0bonding #bond0为定义绑定网卡设备名称options bonding mode=0 miimon=100 #负载均衡模式, every 10 0MS Check NIC Status
If it is a RHEL6 series system, the configuration file is/etc/modprobe.d/dist.conf, or you manually create the configuration file,
such as,/etc/modprobe.d/bond0.conf and so on.
Five, matters needing attention
It is best to bind the same two physical network card models, which belong to the same network segment.
Vi. temporary binding, immediate effect
# ifconfig bond0 192.168.56.100 netmask 255.255.255.0 up# ifenslave bond0 eth0# ifenslave bond0 eth1
This article is from the "Tiandaochouqin" blog, make sure to keep this source http://lavenliu.blog.51cto.com/5060944/1441325
Gnu/linux NIC Binding Bonding