Linux 7模拟rac生产环境四张网卡的绑定—team方式

时间:2022-12-23 22:56:49

文档课题:Linux 7模拟rac生产环境四张网卡的绑定—team方式.
实验目标:实现网络高可用,防止一条网线或交换机故障影响物理机的数据交互.
实验系统:centos 7.9 64位
环境介绍:vmware虚拟机+公网网卡采用NAT模式,私网网卡采用仅主机模式.
team五种模式:broadcast(广播模式)、activebackup(主备模式)、roundrobin(轮训模式)、loadbalance(负载均衡),lacp模式:需要借助设备实现高级负载均衡,此次测试主备模式.
1、添加网卡
添加3块网卡,加上此前网卡共4块网卡.

Linux 7模拟rac生产环境四张网卡的绑定—team方式

如上所示:模式为NAT的两张网卡绑定后将用作公网IP,对外提供服务,仅主机模式的两张网卡绑定后用作心跳,以便两台服务器进行实时数据交互.
--网卡信息
[root@leo-11g-ogg:~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:85:eb:d1 brd ff:ff:ff:ff:ff:ff
inet 192.168.133.103/24 brd 192.168.133.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::6523:f251:6a24:3904/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:1e:bb:eb brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:1e:bb:eb brd ff:ff:ff:ff:ff:ff
5: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:85:eb:e5 brd ff:ff:ff:ff:ff:ff
inet 192.168.11.134/24 brd 192.168.11.255 scope global noprefixroute dynamic ens37
valid_lft 1672sec preferred_lft 1672sec
inet6 fe80::a83e:133d:60fa:62c4/64 scope link noprefixroute
valid_lft forever preferred_lft forever
6: ens38: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:85:eb:db brd ff:ff:ff:ff:ff:ff
inet 192.168.133.221/24 brd 192.168.133.255 scope global noprefixroute dynamic ens38
valid_lft 1672sec preferred_lft 1672sec
inet6 fe80::b90e:5b64:b5c1:fb9d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
7: ens39: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:85:eb:ef brd ff:ff:ff:ff:ff:ff
inet 192.168.11.135/24 brd 192.168.11.255 scope global noprefixroute dynamic ens39
valid_lft 1687sec preferred_lft 1687sec
inet6 fe80::890c:4103:de73:c2ab/64 scope link noprefixroute
valid_lft forever preferred_lft forever
注意:此时ens33、ens37、ens38、ens39 mac地址不同.
规划如下:
team0 ens33(192.168.133.103) ens38(192.168.133.221)
team1 ens37(192.168.11.134) ens39(192.168.11.135)
2、网卡绑定
此次测试主备模式,该模式表示一个网卡处于活跃状态,另一个处于备份状态,所有流量都在主链路上处理,当活跃网卡down掉时,启用备用网卡.此处测试将ens37、ens38绑定为team0.
2.1、team0网卡
2.1.1、创建team0网卡
[root@leo-11g-ogg:~]# nmcli con add type team con-name team0 ifname team0 config '{"runner": {"name":"activebackup","hwaddr_policy":"by_active"}}'
Connection 'team0' (e828d37e-8e27-447c-b402-2e6c9265f489) successfully added.
[root@leo-11g-ogg:~]# teamdctl team0 state
setup:
runner: activebackup
runner:
active port:
说明:配置后会产生以下两个东西.
a、ifname后的team0为虚拟网卡
b、con-name后的team0为连接,对外提供的IP为下文添加的192.168.133.103,其依赖于虚拟网卡ifname后的team0.
2.1.2、添加IP
[root@leo-11g-ogg:~]# nmcli con modify team0 ipv4.address 192.168.133.103/24 ipv4.gateway 192.168.133.2 ipv4.dns 192.168.133.2 ipv4.method manual
2.1.3、添加网卡
--添加物理网卡到team0.
[root@leo-11g-ogg:~]# nmcli con add type team-slave con-name team0-port1 ifname ens33 master team0
Connection 'team0-port1' (6e5df90c-d4f4-4502-a187-bffc3880894e) successfully added.
[root@leo-11g-ogg:~]# nmcli con add type team-slave con-name team0-port2 ifname ens38 master team0
Connection 'team0-port2' (6e39b747-a990-4676-b9e0-52acaa7a0e17) successfully added.
2.1.4、激活网卡
[root@leo-11g-ogg:~]# nmcli con up team0-port1
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)
[root@leo-11g-ogg:~]# nmcli con up team0-port2
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/9)
[root@leo-11g-ogg:~]# nmcli con up team0
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/11)
注意:
a、执行nmcli con up team0-port1后客户端将不能远程操作服务器,以上网卡激活是在服务器端执行.
b、先激活team-slave,然后在激活team.
2.1.5、网卡验证
--绑定网卡正常状态
[root@leo-11g-ogg:~]# teamdctl team0 stat
setup:
runner: activebackup
ports:
ens33
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ens38
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens33
2.1.5.1、ens33故障
--模拟ens33网卡发生故障
[root@leo-11g-ogg:~]# ifdown ens33
Device 'ens33' successfully disconnected.
[root@leo-11g-ogg:~]# teamdctl team0 stat
setup:
runner: activebackup
ports:
ens38
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens38
--windows端测试网卡连通性
C:\Users\Administrator>ping 192.168.133.103

正在 Ping 192.168.133.103 具有 32 字节的数据:
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64

192.168.133.103 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
说明:可以看到ens33发生故障,网络依然可以ping通.
2.1.5.2、ens38故障
--模拟ens38网卡故障
[root@leo-11g-ogg:~]# nmcli con up team0-port1
Device 'ens38' successfully disconnected.
[root@leo-11g-ogg:~]# teamdctl team0 stat
setup:
runner: activebackup
ports:
ens33
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ens38
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens38
[root@leo-11g-ogg:~]# ifdown ens38
Device 'ens38' successfully disconnected.
[root@leo-11g-ogg:~]# teamdctl team0 stat
setup:
runner: activebackup
ports:
ens33
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens33
--windows端测试网卡连通性
C:\Users\Administrator>ping 192.168.133.103

正在 Ping 192.168.133.103 具有 32 字节的数据:
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.133.103 的回复: 字节=32 时间<1ms TTL=64

192.168.133.103 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
说明:可以看到ens38发生故障,网络依然可以ping通.当同时断开ens33、ens38时,网络才会出现异常.
2.2、team1网卡
--创建team1网卡作为rac的心跳.
2.2.1、创建team1网卡
[root@leo-11g-ogg:~]# nmcli con add type team con-name team1 ifname team1 config '{"runner": {"name":"activebackup","hwaddr_policy":"by_active"}}'
Connection 'team1' (be670873-04b3-4ea8-aef0-83254f917426) successfully added.
[root@leo-11g-ogg:~]# teamdctl team1 state
setup:
runner: activebackup
runner:
active port:
2.2.2、添加IP
[root@leo-11g-ogg:~]# nmcli con modify team1 ipv4.address 192.168.11.134/24 ipv4.method manual
2.2.3、添加网卡
[root@leo-11g-ogg:~]# nmcli con add type team-slave con-name team1-port1 ifname ens37 master team1
Connection 'team1-port1' (536f1b90-6f93-48e3-ab8a-65546b847fc6) successfully added.
[root@leo-11g-ogg:~]# nmcli con add type team-slave con-name team1-port2 ifname ens39 master team1
Connection 'team1-port2' (d91fbd3b-5b91-4c2d-893b-e5eb1cb1fd13) successfully added.
2.2.4、激活网卡
[root@leo-11g-ogg:~]# nmcli con up team1-port1
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/19)
[root@leo-11g-ogg:~]# nmcli con up team1-port2
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/20)
[root@leo-11g-ogg:~]# nmcli con up team1
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/21)
2.2.5、网卡验证
[root@leo-11g-ogg:~]# teamdctl team1 stat
setup:
runner: activebackup
ports:
ens37
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ens39
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens37
2.2.5.1、ens37故障
[root@leo-11g-ogg:~]# ifdown ens37
Device 'ens37' successfully disconnected.
[root@leo-11g-ogg:~]# teamdctl team1 stat
setup:
runner: activebackup
ports:
ens39
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens39
--windows端测试连通性
C:\Users\Administrator>ping 192.168.11.134

正在 Ping 192.168.11.134 具有 32 字节的数据:
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64

192.168.11.134 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
说明:以上可知,即使down掉ens37,windows端依然能ping通.
2.1.5.2、ens39故障
[root@leo-11g-ogg:~]# nmcli con up team1-port1
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/24)
[root@leo-11g-ogg:~]# teamdctl team1 stat
setup:
runner: activebackup
ports:
ens37
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ens39
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens39
[root@leo-11g-ogg:~]# ifdown ens39
Device 'ens39' successfully disconnected.
[root@leo-11g-ogg:~]# teamdctl team1 stat
setup:
runner: activebackup
ports:
ens37
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens37
--windows端测试连通性
C:\Users\Administrator>ping 192.168.11.134

正在 Ping 192.168.11.134 具有 32 字节的数据:
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.11.134 的回复: 字节=32 时间<1ms TTL=64

192.168.11.134 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
说明:以上可知,即使down掉ens39,windows端依然能ping通.
[root@leo-11g-ogg:~]# ifdown ens37
Device 'ens37' successfully disconnected.
[root@leo-11g-ogg:~]# teamdctl team1 stat
setup:
runner: activebackup
runner:
active port:

C:\Users\Administrator>ping 192.168.11.134

正在 Ping 192.168.11.134 具有 32 字节的数据:
请求超时。
说明:同时down掉ens37、ens39,windows端无法ping通私网.
3、绑定后信息
--以下为网卡绑定后相关信息
3.1、IP信息
[root@leo-11g-ogg:~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team0 state UP group default qlen 1000
link/ether 00:0c:29:85:eb:d1 brd ff:ff:ff:ff:ff:ff
3: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1 state UP group default qlen 1000
link/ether 00:0c:29:85:eb:e5 brd ff:ff:ff:ff:ff:ff
4: ens38: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team0 state UP group default qlen 1000
link/ether 00:0c:29:85:eb:db brd ff:ff:ff:ff:ff:ff
5: ens39: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1 state UP group default qlen 1000
link/ether 00:0c:29:85:eb:ef brd ff:ff:ff:ff:ff:ff
6: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:1e:bb:eb brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:1e:bb:eb brd ff:ff:ff:ff:ff:ff
8: team0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:85:eb:d1 brd ff:ff:ff:ff:ff:ff
inet 192.168.133.103/24 brd 192.168.133.255 scope global noprefixroute team0
valid_lft forever preferred_lft forever
inet6 fe80::bc71:8b0:e3a9:481b/64 scope link noprefixroute
valid_lft forever preferred_lft forever
9: team1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:85:eb:e5 brd ff:ff:ff:ff:ff:ff
inet 192.168.11.134/24 brd 192.168.11.255 scope global noprefixroute team1
valid_lft forever preferred_lft forever
inet6 fe80::b58e:8180:288:90f8/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@leo-11g-ogg:~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:0c:29:85:eb:d1 txqueuelen 1000 (Ethernet)
RX packets 1864 bytes 227559 (222.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1631 bytes 233610 (228.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:0c:29:85:eb:e5 txqueuelen 1000 (Ethernet)
RX packets 38 bytes 4703 (4.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 65 bytes 5980 (5.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens38: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:0c:29:85:eb:db txqueuelen 1000 (Ethernet)
RX packets 705 bytes 75279 (73.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 263 bytes 26653 (26.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens39: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:0c:29:85:eb:ef txqueuelen 1000 (Ethernet)
RX packets 41 bytes 5173 (5.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 34 bytes 3604 (3.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2459 bytes 177541 (173.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2459 bytes 177541 (173.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

team0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.133.103 netmask 255.255.255.0 broadcast 192.168.133.255
inet6 fe80::bc71:8b0:e3a9:481b prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:85:eb:d1 txqueuelen 1000 (Ethernet)
RX packets 1775 bytes 192247 (187.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1455 bytes 207907 (203.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

team1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.11.134 netmask 255.255.255.0 broadcast 192.168.11.255
inet6 fe80::b58e:8180:288:90f8 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:85:eb:e5 txqueuelen 1000 (Ethernet)
RX packets 20 bytes 1640 (1.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 60 bytes 4588 (4.4 KiB)
TX errors 0 dropped 1 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:1e:bb:eb txqueuelen 1000 (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
注意:此种配置下当前实际使用的物理网卡与虚拟网卡team的mac地址相同,另外一张网卡的mac地址不同.
3.2、网卡文件
[root@leo-11g-ogg:/etc/sysconfig/network-scripts]# cat ifcfg-team0
TEAM_CONFIG="{\"runner\": {\"name\":\"activebackup\",\"hwaddr_policy\":\"by_active\"}}"
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=team0
UUID=e828d37e-8e27-447c-b402-2e6c9265f489
DEVICE=team0
ONBOOT=yes
DEVICETYPE=Team
IPADDR=192.168.133.103
PREFIX=24
GATEWAY=192.168.133.2
DNS1=192.168.133.2
[root@leo-11g-ogg:/etc/sysconfig/network-scripts]# cat ifcfg-team0-port1
NAME=team0-port1
UUID=6e5df90c-d4f4-4502-a187-bffc3880894e
DEVICE=ens33
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort
[root@leo-11g-ogg:/etc/sysconfig/network-scripts]# cat ifcfg-team0-port2
NAME=team0-port2
UUID=6e39b747-a990-4676-b9e0-52acaa7a0e17
DEVICE=ens38
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort
[root@leo-11g-ogg:/etc/sysconfig/network-scripts]# cat ifcfg-team1
TEAM_CONFIG="{\"runner\": {\"name\":\"activebackup\",\"hwaddr_policy\":\"by_active\"}}"
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=team1
UUID=be670873-04b3-4ea8-aef0-83254f917426
DEVICE=team1
ONBOOT=yes
DEVICETYPE=Team
IPADDR=192.168.11.134
PREFIX=24
[root@leo-11g-ogg:/etc/sysconfig/network-scripts]# cat ifcfg-team1-port1
NAME=team1-port1
UUID=536f1b90-6f93-48e3-ab8a-65546b847fc6
DEVICE=ens37
ONBOOT=yes
TEAM_MASTER=team1
DEVICETYPE=TeamPort
[root@leo-11g-ogg:/etc/sysconfig/network-scripts]# cat ifcfg-team1-port2
NAME=team1-port2
UUID=d91fbd3b-5b91-4c2d-893b-e5eb1cb1fd13
DEVICE=ens39
ONBOOT=yes
TEAM_MASTER=team1
DEVICETYPE=TeamPort
[root@leo-11g-ogg:~]# nmcli con show
NAME UUID TYPE DEVICE
team0 e828d37e-8e27-447c-b402-2e6c9265f489 team team0
team1 be670873-04b3-4ea8-aef0-83254f917426 team team1
virbr0 c7e4a001-265d-4d03-8d54-9829c96edb99 bridge virbr0
team0-port1 6e5df90c-d4f4-4502-a187-bffc3880894e ethernet ens33
team0-port2 6e39b747-a990-4676-b9e0-52acaa7a0e17 ethernet ens38
team1-port1 536f1b90-6f93-48e3-ab8a-65546b847fc6 ethernet ens37
team1-port2 d91fbd3b-5b91-4c2d-893b-e5eb1cb1fd13 ethernet ens39
ens33 f34a0cfd-d545-4c78-b6db-1664f7c9ca13 ethernet --
Wired connection 1 72ac9f8e-ca58-345a-8f05-39cb60af3c78 ethernet --
Wired connection 2 b193303c-3702-3582-9a63-0fa35c986c6a ethernet --
Wired connection 3 7a3243e9-90d8-34c4-b544-a6005b2f415c ethernet --
参考网址:
https://blog.csdn.net/m0_57156345/article/details/122467147?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-3-122467147-blog-120228524.pc_relevant_3mothn_strategy_and_data_recovery&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-3-122467147-blog-120228524.pc_relevant_3mothn_strategy_and_data_recovery&utm_relevant_index=6