在linux虚拟机中输入ifconfig命令,出现ifconfig comman not found,以下是排查过程:

1. cd /sbin然后ls,没找到ifconfig命令;

2.想通过yum install net-tools安装,发现出现以下问题

linux虚拟机ifconfig command not found

3.感觉像是访问不了外网导致的,然后尝试ping www.baidu.com,出现如下:

linux虚拟机ifconfig command not found

再尝试ping本地ip地址依然是同一个错误

4.可以确定是虚拟机网络设置有问题

5.检查一下网络配置,使用了nat模式,发现配置没什么问题

linux虚拟机ifconfig command not found

linux虚拟机ifconfig command not found

linux虚拟机ifconfig command not found

6.进入/etc/sysconfig/network-scripts/,查看网络配置文件ifcfg-ens33,发现onboot选项是no,然后改成yes,使用service network restart重启网络

linux虚拟机ifconfig command not found

7.再尝试ping baidu.com,此时可以收到网络响应了,意味着可以访问网络。

 

相关文章:

  • 2022-01-22
  • 2021-08-14
  • 2021-04-15
  • 2022-02-10
  • 2021-12-01
  • 2021-05-15
  • 2021-04-25
  • 2021-08-17
猜你喜欢
  • 2021-09-23
  • 2021-12-23
  • 2021-04-29
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案