centos激活网卡

centos如果是最小安装或者安装的时候网卡还没有接上线,默认网卡不会打开,不管执行什么操作都不可用,会报如下错误

$ ifup enp6s0f0
Error: Connection activation failed: No suitable device found for this connection (device enp131s0 not available because profile is not compatible with device (mismatching interface name)).

需要编辑如下配置

cd /etc/sysconfig/network-scripts
vi ifcfg-ens33

在这个目录下会有很多配置,有几个网卡就有几个配置,想打开哪个网卡就编辑哪一个
把ONBOOT从NO改为YES,保存退出,再执行

$ service NetworkManager restart

重启网卡,即可

posted @ 2022-07-27 09:38  秋来叶黄  阅读(1011)  评论(0编辑  收藏  举报