標籤:centos bonding 多網卡綁定
操作樣本:將eth01/eth02綁定到一個IP上
(1)在修改核心模組設定檔/etc/modprobe.conf,加入以下內容:
###### Bonding Start ######alias bond0 bondingoptions bonding max_bonds = 1###### Bonding End ########
(2)建立bonding網卡檔案/etc/sysconfig/network-scripts/ifcfg-bond0,配置如下:
DEVICE=bond0ONBOOT=yesBOOTPROTO=staticIPADDR=192.168.100.21NETMASK=255.255.255.0USERCTL=noBONDING_OPTS="mode=1 miimon=100 primary=eth01"
*bonding_opts參數參考:
parm: max_bonds:Max number of bonded devices (int)parm: tx_queues:Max number of transmit queues (default = 16) (int)parm: num_grat_arp:Number of gratuitous ARP packets to send on failover event (int)parm: num_unsol_na:Number of unsolicited IPv6 Neighbor Advertisements packets to send on failover event (int)parm: miimon:Link check interval in milliseconds (int)parm: updelay:Delay before considering link up, in milliseconds (int)parm: downdelay:Delay before considering link down, in milliseconds (int)parm: use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int)parm: mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp)parm: primary:Primary network device to use (charp)parm: primary_reselect:Reselect primary slave once it comes up; 0 for always (default), 1 for only if speed of primary is better, 2 for only on active slave failure (charp)parm: lacp_rate:LACPDU tx rate to request from 802.3ad partner; 0 for slow, 1 for fast (charp)parm: ad_select:803.ad aggregation selection logic; 0 for stable (default), 1 for bandwidth, 2 for count (charp)parm: xmit_hash_policy:balance-xor and 802.3ad hashing method; 0 for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3 (charp)parm: arp_interval:arp interval in milliseconds (int)parm: arp_ip_target:arp targets in n.n.n.n form (array of charp)parm: arp_validate:validate src/dst of ARP probes; 0 for none (default), 1 for active, 2 for backup, 3 for all (charp)parm: fail_over_mac:For active-backup, do not set all slaves to the same MAC; 0 for none (default), 1 for active, 2 for follow (charp)parm: all_slaves_active:Keep all frames received on an interfaceby setting active flag for all slaves; 0 for never (default), 1 for always. (int)parm: resend_igmp:Number of IGMP membership reports to send on link failure (int)
(3)修改eth01的網卡設定檔:
DEVICE=eth01MASTER=bond0SLAVE=yesHWADDR=54:22:22:00:7A:37:CEONBOOT=yes
修改eth02的網卡設定檔:
DEVICE=eth02MASTER=bond0SLAVE=yesHWADDR=54:22:22:00:7A:37:CEONBOOT=yes
(4)匯入bonding驅動,重啟網路服務後生效
>modprobe -i bonding max_bonds=1>service network restart
本文出自 “緣隨心愿” 部落格,請務必保留此出處http://281816327.blog.51cto.com/907015/1615281
CentOS 網路基礎:(5)設定多網卡綁定單IP