JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

在RHEL 6.x下實作Bonding的Function


之前在驗證NIC的Function的時候剛好有碰到Bonding的部分,在外面企業應用上也蠻常見的,可透過不同的Mode來做各種情況的應對,不過通常至少要兩個NICs以上比較能實際操作,針對OSI的Layer 2~4做Traffic處理,至於細部的介紹可參考維基百科,因此話不多說,直接來玩一次就明白了,如下:

I. Introduction about Variant Mode
Code Policy Name Description
-------------------------------------------------------------------------------
0 balance-rr Round-Robin policy for fault tolerance
1 active-backup Active-Backup policy for fault tolerance
2 balance-xor Exclusive-OR policy for fault tolerance
3 broadcast All transmissions are sent on all slave interfaces.
4 802.3ad Dynamic link aggregation policy(Need Switch Support)
5 balance-tlb Transmit Load Balancing policy for fault tolerance
6 balance-alb Active Load Balancing policy for fault tolerance

II. Temporary Setting
1) 透過下列Command去Check是否有Support Bonding
#mii-tool
#ethtool eth0
#ethtool eth1

2) 先將各NIC關掉,並依照指定Mode與秒數掛起Bonding的Module(這邊以blance-rr為例)
#ifconfig eth0 down
#ifconfig eth1 down
#modprobe bonding mode=balance-rr miimon=100

3) 設定Bond0的IP,並指定Sub-Interface起來(也可透過-c[Change]和-d[Dettach])
#ifconfig bond0 192.168.6.200 netmask 255.255.255.0 up
#ifenslave bond0 eth0
#ifenslave bond0 eth1
#ifconfig bond0 -> Check IP and Netmask

4) Check the relative information about bonding(所有介面、Mode與Detail)
#cat /sys/class/net/bonding_meters
bond0
#cat /sys/class/net/bond0/bonding/mode
balance-rr 0
#cat /proc/net/bonding/bond0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 0xx:xx:xx:xx:xx:xx
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: xx:xx:xx:xx:xx:xx

III. Permanent Setting
5) 透過ifcfg-*來設定bond0、eth0與eth1的介面
#vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.1
NETMASK=255.255.255.0
BONDING_OPTS="miimon=100 mode=0"
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=eth0
SLAVE=yes
#vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=eth1
SLAVE=yes

6) 透過/etc/modprobe.d/bonding.conf來指定Bond的介面名稱
#vi /etc/modprobe.d/bonding.conf
alias bond0 bonding

7) 透過網路Service重啟來套用設定(Check the module of bond)
#service network restart
#lsmod | grep -i bond

◎、以上就是在RHEL 6.x下實作Bonding的Function(Teaming!?),至於其他Mode的部分可以自行品嘗品嘗上述的過程參考這裡以及傲笑大大文章,先到這了,收工嚕!

  1. 胖虎你好
    看了你的文章真是受益良多
    不知道這個bonding,設定完需不需要重開機呢?

  2. 你好,深夜维护间隔又来看看你的网站,哈哈。
    我家里的HP 小服务器和交换机都支持端口绑定,只是之前听人说,单个IP访问服务器,贷款永远是1GB,这种绑定是要在多客户端访问才有意义,是这样么?

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro