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.