vmware15pro安装的centos8中没有出现eth0网卡,也没有ip,不能上网,输入ifconfig,显示ens33

解决办法

1.编辑网卡的配置文件 vi /etc/sysconfig/network-scripts/ifcfg-ens33 将里面的NAME和DEVICE项修改为eth0,NOBOOY需修改为yes 

  1. NAME=eth0  
  2. UUID=972a1eb3-049f-4db2-80f5-7d8fd28ef76f  
  3. DEVICE=eth0  
  4. ONBOOT=yes  

2.重命名网卡配置文件ifcfg-ens33为ifcfg-eth0

  1. [root@localhost ~]# cd /etc/sysconfig/network-scripts/  
  2. [root@localhost network-scripts]# mv ifcfg-ens33 ifcfg-eth0  

3.编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”到GRUBCMDLINELINUX变量  

  1. GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0
  2. GRUB_DISABLE_RECOVERY="true"     

4.运行命令grub2-mkconfig -o /boot/grub2/grub.cfg

  1. [root@localhost network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg  
  2. Generating grub configuration file ...  
  3. Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64  
  4. Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img  
  5. Found linux image: /boot/vmlinuz-0-rescue-b7f83ca165964a47b8b283907b126140  
  6. Found initrd image: /boot/initramfs-0-rescue-b7f83ca165964a47b8b283907b126140.img  
  7. done  

5.重启系统reboot

6.输入ifconfig验证eth0,ip也有了