天天看点

centos 7使用ifconfig命令ens33中没有IP地址的解决办法

问题:开始时用ifconfig命令是这样的,ens33中没有ip地址

centos 7使用ifconfig命令ens33中没有IP地址的解决办法

解决办法:

(一)先提升权限,输入命令sudo su

centos 7使用ifconfig命令ens33中没有IP地址的解决办法

(二)输入命令 cd /etc/sysconfig/network-scripts/

之后输入命令 cat ifcfg-ens33

centos 7使用ifconfig命令ens33中没有IP地址的解决办法

(三)用命令vim ifcfg-ens33进入。

将BOOTPPOTO=dhcp改成static

将ONBOOT=no改成yes

centos 7使用ifconfig命令ens33中没有IP地址的解决办法

(四)用命令 service network restart

centos 7使用ifconfig命令ens33中没有IP地址的解决办法

(五)输入 ifconfig,将看到ip地址

centos 7使用ifconfig命令ens33中没有IP地址的解决办法