环境准备:
centos7.0 双网卡或者多网卡
聚合后的IP地址:10.2.2.100
网卡名分别为:enp0s8和enp0s9
具体配置
一、查看当前网卡信息:
nmcli connection show
二、创建网卡组(聚合后的网卡组)
##格式如下:
nmcli connection add con-name 逻辑名称 ifname 物理名称 type 类型 config ‘{“runner”: {“name”: “activebackup”}}’
nmcli connection add con-name team0 ifname team0 type team config ‘{"runner": {"name": "activebackup"}}‘
三、设置聚合网卡IP地址:
nmcli connection modify team0 ipv4.addresses 10.2.2.100/24 ipv4.method manual connection.autoconnect yes
四、将enp0s8和enp0s9网卡添加到创建的网卡组里:
nmcli connection add con-name enp0s8 ifname enp0s8 type team-slave master team0
nmcli connection add con-name enp0s9 ifname enp0s9 type team-slave master team0
五、激活
nmcli connection down team0 && nmcli connection up team0
六、重启网卡服务:
service network restart
注意:
如果出现以下问题
Error: Could not create NMClient object: GDBus.Error:org.freedesktop.DBus.Error.UnkNownMethod: Method "GetManagedobjects" with signature "" on interface "org.freedesktop.DBus.ObjectManager" doesn‘t exist
解决方法:
systemctl restart NetworkManager
即可解决