Name a network device in CentOS 7

Source: Internet
Author: User

Name a network device in CentOS 7

In CentOS 5, we were used to the names of network devices such as eth0. In CentOS 6, we found that network devices were named like em1. At that time, we added biosdevname = 0 to the startup parameter during installation, so that we can continue to use the eth0 name.

When CentOS 7 is reached, the original parameter biosdevname = 0 does not work, and the network device is named eno1. If you want to continue using a traditional name such as eth0, add the following parameters during installation and startup:

Net. ifnames = 0 biosdevname = 0

If you want to change the name to eth0 after the installation is complete, you need:

  • Modify grub2 startup parameters

Vi/etc/sysconfig/grub

GRUB_CMDLINE_LINUX = "rd. lvm. lv = vg0/swap vconsole. keymap = us crashkernel = auto vconsole. font = latarcyrheb-sun16 net. ifnames = 0 biosdevname = 0 rd. lvm. lv = vg0/usr rhgb quiet"

Grub2-mkconfig-o/boot/grub2/grub. cfg

  • Rename the file:

/Etc/sysconfig/network-scripts/ifcfg -*

The reason for this change in CentOS 7 is that systemd and udev introduce a new network device naming method-consistent network device naming (consistent network device naming ). You can set a fixed name based on the firmware, topology, and location information. The advantage is that naming is automated and the name is completely predictable. If the hardware breaks down, the change will not affect the device name, in this way, the hardware can be changed and merged. The disadvantage is that new device names are harder to read than traditional names. For example, the name is enp5s0.

For detailed naming rules, see the network guide.

For details, see:

  • RHEL 7 network Guide
  • Red Hat BUG965718

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.