LACP Bond配置(by quqi99)

作者:张华  发表于:2016-04-26
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明

( http://blog.csdn.net/quqi99 )


linux有七种网卡绑定模式:

  1. bond0:round-robin, 轮询。各接口轮流使用。需要交换机支持。交换机要配置成聚合口
  2. bond1:active-backup, 主备。即只有一个接口在使用,当接口出现问题的时候再切换到别的接口
  3. bond2:load balancing(xor), 根据数据的目的mac地址计算使用的端口。
  4. bond3:broadcast, 所有数据在每个接口都复制一份
  5. bond4:lacp, IEEE 802.3ad动态链路聚合。创建共享相同的速率和双工模式的聚合组。能根据802.3ad规范利用所有的slave来建立聚合链路。Salve的出站选择取决于传输的hash策略,默认策略是简单的XOR策略,而hash策略则可以通过xmit_hash_policy选项加以改变。
  6. bond5:对外出流量负载均衡
  7. bond6:通过修改ARP包实现负载均衡, 即对到来的arp请求依据一定策略使用不通过的arp进行回复


vi /etc/network/interfaces

auto bond0
iface bond0 inet manual
   bond-slaves eth2 eth1
   bond-miimon 100
   bond-mode 4
   bond-lacp-rate 1
   bond-xmit-hash-policy 2
   mtu 9000
auto eth2
iface eth2 inet manual
bond-master bond0
auto eth1
iface eth1 inet manual
bond-master bond0
auto bond0.1600
iface bond0.1600 inet static
   address 10.0.1.108
   netmask 255.255.255.0
   up ip route add 10.0.0.0/16 via 10.0.1.1 dev bond0.1600 || true


hua@node1:~$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2+3 (2)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0


802.3ad info
LACP rate: fast
Min links: 0
Aggregator selection policy (ad_select): stable

Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 2c:53:4a:02:20:3c
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: churned
Actor Churned Count: 0
Partner Churned Count: 2

Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 2c:53:4a:02:20:3d  #若此处是00:00:00:00:00:00的话意味着交换机没配置LACP,这叫fallback模式,就像bond只有一个NIC一样影响性能,但合法
Slave queue ID: 0
Aggregator ID: 2
Actor Churn State: churned
Partner Churn State: churned
Actor Churned Count: 1
Partner Churned Count: 1

你可能感兴趣的:(LACP Bond配置(by quqi99))