centos7 Lacp+802.3ad配置
1.S5700交换机配置
1.1 创建Eth-Trunk
创建编号为1的eth-trunk,配置他的工作模式为静态lacp模式:
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] interface eth-trunk 1
[SwitchA-Eth-Trunk1] bpdu enable
[SwitchA-Eth-Trunk1] mode lacp-static
[SwitchA-Eth-Trunk1] quit
1.2 将成员接口加入Eth-Trunk
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] eth-trunk 1
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] eth-trunk 1
[SwitchA-GigabitEthernet0/0/2] quit
1.3 验证配置结果
查看各Switch设备的Eth-Trunk信息,查看链路是否协商成功;
[SwitchA] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SA-XOR-DA
System Priority: 100 System ID: 00e0-fca8-0417
Least Active-linknumber: 1 Max Active-linknumber: 2
Operate status: Up Number Of Up Port In Trunk: 2
------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/1 Selected 1GE 100 6145 2865 11111100 1
GigabitEthernet0/0/2 Selected 1GE 100 6146 2865 11111100 1
Partner:
------------------------------------------------------------------------------
PartnerPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/1 32768 00e0-fca6-7f85 32768 6145 2609 11111100
GigabitEthernet0/0/2 32768 00e0-fca6-7f85 32768 6146 2609 11111100
通过以上显示信息可以看到,SwitchA的系统优先级为100,高于SwitchB的系统优先级。Eth-Trunk的成员接口中GigabitEthernet 0/0/1、GigabitEthernet 0/0/2成为活动接口,处于 Selected 状态,同时实现 M 条链路的负载分担和 N 条链路的冗余备份功能。
1.4 交换机配置文件
# sysname SwitchA
#lacp priority 100
#interface Eth-Trunk1
mode lacp-static
max active-linknumber 2
#interface GigabitEthernet0/0/1
eth-trunk 1
lacp priority 100
#interface GigabitEthernet0/0/2
eth-trunk 1
lacp priority 100
#interface GigabitEthernet0/0/3
eth-trunk 1
#return
2.服务器端网卡配置
配置了 bond4 模式 ,交换机开启 lacp, 配置聚合,mode 4: lacp,802.3ad模式是IEEE标准 。
2.1 网卡em1配置
# cat /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1
NAME=em1
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
2.2 网卡em2配置
# cat /etc/sysconfig/network-scripts/ifcfg-em2
DEVICE=em2
NAME=em2
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
2.3 虚bond0配置
# cat /etc/sysconfig/network-scripts/ifcfg-bond4
DEVICE=bond0
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=172.16.32.51
GATEWAY=172.16.32.1
NETMASK=255.255.255.0
PEERDNS=yes
ONBOOT=yes
BOOTPROTO=static
BONDING_OPTS="resend_igmp=1 updelay=0 use_carrier=1 miimon=100 downdelay=0 xmit_hash_policy=layer3+4 primary_reselect=0 fail_over_mac=0 arp_validate=0 mode=802.3ad lacp_rate=1 arp_interval=0 ad_select=0"
2.4 bonding生效
重启系统
[root@localhost ~]# reboot
2.5 检查bonding状态
# cat /proc/net/bonding/bond4
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: fast
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 3
Number of ports: 3
Actor Key: 17
Partner Key: 7985
Partner Mac Address: e4:c2:d1:e5:29:40
Slave Interface: em1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:21:87:ec
Aggregator ID: 3
Slave queue ID: 0
Slave Interface: em2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 44:a8:42:21:87:ed
Aggregator ID: 3
Slave queue ID: 0