天天看點

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位址的解決辦法