centos7 ipaddr 无法查看虚拟机IP解决办法

一、问题

新安装的CentOS 7,ip addr查看不了IP地址

二、解决

原因: CentOS 7 默认是不启动网卡的

进入/etc/sysconfig/network-scripts/目录

[root@localhost etc]# cd /etc/sysconfig/network-scripts/

 打开第一项 ifcfg-ens33 有的可能不叫这个

[root@localhost network-scripts]# vi ifcfg-ens33

 利用vim编辑器将no改为yes

 

重启网络服务,再次使用ip addr即可看到ip了

[root@localhost network-scripts]# service network restart

 

参考:https://blog.csdn.net/wxx729418277/article/details/79130649

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注