个人博客:​​https://suveng.github.io/blog/​

1. 环境


win10 + VMware14
centos7 minimal


2. 过程

lz想装个centos minimal 来玩玩,结果发现装完虚拟机竟然没有网络,用 ​​ifconfig​​ 还看不了,因为没有这条命令。发现​​ip address​​ 也可以看网络的一些信息。

正常的虚拟机装完后用主机模式是可以上网的,但是centos minimal 不行,原因是没有开启网卡。

现在开始启动网卡


  1. 修改/etc/sysconfig/network-script/网卡配置文件 (这里看你的网卡,很有可能不是eth0,lz的就是ifcfg-ens33 ​​vi /etc/sysconfig/network-script/ifcfg-ens33​centos7 minimal  虚拟机 配置网络_个人博客
  2. 修改配置,将onboot=no 改成yes
    centos7 minimal  虚拟机 配置网络_个人博客_02
  3. 重启一下网卡 ​​/etc/init.d/network restart​centos7 minimal  虚拟机 配置网络_个人博客_03
  4. 查看ip ​​ip address​centos7 minimal  虚拟机 配置网络_重启_04
  5. ping ​​baidu.com​centos7 minimal  虚拟机 配置网络_个人博客_05
    可以上网了