1. 添加两块网卡
2.网卡设备和会话进行连接
3.网卡示例配置文件
cd /usr/share/doc/teamd/example_configs/
添加虚拟网卡
nmcli connection add type team con-name team0 ifname team0 config '{"runner": {"name": "activebackup"}}'
虚拟网卡要绑定真实网卡 需添加从接口,从设备
[root@localhost zx]# nmcli connection add type team-slave con-name team0-port1 ifname ens224 master team0
//con-name从设备对应的会话名 ifname指定真实设备 master主设备
Connection 'team0-port1' (0958c207-cd68-4127-a10c-4c2021c46025) successfully added.
[root@localhost zx]# nmcli connection add type team-slave con-name team0-port2 ifname ens256 master team0
Connection 'team0-port2' (c68d970b-f05d-467d-afbb-39f218c2e02e) successfully added.
//[root@localhost zx]# nmcli connection delete 删除
[root@localhost zx]# nmcli connection show //会话连接信息
NAME UUID TYPE DEVICE
team0 c455eea1-c47e-438d-9cb1-5b507db00cbb team team0
ens160 dd4b0fae-5dc8-44d0-8486-7109cdb5c190 ethernet ens160
Wired connection 1 6e311b9e-82f9-36af-b28f-60e2ce1bd4a2 ethernet ens256
Wired connection 2 bc5cb843-f26b-3ed2-b8d2-20af3cd99ee0 ethernet ens224
team0-port1 0958c207-cd68-4127-a10c-4c2021c46025 ethernet --
team0-port2 c68d970b-f05d-467d-afbb-39f218c2e02e ethernet --
激活从会话
[root@localhost zx]# nmcli connection up team0-port1
[root@localhost zx]# nmcli connection up team0-port2
激活主会话重新识别从会话
[root@localhost zx]# nmcli connection up team0
//会话文件位置[root@localhost zx]# vim /etc/sysconfig/network-scripts/ifcfg-team0
[root@localhost zx]# teamdctl team0 stat //查看指定设备状态信息
setup:
runner: activebackup
ports:
ens224
link watches:
link summary: up //正常
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ens256
link watches:
link summary: up //正常
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens224 //工作所选网卡
[root@localhost zx]# nmcli connection down team0-port1 //断开设备,ens256将激活
没了。