Centos7 Nic configuration details

Source: Internet
Author: User
For centos7 users, the NIC naming rules become very strange, making the nic name completely different from the eth series naming method we were familiar with before, in this way, it is inconvenient to use or view it. next I will explain how to return to the traditional naming. for the newly installed centos7 system, we can use it #: ifconfig command to view the initial configuration information of the NIC. my nic name is eno16777736 & nb

For centos7 users, the NIC naming rules become very strange, making the nic name completely different from the eth series naming method we were familiar with before, in this way, it is inconvenient to use or view it. I will explain how to return to the traditional naming.

 

For the newly installed centos 7 system, we can use the #: ifconfig command to view the initial configuration information of the NIC. my nic name is eno16777736

 

 

Then, input the #: vim/etc/default/grub command in the command line to edit the environment variable value.

Add: net. ifnames = 0 to the GRUB_CMDLINE_LINU variable to disable the new naming rule.

After saving the file, you need to regenerate the grub configuration file and update the kernel parameters. Therefore, you need to run

# Grub2-mkconfig-o/etc/grub2.cfg such

 

After that, we must restart to take effect, and then run # ifconfig,

We can see that the nic name has been replaced by the traditional eht0 name.

Note: the address shown in the figure is automatically obtained.

In this way, we can use the methods earlier than centos7 to configure nic ip addresses and other information.

For example, we use

# Cd/etc/sysconfig/network-scripts/

# Ls

We can see that there is no configuration file information we want for the ifcfg-eth0 at this time,

Use the # mv ifcfg-eno16777736 ifcfg-eth0 to rename the Nic configuration information and then view it

Ifcfg-eth0 with files on it

Then # vim ifcfg-eth0 to enter the configuration interface, modify the configuration to save

It must be restarted to take effect.

In this way, the basic configuration of the centos7 Nic is complete, and then you can remotely access the server.

Related Article

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.