centos中輸入ifconfig出現ens33,沒有eth0

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 rhgb quiet"  
  2. GRUB_DISABLE_RECOVERY="true"     

4.運行命令grub2-mkconfig -o /boot/grub2/grub.cfg 來重新生成GRUB配置並更新內核參數。

  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也有了

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章