CentOS ifcfg网络设置 物理端口会变动的问题

分类:技术 1.24k浏览

遇到一些机器,第二网卡预设的时候是 eno2,默认直接编辑 ifcfg-eno2 加入参数即可,但使其生效时会提示:

Restarting network (via systemctl):  Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journalctl -xe” for details.

看详细错误提示:

Nov 27 13:30:52 AI04P14-A network[9320]: Bringing up interface eno2:  Error: Connection activation failed: No suitable device found for this connection (device eth1 not available because profile is not compatible with dev…interface name)).

执行 ip addr 看 第二网卡变成了 eth1 。

所以ifcfg-eno2 内要把

DEVICE=eno2

改为

DEVICE=eth1

再重启即可