1、现象:

通过ip addr 查找Ip时,发现ens33中没有inet属性,如下图:

centos 查看ip

2、解决方法

  打开网卡配置文件 /etc/sysconfig/network-scripts/ifcfg-ens33 ,将 ONBOOT 修改为 yes。

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

centos 查看ip

从配置文件看,centos7默认不启动网卡。

修改为 yes ,保存。

centos 查看ip

 

重启网络服务:

sudo service network restart 

centos 查看ip

 

然后查看,即可:

 centos 查看ip

 

相关文章: