# 查看物理网卡信息 [root@localhost ~]# nmcli dev DEVICE TYPE STATE CONNECTION eno16777736 ethernet connected eno16777736 eno33554984 ethernet connected Wired connection 1 eno50332208 ethernet connected Wired connection 2 lo loopback unmanaged --
# 查看网卡连接信息 [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE Wired connection 2 9a1314bf-d273-406a-930a-dc4160dee4ec 802-3-ethernet eno50332208 Wired connection 1 47eef4a3-7fa4-4a73-83ef-1485bda9b950 802-3-ethernet eno33554984 eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
# 首先,删除两个无用的有线连接 [root@localhost ~]# nmcli con del 9a1314bf-d273-406a-930a-dc4160dee4ec Connection 'Wired connection 2' (9a1314bf-d273-406a-930a-dc4160dee4ec) successfully deleted. [root@localhost ~]# nmcli con del 47eef4a3-7fa4-4a73-83ef-1485bda9b950 Connection 'Wired connection 1' (47eef4a3-7fa4-4a73-83ef-1485bda9b950) successfully deleted.
# 再次创建新的连接并生成配置文件 [root@localhost ~]# nmcli conn add type ethernet con-name eno50332208 ifname eno50332208 Connection 'eno50332208' (eea2a115-63f8-4f33-be84-12559f02542c) successfully added. [root@localhost ~]# nmcli conn add type ethernet con-name eno33554984 ifname eno33554984 Connection 'eno33554984' (32d2389e-4e82-4419-9d18-5aff8f0be003) successfully added.
# 最后,查看下 [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984 eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208 [root@localhost ~]# ll /etc/sysconfig/network-scripts/ifcfg-eno* -rw-r--r--. 1 root root 394 Nov 26 05:59 /etc/sysconfig/network-scripts/ifcfg-eno16777736 -rw-r--r--. 1 root root 288 Dec 26 08:44 /etc/sysconfig/network-scripts/ifcfg-eno33554984 -rw-r--r--. 1 root root 288 Dec 26 08:44 /etc/sysconfig/network-scripts/ifcfg-eno50332208
# 使用nmcli命令操作,创建team接口team0,同时设置teaming模式为roundrobin
[root@localhost ~]# nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name": "roundrobin"}}'
Connection 'team0' (9dc48bd6-54b9-48db-b7dd-ecf34ae9196f) successfully added.
# 给接口team0设置ip地址 [root@localhost ~]# nmcli con modify team0 ipv4.address '10.0.0.2/24' ipv4.gateway '10.0.0.1' # 设置为手动模式,取消DHCP [root@localhost ~]# nmcli con modify team0 ipv4.method manual
# 将两张物理网卡加入到team中 [root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0 Connection 'team0-port1' (22d3640e-f5c8-499c-b0dd-913c8970d800) successfully added. [root@localhost ~]# nmcli con add type team-slave con-name team0-port2 ifname eno50332208 master team0 Connection 'team0-port2' (12660d2a-0e1f-41e6-96b2-53de4fc6b78c) successfully added. [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE team0-port2 12660d2a-0e1f-41e6-96b2-53de4fc6b78c 802-3-ethernet -- eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 team0-port1 22d3640e-f5c8-499c-b0dd-913c8970d800 802-3-ethernet -- team0 9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team team0 eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984 eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208
# 查看team0的状态 [root@localhost ~]# teamdctl team0 st setup: runner: roundrobin
# 通过直接查看网卡发现team0并没有启动 [root@localhost ~]# ip a | grep team0 5: team0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN # 使用ifup 启动team0并没有成功,继续排查 [root@localhost ~]# ifup team0 [root@localhost ~]# ip a | grep team0 5: team0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
# 发现team0-port1 team0-port2没有添加成功物理网卡,怎么回事呢? [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE team0-port2 ec96c1e1-d268-4ba1-a2f9-0133a9f02655 802-3-ethernet -- eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 team0-port1 22d3640e-f5c8-499c-b0dd-913c8970d800 802-3-ethernet -- team0 9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team team0 eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984 eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208
# 删除掉 [root@localhost ~]# nmcli con del team0-port1 Connection 'team0-port1' (22d3640e-f5c8-499c-b0dd-913c8970d800) successfully deleted. [root@localhost ~]# nmcli con del team0-port2 Connection 'team0-port2' (ec96c1e1-d268-4ba1-a2f9-0133a9f02655) successfully deleted. # 删除两张物理网卡的连接 [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 team0 9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team team0 eno33554984 32d2389e-4e82-4419-9d18-5aff8f0be003 802-3-ethernet eno33554984 eno50332208 eea2a115-63f8-4f33-be84-12559f02542c 802-3-ethernet eno50332208 [root@localhost ~]# nmcli con del eno33554984 eno50332208 Connection 'eno33554984' (32d2389e-4e82-4419-9d18-5aff8f0be003) successfully deleted. Connection 'eno50332208' (eea2a115-63f8-4f33-be84-12559f02542c) successfully deleted. # 删除成功 [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 team0 9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team team0
# 再次将两张物理网卡添加到team [root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0 Connection 'team0-port1' (0331ea43-95c0-4106-b388-8484d4c3940d) successfully added. [root@localhost ~]# nmcli con add type team-slave con-name team0-port2 ifname eno50332208 master team0 Connection 'team0-port2' (880f2146-fe93-42dd-8d28-7d0dd50b4011) successfully added. [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE team0-port1 0331ea43-95c0-4106-b388-8484d4c3940d 802-3-ethernet eno33554984 eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 team0 9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team team0 team0-port2 880f2146-fe93-42dd-8d28-7d0dd50b4011 802-3-ethernet eno50332208
# 现在查看team0的状态就出现了,模式是:roundrobin
[root@localhost ~]# teamdctl team0 st
setup:
runner: roundrobin
ports:
eno33554984
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
eno50332208
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
[root@localhost ~]# teamdctl team0 st
setup:
runner: roundrobin
ports:
eno33554984
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
eno50332208
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
[root@localhost ~]# nmcli con del team0-port1
Connection 'team0-port1' (0331ea43-95c0-4106-b388-8484d4c3940d) successfully deleted.
[root@localhost ~]# nmcli con sh
NAME UUID TYPE DEVICE
eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736
team0 9dc48bd6-54b9-48db-b7dd-ecf34ae9196f team team0
team0-port2 880f2146-fe93-42dd-8d28-7d0dd50b4011 802-3-ethernet eno50332208
[root@localhost ~]# teamdctl team0 st
setup:
runner: roundrobin
ports:
eno50332208
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
[root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0
Connection 'team0-port1' (59acd6bf-affc-4994-a050-83c45816859a) successfully added.
[root@localhost ~]#
[root@localhost ~]# teamdctl team0 st
setup:
runner: roundrobin
ports:
eno33554984
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
eno50332208
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
[root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE team0-port2 2a1aa534-e021-4452-bb0a-2002dabcbc08 802-3-ethernet eno50332208 team0-port1 9a10c9ef-ee9c-4151-9a47-59b4668e8934 802-3-ethernet -- eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 team0 c2278f3f-5c6b-4e1d-b925-514d3c3832b6 team team0 [root@localhost ~]# nmcli con del team0 team0-port1 team0-port2 Connection 'team0' (c2278f3f-5c6b-4e1d-b925-514d3c3832b6) successfully deleted. Connection 'team0-port1' (9a10c9ef-ee9c-4151-9a47-59b4668e8934) successfully deleted. Connection 'team0-port2' (2a1aa534-e021-4452-bb0a-2002dabcbc08) successfully deleted. [root@localhost ~]# nmcli con sh NAME UUID TYPE DEVICE eno16777736 51d00668-2cf5-41da-ad8d-5019d62e98ad 802-3-ethernet eno16777736 # 以上操作就删除了roundrobin模式,恢复到初始状态。
# 添加逻辑网卡team0,并启用activebackup模式
[root@localhost ~]# nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}'
Connection 'team0' (f0794e59-419d-4c2a-96b9-464610b6321a) successfully added.
# 绑定ip
[root@localhost ~]# nmcli con modify team0 ipv4.address 192.168.118.122/24 ipv4.gateway 192.168.118.1
[root@localhost ~]# nmcli con modify team0 ipv4.method manual
# 添加物理网卡到activebackup模式
[root@localhost ~]# nmcli con add type team-slave con-name team0-port1 ifname eno33554984 master team0
Connection 'team0-port1' (52656904-6e85-4a04-98b4-2b19773fa290) successfully added.
[root@localhost ~]# nmcli con add type team-slave con-name team0-port2 ifname eno50332208 master team0
Connection 'team0-port2' (44d96e3a-014a-481f-9122-4ca2d3be9f7a) successfully added.
[root@localhost ~]# teamdctl team0 st
setup:
runner: activebackup
ports:
eno33554984
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
eno50332208
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: eno33554984
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有