方案说明:
服务器侧通过bonding将两块物理网卡抽象成一个逻辑上的网卡,交换机侧配置Eth-Trunk来实现网络带宽扩容或高可用。
相关配置:
交换机配置略过(大概就是先清空两个接口配置,创建Eth-Trunk,然后将接口加入Eth-Trunk,配置Eth-Trunk)
服务器配置bonding:
1、删除原网卡配置
nmcli con del eno1
nmcli con del eno2
2、添加bond0配置,有7种模式,mode 4代表lacp
nmcli con add type bond con-name bond- ifname bond0 mode 4 miimon 100 ip4 xxx.xxx.xxx.xxx/xx gw4 xxx.xxx.xxx.xxx
3、添加成员网卡配置
nmcli con add type bond-slave ifname eno1 master bond0
nmcli con add type bond-slave ifname eno2 master bond0
4、将网卡up
nmcli connection up bond-slave-eno1
nmcli connection up bond-slave-eno2
nmcli connection up bond0
5、查看接口工作状态
cat /proc/net/bonding/bond0
验证过程:
在服务器上起3个iperf3 server(iperf3 -s -p 1234 &
),用3个iperf3 client(iperf3 -c ip -p 1234 -t 30 -b 10G
)同时向这3个iperf3 server发起请求,通过nload观察服务器上的流量情况是否符合预期。
注:需根据具体的业务场景来选择合适的bonding模式