Networking

在 Debian Jessie 下使用 HP 1920G 交換機設置 802.3ad 綁定

  • August 30, 2018

我有一個 Debian Jessie 伺服器,帶有兩個 Intel i350 板載 1Gbps NIC,我想使用 802.3ad 協議將它們橋接到我的 HP 1920G 48 埠託管交換機。

這是我正在執行的核心

~ % uname -a
Linux ltsp 4.9.0-0.bpo.3-amd64 #1 SMP Debian 4.9.30-2+deb9u5~bpo8+1 (2017-09-28) x86_64 GNU/Linux

我已經為 802.3ad 設置了交換機的 LACP 埠 3 和 4,但是當我嘗試連接我的綁定網路時,它抱怨“埠配置不適合連接”。 HP 1920 LACP 配置

在我的 /etc/modules 我有

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

loop
vhost_net
bonding

我已經安裝了 ifenslave

sudo apt install ifenslave-2.6

這是 /etc/network/interfaces 文件

auto lo
iface lo inet loopback

# bond0 is the bonding NIC and can be used like any other normal NIC.
# bond0 is configured using static network information.
auto bond0
iface bond0 inet static
   address 192.168.200.5
   gateway 192.168.200.1
   netmask 255.255.255.0
   dns-nameservers 8.8.8.8
   dns-search lan
   # Use IEEE 802.3ad LACP bonding protocol
   bond-mode 4
   bond-miimon 100
   bond-slaves none

#eth2 is manually configured, and slave to the “bond0” bonded NIC
allow_hotplug eth2
auto eth2
iface eth2 inet manual
     bond-master bond0
     bond-primary eth2

#eth3 ditto, thus creating a 2-link bond.
allow_hotplug eth3
auto eth3
iface eth3 inet manual
     bond-master bond0

這給出了輸出

~ % 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
Min links: 0
Aggregator selection policy (ad_select): stable

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:25:90:e6:e9:67
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: churned
Actor Churned Count: 0
Partner Churned Count: 1

Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:25:90:e6:e9:66
Slave queue ID: 0
Aggregator ID: 2
Actor Churn State: churned
Partner Churn State: churned
Actor Churned Count: 1
Partner Churned Count: 1

這行不通。我無法在 192.168.200.5 上 ping 這台機器。我在這裡想念什麼?

2018 年 8 月 23 日更新

嘗試在模組文件中設置綁定屬性。

編輯 /etc/modules

bonding mode=4 miimon=100 lacp_rate=1

2018 年 8 月 28 日更新:來自 HP 交換機的更多資訊

在 HP 命令行中顯示目前配置給了我這個輸出;

<HP 1920G Switch>display current-configuration
#
version 5.20.99, Release 1106
#
sysname HP 1920G Switch
#
undo voice vlan mac-address 0003-6b00-0000
undo voice vlan mac-address 00e0-7500-0000
voice vlan mac-address 0004-1300-0000 mask ffff-ff00-0000 description SNOM phone
voice vlan mac-address 0004-f200-0000 mask ffff-ff00-0000 description PolycomVVX phone
undo voice vlan security enable
#
domain default enable system
#
ipv6
#
telnet server enable
#
lldp compliance cdp
#
password-recovery enable
#
vlan 1
description Data
#               
vlan 300
description Voice_Polycom
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
user-group system
group-attribute allow-guest
#
local-user admin
password cipher <snip>
authorization-attribute level 3
service-type ssh telnet terminal
service-type web
#
stp mode rstp
stp enable
#
interface Bridge-Aggregation1
link-aggregation mode dynamic
#
interface NULL0
#
interface Vlan-interface1
ip address dhcp-alloc
#
#
interface GigabitEthernet1/0/1
description firewall
port link-type trunk
port trunk permit vlan 1 300
port auto-power-down
poe enable
stp edged-port enable
#
interface GigabitEthernet1/0/2
description LTSP
port auto-power-down
poe enable
stp edged-port enable
#
interface GigabitEthernet1/0/3
description Workstation_Phone_Prn_Scan
port link-type trunk
port trunk permit vlan 1
port auto-power-down
poe enable
stp edged-port enable
lldp compliance admin-status cdp txrx
port link-aggregation group 1
#
interface GigabitEthernet1/0/4
description Workstation_Phone_Prn_Scan
port link-type trunk
port trunk permit vlan 1
port auto-power-down
poe enable
stp edged-port enable
lldp compliance admin-status cdp txrx
port link-aggregation group 1
#
interface GigabitEthernet1/0/5
description Workstation_Phone_Prn_Scan
port link-type trunk
port trunk permit vlan 1
voice vlan 300 enable
port auto-power-down
poe enable
stp edged-port enable
lldp compliance admin-status cdp txrx

GigabitEthernet1/0/3 和 GigabitEthernet1/0/4 是我要綁定的埠。您可以看到它們是連結聚合組的一部分。

更新:查看日誌文件

要檢查日誌文件,我必須通過 Web 後端“設備 - > syslog”執行此操作,在我的測試綁定機器上重新啟動網路後,我得到了這四行;

Aug 28 10:59:06:287 2018    IFNET   Error   LINK_UPDOWN GigabitEthernet1/0/4 link status is UP.
Aug 28 10:58:56:005 2018    IFNET   Error   LINK_UPDOWN GigabitEthernet1/0/3 link status is UP.
Aug 28 10:58:43:066 2018    IFNET   Error   LINK_UPDOWN GigabitEthernet1/0/3 link status is DOWN.
Aug 28 10:58:33:338 2018    IFNET   Error   LINK_UPDOWN GigabitEthernet1/0/4 link status is DOWN.

您的各個介面和Bridge-Aggregation1介面的配置彼此不同,足以防止它們成為鏈路聚合的一部分。您的配置應如下所示:

interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan 1
link-aggregation mode dynamic

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