配置链路聚合的目的:冗余、负载均衡
假如需要做链路聚合的2块网卡为eth1和eth2
man nmcli-examples
搜索模板Example 7(这是active/backup模式,一般round robin模式用的最多。)
$ nmcli con add type team con-name Team1 ifname Team1 config team1-master-json.conf
$ nmcli con add type ethernet con-name Team1-slave1 ifname em1 master Team1
$ nmcli con add type ethernet con-name Team1-slave2 ifname em2 master Team1
man teamd. conf
搜索runner,找到这一行
"runner": {"name": "activebackup"},
逻辑网卡定义为Team1,输入以下命令即可:
$ nmcli con add type team con-name Team1 ifname Team1 config '{"runner": {"name": "activebackup"}}'
$ nmcli con add type ethernet con-name Team1-slave1 ifname eth1 master Team1
$ nmcli con add type ethernet con-name Team1-slave2 ifname eth2 master Team1
接下来为Team1添加IP配置即可。