Networking

綁定:僅供下載

  • February 14, 2018

我想使用模式 4 安裝 4 個連結的綁定。但只有“下載/接收”適用於 bondig。為傳輸系統選擇一個鏈路。

如果配置

bond0     Link encap:Ethernet  HWaddr 90:E2:BA:0F:76:B4
         inet addr:ip  Bcast:ip  Mask:255.255.255.248
         inet6 addr: fe80::92e2:baff:fe0f:76b4/64 Scope:Link
         UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
         RX packets:239187413 errors:0 dropped:10944 overruns:0 frame:0
         TX packets:536902370 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:14688536197 (13.6 GiB)  TX bytes:799521192901 (744.6 GiB)

eth2      Link encap:Ethernet  HWaddr 90:E2:BA:0F:76:B4
         UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
         RX packets:54969488 errors:0 dropped:0 overruns:0 frame:0
         TX packets:2537 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:3374778591 (3.1 GiB)  TX bytes:314290 (306.9 KiB)

eth3      Link encap:Ethernet  HWaddr 90:E2:BA:0F:76:B4
         UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
         RX packets:64935805 errors:0 dropped:1 overruns:0 frame:0
         TX packets:2532 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:3993499746 (3.7 GiB)  TX bytes:313968 (306.6 KiB)

eth4      Link encap:Ethernet  HWaddr 90:E2:BA:0F:76:B4
         UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
         RX packets:57352105 errors:0 dropped:2 overruns:0 frame:0
         TX packets:536894778 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:3524236530 (3.2 GiB)  TX bytes:799520265627 (744.6 GiB)

eth5      Link encap:Ethernet  HWaddr 90:E2:BA:0F:76:B4
         UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
         RX packets:61930025 errors:0 dropped:3 overruns:0 frame:0
         TX packets:2540 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:3796021948 (3.5 GiB)  TX bytes:314274 (306.9 KiB)

lo        Link encap:Local Loopback
         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING  MTU:16436  Metric:1
         RX packets:62 errors:0 dropped:0 overruns:0 frame:0
         TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:5320 (5.1 KiB)  TX bytes:5320 (5.1 KiB)

這些是我的配置:

DEVICE="eth2"
BOOTPROTO="none"
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED="no"
ONBOOT="yes"


DEVICE="eth3"
BOOTPROTO="none"
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED="no"
ONBOOT="yes"



DEVICE="eth4"
BOOTPROTO="none"
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED="no"
ONBOOT="yes"


DEVICE="eth5"
BOOTPROTO="none"
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED="no"
ONBOOT="yes"

DEVICE=bond0
IPADDR=<ip>
BROADCAST=<ip>
NETWORK=<ip>
GATEWAY=<ip>
NETMASK=<ip>
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no

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 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
       Aggregator ID: 1
       Number of ports: 4
       Actor Key: 17
       Partner Key: 11
       Partner Mac Address: 00:24:51:12:63:00

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:e2:ba:0f:76:b4
Aggregator ID: 1
Slave queue ID: 0

Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:e2:ba:0f:76:b5
Aggregator ID: 1
Slave queue ID: 0

Slave Interface: eth4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:e2:ba:0f:76:b6
Aggregator ID: 1
Slave queue ID: 0

Slave Interface: eth5
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:e2:ba:0f:76:b7
Aggregator ID: 1
Slave queue ID: 0

/etc/modprobe.d/bonding.conf

alias bond0 bonding
options bond0 mode=4 miimon=100 updelay=200
#downdelay=200 xmit_hash_policy=layer3+4 lacp_rate=1

Linux:

Linux 3.0.0+ #1 SMP Fri Oct 26 07:55:47 EEST 2012 x86_64 x86_64 x86_64 GNU/Linux

我試過的:

downdelay=200 xmit_hash_policy=layer3+4 lacp_rate=1

mode 6

在開始調試綁定配置之前,您是否驗證過每個網路連結都可以獨立執行?如果在您關閉 eth4 ( ifdown eth4) 時沒有任何效果,那麼您的接線很可能有問題。

此外,您可能應該先嘗試一些更簡單的綁定模式。嘗試 balance-rr ( mode=0) 並查看是否可以看到所有介面上的流量。還要查看/proc/net/bonding/bond0以驗證配置的目前狀態。

您應該閱讀此文件: Linux 綁定

引用自:https://serverfault.com/questions/442545