centos9的网卡位置移动到了 /etc/NetworkManager/system-connections/ 下面
查看网卡
ifconfig

当前有两块网卡,我要去配置ens160的一个固定的ip,让其ip为192.168.6.20/24,网关为192.168.6.254.dns为:1.1.1.1
vim /etc/NetworkManager/system-connections/ens160.nmconnection

[connection]
id=ens160
uuid=44657eba-8ca8-31e6-b455-88d782c6c395
type=ethernet
autoconnect-priority=-999
interface-name=ens160
[ethernet]
[ipv4]
#method=auto
method=manual
address1=192.168.6.20/24,192.168.6.254
dns=1.1.1.1
[ipv6]
addr-gen-mode=eui64
method=auto
[proxy]
配置完数据后重启网卡
nmcli c reload ens160

这样就成功配置了网卡了