team--nmtui
删除之前的配置
[root@localhost Desktop]# nmcli connection delete team0
Connection 'team0' (38a63da2-abe8-4d9d-b2dc-53f9af9bd47a) successfully deleted.
[root@localhost Desktop]# nmcli connection delete team01
Connection 'team01' (3538da6f-b985-4001-b07b-d6b26dfedfa1) successfully deleted.
[root@localhost Desktop]# nmcli connection delete team02
Connection 'team02' (c715e960-bfac-426a-83d3-72c2f8da6285) successfully deleted.
[root@localhost Desktop]# nmcli connection show
NAME UUID TYPE DEVICE
Wired connection 2 7f080f4c-c3e7-484f-be42-fc248c8e5909 802-3-ethernet --
Wired connection 1 d5211d6d-2348-4cf7-ab0e-8a5e5492630c 802-3-ethernet --
eno16777736 ed486609-f625-4ac9-bd81-2768492fdb53 802-3-ethernet --
virbr0 b23c485d-8dda-47d6-93f4-4fcb0c690387 bridge virbr0
[root@localhost Desktop]# teamdctl team0 state
Device "team0" does not exist
edit a connection

add team(添加组)
edit team(编辑组)
添加slaves
添加slave1
添加slave2
添加完slave2完成
编辑JSON
设置activebackup

选择配置IP地址的模式为manual
配置IP地址-show
设置IP地址
设置完成后-ok退出
配置完成team后退出
查看组的信息
[root@localhost Desktop]# nmcli connection show
NAME UUID TYPE DEVICE
Ethernet connection 2 5cf092ea-9f9a-486f-a117-a951ca02dd7e 802-3-ethernet --
Ethernet connection 1 5017e66c-8c23-4a5e-a785-6d3783e30c23 802-3-ethernet eno16777736
virbr0 b23c485d-8dda-47d6-93f4-4fcb0c690387 bridge virbr0
Wired connection 2 7f080f4c-c3e7-484f-be42-fc248c8e5909 802-3-ethernet --
Wired connection 1 d5211d6d-2348-4cf7-ab0e-8a5e5492630c 802-3-ethernet eno33554944
eno16777736 ed486609-f625-4ac9-bd81-2768492fdb53 802-3-ethernet --
Team connection 1 8c0a1c2d-ce78-4ca3-bc78-e6e8c1763a16 team team0
查看网卡相关信息
[root@localhost Desktop]# ifconfig
eno16777736: flags=4163 mtu 1500
ether 00:0c:29:3c:01:c0 txqueuelen 1000 (Ethernet)
RX packets 1073 bytes 68253 (66.6 KiB)
RX errors 0 dropped 23 overruns 0 frame 0
TX packets 90 bytes 13475 (13.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno33554944: flags=4163 mtu 1500
inet 192.168.52.150 netmask 255.255.255.0 broadcast 192.168.52.255
inet6 fe80::20c:29ff:fe3c:1ca prefixlen 64 scopeid 0x20
ether 00:0c:29:3c:01:ca txqueuelen 1000 (Ethernet)
RX packets 1103 bytes 74463 (72.7 KiB)
RX errors 0 dropped 589 overruns 0 frame 0
TX packets 66 bytes 9946 (9.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
team0: flags=4163 mtu 1500
inet 192.168.52.147 netmask 255.255.255.0 broadcast 192.168.52.255
inet6 fe80::20c:29ff:fe3c:1c0 prefixlen 64 scopeid 0x20
ether 00:0c:29:3c:01:c0 txqueuelen 0 (Ethernet)
RX packets 61 bytes 3468 (3.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 27 bytes 4524 (4.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099 mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 00:00:00:00:00:00 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
注意此时两个网卡是不同的mac地址
启动Ethernet connection 2
[root@localhost Desktop]# nmcli connection up Ethernet\ connection\ 2
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/14)
启动后查看
[root@localhost Desktop]# ifconfig
eno16777736: flags=4163 mtu 1500
ether 00:0c:29:3c:01:c0 txqueuelen 1000 (Ethernet)
RX packets 1534 bytes 96872 (94.6 KiB)
RX errors 0 dropped 23 overruns 0 frame 0
TX packets 98 bytes 14289 (13.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno33554944: flags=4163 mtu 1500
ether 00:0c:29:3c:01:c0 txqueuelen 1000 (Ethernet)
RX packets 1566 bytes 103109 (100.6 KiB)
RX errors 0 dropped 592 overruns 0 frame 0
TX packets 70 bytes 10587 (10.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
team0: flags=4163 mtu 1500
inet 192.168.52.147 netmask 255.255.255.0 broadcast 192.168.52.255
inet6 fe80::20c:29ff:fe3c:1c0 prefixlen 64 scopeid 0x20
ether 00:0c:29:3c:01:c0 txqueuelen 0 (Ethernet)
RX packets 522 bytes 25633 (25.0 KiB)
RX errors 0 dropped 3 overruns 0 frame 0
TX packets 35 bytes 5272 (5.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099 mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 00:00:00:00:00:00 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
注意这个时候两块网卡的mac地址已经变成一样的
查看team0的状态
[root@localhost Desktop]# teamdctl team0 state
setup:
runner: activebackup
ports:
eno16777736
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
eno33554944
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: eno16777736
关掉eno16777736对应的slave
[root@localhost Desktop]# nmcli connection down team01
Error: 'team01' is not an active connection.
Error: no active connection provided.
第一次失败,因为没有这个team01
继续关
[root@localhost Desktop]# nmcli connection down
apath Ethernet\ connection\ 2 id Team\ connection\ 1 virbr0
Ethernet\ connection\ 1 help path uuid
[root@localhost Desktop]# nmcli connection down Ethernet\ connection\ 1
Connection 'Ethernet connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)
[root@localhost Desktop]# teamdctl team0 state
setup:
runner: activebackup
ports:
eno33554944
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: eno33554944
关掉成功
开启Ethernet connection 1
[root@localhost Desktop]# nmcli connection up Ethernet\ connection\ 1
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/15)
[root@localhost Desktop]# teamdctl team0 state
setup:
runner: activebackup
ports:
eno16777736
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
eno33554944
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: eno33554944
开启成功
重启网络
[root@localhost Desktop]# systemctl restart network
查看 Team connection 1的IP地址信息
[root@localhost Desktop]# nmcli connection show Team\ connection\ 1 | grep ip
ipv4.method: manual
ipv4.dns:
ipv4.dns-search:
ipv4.addresses: 192.168.10.30/24
ipv4.gateway: --
ipv4.routes:
ipv4.route-metric: -1
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.never-default: no
ipv4.may-fail: yes
ipv6.method: auto
ipv6.dns:
ipv6.dns-search:
ipv6.addresses:
ipv6.gateway: --
ipv6.routes:
ipv6.route-metric: -1
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.ip6-privacy: -1 (unknown)
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
[root@localhost Desktop]# nmcli connection show Team\ connection\ 1 | grep ipv4.address
ipv4.addresses: 192.168.10.30/24
[root@localhost Desktop]#