在虚拟机中最小安装centos7后使用ifconfig
命令查询ip时提示ifconfig :command not fond`
[root@localhost ~]# ifconfig
-bash: ifconfig: command not found
这种情况可以使用ip addr
查询ip
当然暂时是查不到ip的,需要先激活网卡
[root@localhost ~]# cd /etc/sysconfig/network-scripts
将对应网卡的ONBOOT
由no
改为yes
,然后重启网卡
[root@localhost ~]# service network restart
然后使用ip addr
就可以查看到虚拟机ip了