使用bonding技術實現雙網卡綁定

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

在Linux系統中使用bonding技術,可以將兩塊網卡綁定為一個對外IP使用,以達到高可用或負載均衡的目的.以下簡要介紹該技術的使用.
1.安裝兩塊網卡
在linux系統下將兩塊網卡配置好,使其均能獨立工作.可能會碰到驅動問題,自己想辦法解決吧,無非是在內核配置里找或者找第三方的.
網卡不一定要一個型號,我用的一塊是獨立的,一塊是集成的,也沒什麼問題.
2.編譯內核
在內核中添加bonding的支持.
在原碼目錄下make menuconfig
選上device drivers -> network device support -> bonding driver support
一般來說2.4以上默認是選上的,我用的2.6.22
編譯內核其他過程不再贅述
3.bonding配置
以下是截取源代碼目錄下/Documentation/networking/bonding.txt中的一段說明
3.2 Configuration with Initscripts Support
------------------------------------------
This section applies to distros using a version of initscripts with bonding support, for example, Red Hat Linux 9 or Red Hat Enterprise Linux version 3 or 4. On these systems, the network
initialization scripts have some knowledge of bonding, and can be configured to control bonding devices.
These distros will not automatically load the network adapter driver unless the ethX device is configured with an IP address. Because of this constraint, users must manually configure a
network-script file for all physical adapters that will be members of a bondX link. Network script files are located in the directory:
/etc/sysconfig/network-scripts
The file name must be prefixed with "ifcfg-eth" and suffixed with the adapter's physical adapter number. For example, the script for eth0 would be named /etc/sysconfig/network-scripts/ifcfg-eth0.Place the following text in the file:


RX packets:2302 errors:0 dropped:0 overruns:0 frame:0
TX packets:2014 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:234137 (228.6 KiB) TX bytes:482422 (471.1 KiB)
Interrupt:17 Base address:0xd400




[火星人 ] 使用bonding技術實現雙網卡綁定已經有454次圍觀

http://coctec.com/docs/linux/show-post-54450.html