Knowledgebase

如何修改CentOS 7.6的网卡名称

  • 0

 

  1. 修改grub文件,添加内核参数net.ifnames=0 biosdevname=0信息,使网卡名称修改为eth0
    1.  
      [root@192168088102-NFS-Server network-scripts]# cat /etc/sysconfig/grub
    2.  
      GRUB_TIMEOUT=5
    3.  
      GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    4.  
      GRUB_DEFAULT=saved
    5.  
      GRUB_DISABLE_SUBMENU=true
    6.  
      GRUB_TERMINAL_OUTPUT="console"
    7.  
      GRUB_CMDLINE_LINUX="crashkernel=auto rhgb net.ifnames=0 biosdevname=0 quiet"
    8.  
      GRUB_DISABLE_RECOVERY="true"
    1. 生成启动菜单,重新加载到启动中,并重启系统
      1.  
        [root@192168088102-NFS-Server network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg
      2.  
        Generating grub configuration file ...
      3.  
        Found linux image: /boot/vmlinuz-3.10.0-957.el7.x86_64
      4.  
        Found initrd image: /boot/initramfs-3.10.0-957.el7.x86_64.img
      5.  
        Found linux image: /boot/vmlinuz-0-rescue-dc723d2d2d444cf0ae3794ab211366b8
      6.  
        Found initrd image: /boot/initramfs-0-rescue-dc723d2d2d444cf0ae3794ab211366b8.img
      7.  
        done
      8.  
        [root@192168088102-NFS-Server network-scripts]# reboot
       

Was this answer helpful?

© Copyright 2019. CTG SERVER LTD