在虛擬機(jī)中最小安裝centos7后使用ifconfig
命令查詢ip時提示ifconfig :command not fond`
[root@localhost ~]# ifconfig
-bash: ifconfig: command not found
這種情況可以使用ip addr
查詢ip
當(dāng)然暫時是查不到ip的,需要先激活網(wǎng)卡
[root@localhost ~]# cd /etc/sysconfig/network-scripts
將對應(yīng)網(wǎng)卡的ONBOOT
由no
改為yes
,然后重啟網(wǎng)卡
[root@localhost ~]# service network restart
然后使用ip addr
就可以查看到虛擬機(jī)ip了