Linux modifies NIC name enss33 to Eth0--ubuntu16 and Centos7

Source: Internet
Author: User

The default NIC names for the newly installed Ubuntu16.04 and Centos7 are ens33. Want to change to eth0.

First, CentOS:

    1. Modify/etc/sysconfig/grub file (backup before modification)
      Add 2 parameters (Net.ifnames=0 biosdevname=0) for the grub_cmdline_linux variable, and the modification is done as follows:
      grub_cmdline_linux= "Crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 RHGB Quiet
      Notice that the spaces are separated before and after.
    2. Rebuilding the Grub configuration file
      Execute command: Grub2-mkconfig-o/boot/grub2/grub.cfg
    3. Modify/etc/sysconfig/network-scripts/ifcfg-ens33
      Modify the file name to Ifcfg-eth0
      Open the file and modify the name and device parameters to eth0.
    4. Rebooting the system
    5. Ifconfig, the discovery has been modified to complete

Second, Ubuntu

    1. Vim/etc/default/grub
      grub_cmdline_linux= "net.ifnames=0 biosdevname=0" (as in the first step above, add these two parameters)
    2. Rebuilding the Grub configuration file
      Execute command: Grub2-mkconfig-o/boot/grub2/grub.cfg
    3. There are some places on the Internet to modify the/etc/network/interfaces file, I do not change here. (There is only one Lo address)
    4. Rebooting the system
    5. Ifconfig, the discovery has changed to complete

Linux modifies NIC name enss33 to Eth0--ubuntu16 and Centos7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.