1.查询网卡状态
[root@localhost ~]# nmcli device status
DEVICE TYPE STATE CONNECTION
ens33 ethernet unmanaged --
lo loopback unmanaged --
上面状态提示未接管
2.启动网卡配置文件
手动设置的ens33的网卡配置文件的名字是static,所以这边启动网卡配置文件是static
[root@localhost ~]# nmcli connection up static
Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).
3.在启动网卡或者查询设备信息时都提示未接管,运行下面命令
开启网络
[root@localhost ~]# nmcli networking on
CentOS-Stream的系统也可以尝试下面的方式
[root@localhost ~]# nmcli device set ens33 managed yes
4.再次查询网卡状态、启动网卡配置文件
[root@localhost ~]# nmcli device status
DEVICE TYPE STATE CONNECTION
ens33 ethernet connected static
lo loopback unmanaged --
[root@localhost ~]# nmcli connection up static
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)