我的Centos网卡默认是ens33

第一步:

-scripts/ifcfg-eth0

第二步:

只需要将最后一项:

no 改成 yes

保存退出

第三步:

重启网卡服务:

.d/network restart

ifconfig只有,就会显示出ipv4。