配置Linux bond配置:
配置网卡eth0使用的命令如下:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
配置网卡eth1使用的命令如下:
cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
配置bond0使用的命令如下:
DEVICE=bond0
IPADDR=192.168.1.2
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
BONDING_OPTS="mammon=100 mode=4"
重启网卡生效
配置交换机:
int port-channel1
switchport access vlan 8
switch mode access
spanning-tree portfast
spanning-tree bpduguard enable
int range g1/0 - 1
switchport access vlan 8
switchport mode access
spanning-tree portfast
spanning-tree bpduguard enable
channel-protocol lacp
channel-group 1 mode active
交换机确认:
show etherchannel summary
服务器确认:
ethtool bond0
cat /proc/net/bonding/bond0
测试bonding流量压力测试用iPerf工具
ifstat -b
interface Eth-Trunk8
port link-type access
port default vlan 24
mode lacp
interface GigabitEthernet0/0/10
eth-trunk 8
lacp priority 100
#
interface GigabitEthernet0/0/11
eth-trunk 8
lacp priority 100
#
interface GigabitEthernet0/0/12
eth-trunk 8
lacp priority 100