服务器绑定接口配置

服务器绑定接口配置

(同样的问题在http://unix.stackexchange.com

我们在服务器配置方面遇到了一些问题:有 2 台服务器,每台服务器包含 2 个绑定的 NIC。每台服务器连接到 2 个 Cisco 交换机(每个 NIC 连接到单独的交换机)。交换机上的端口配置为具有 VLAN 1111。交换机之间也有互连(此 VLAN 是互连的一部分)。

switch2上出现以下错误(Gi0/25是服务器连接的地方,Gi0/30是互连)

*Jun  1 16:18:23.182: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/25 and port Gi0/30 
*Jun  1 16:18:45.093: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/30 and port Gi0/25 
*Jun  1 16:18:56.031: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/25 and port Gi0/30 
*Jun  1 16:19:15.141: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/25 and port Gi0/30 
*Jun  1 16:19:23.479: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/30 and port Gi0/25 
*Jun  1 16:19:45.616: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/30 and port Gi0/25 

检查配置时,你可以看到两个交换机都已获悉 1cc1.de7a.04b6 MAC 地址

NLS-PDC-SW2>show mac address-table vlan 1111 
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
1111    1cc1.de7a.046a    DYNAMIC     Gi0/26
1111    1cc1.de7a.04b6    DYNAMIC     Gi0/25
Total Mac Addresses for this criterion: 23

NLS-PDC-SW1>show mac address-table vlan 1111 
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
1111    1cc1.de7a.04b6    DYNAMIC     Gi0/25
Total Mac Addresses for this criterion: 24
NLS-PDC-SW1>

检查两台服务器上的 modprobe 文件,我发现 server2 上(包含 1cc1.de7a.04b6)

alias bond0 bonding
options bond0 miimon=100

以及 server1 (包含 1cc1.de7a.046a)

alias bond0 bonding
options bond0 miimon=100 mode=1

我对所需的配置感到很困惑。您能给出建议吗?

编辑

[admin@servera ~]$ cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 1c:c1:de:7a:04:6a

Slave Interface: eth3
MII Status: up
Link Failure Count: 1
Permanent HW addr: 98:4b:e1:0a:cb:20


[admin@serverb ~]$ cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 1c:c1:de:7a:04:b6

Slave Interface: eth3
MII Status: up
Link Failure Count: 1
Permanent HW addr: 98:4b:e1:01:49:ba

答案1

循环(模式 0)绑定中的端口需要位于 EtherChannel 中。

阅读绑定文档,第 5 章交换机配置:

https://www.kernel.org/doc/Documentation/networking/bonding.txt

此外,modprobe 不是配置绑定选项的正确位置,您应该BONDING_OPTS="miimon=100 mode=X"使用/etc/sysconfig/network-scripts/ifcfg-bondX

答案2

我认为问题的根源在于您在其中一台服务器上使用了循环模式。尝试将循环 (mode=0) 更改为主动备份 (mode=1)

相关内容