1.建立虚拟接口
#nmcli connection add con-name team0 type team ifname team0 config ‘{“runner”:{“name”:“activebackup”}}’
2.向虚拟接口添加网卡
#nmcli connection add con-name team0-enp1s0f0 type team-slave autoconnect no ifname enp1s0f0 master team0
#nmcli connection add con-name team0-enp1s0f1 type team-slave autoconnect no ifname enp1s0f1 master team0
3.设置虚拟接口IP
#nmcli connection modify team0 ipv4.addresses “192.168.0.100/24”
4.设置虚拟接口网关
#nmcli connection modify team0 ipv4.gateway “192.168.0.1”
5.断开物理接口链接
#nmcli device disconnect enp1s0f0
#nmcli device disconnect enp1s0f1
6.激活虚拟接口网卡
#nmcli connection up team0-enp1s0f0
#nmcli connection up team0-enp1s0f1
测试
#链接一个正常的网络(#ping 通网络地址),宕掉当前链接接口后需能自动切换至备用接口,网络仍然通畅不受影响。