CentOS 7 Network Adapter configuration detailed

Source: Internet
Author: User

For CENTOS7 users, the naming rules of the network card become very strange, so that the name of the network card with the former we are familiar with the ETH naming method is completely different, so whether it is used or look looks very inconvenient, the following I will give you a detailed explanation of how to return to the traditional naming up


for the newly installed CentOS 7 System, we can use the #:ifconfig command to view the initial configuration information of the NIC, my network card name is:eno16777736

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/79/D9/wKiom1acp_SBnPM4AAA0l83R084841.png "title=" 1.png " alt= "Wkiom1acp_sbnpm4aaa0l83r084841.png"/>

We then type the #:vim/etc/default/grub command on the command line to edit the environment variable values.

and in the variable Grub_cmdline_linu Join : net.ifnames=0 To disable the new naming convention

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/79/D9/wKiom1acqAaC7AWWAAAiqu0Hbrw672.png "title=" 2.png " alt= "Wkiom1acqaac7awwaaaiqu0hbrw672.png"/>

after saving , we need to regenerate the grub configuration file and update the kernel parameters so we need to run

#grub2-mkconfig–o/etc/grub2.cfg such as

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/79/D7/wKioL1acqErBod7dAAAlG8B0Os8055.png "title=" 3.png " alt= "Wkiol1acqerbod7daaalg8b0os8055.png"/>

then we have to reboot to take effect, then run #ifconfig after reboot,

you can see that the NIC name has been returned to the traditional eht0 name.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/79/D7/wKioL1acqFmS-05qAAA5KEErRIE660.png "title=" 4.png " alt= "Wkiol1acqfms-05qaaa5keerrie660.png"/>

Note: The address in the figure is automatically acquired

so that we can use the Centos7 previous version of the method to configure the network card IP and other information

If we use

#cd/etc/sysconfig/network-scripts/

#ls

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

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/D9/wKiom1acqCzgcowXAAAqWugUkkY948.png "title=" 5.png " alt= "Wkiom1acqczgcowxaaaqwugukky948.png"/>

use the #mv ifcfg-eno16777736 ifcfg-eth0 To rename the NIC configuration information, and then look at

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/79/D9/wKiom1acqDigmVHxAAAp5w_K56U791.png "title=" 6.png " alt= "Wkiom1acqdigmvhxaaap5w_k56u791.png"/>

The Ifcfg-eth0 mate file is there.

then #vim ifcfg-eth0 into the configuration interface, modify the configuration to save

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/79/D7/wKioL1acqHuwE5ZJAAAl2w4KZF8942.png "title=" 7.png " alt= "Wkiol1acqhuwe5zjaaal2w4kzf8942.png"/>

Must be restarted to take effect, after reboot

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/D9/wKiom1acqEzSQTFHAAA7Z5hN7L0049.png "title=" 8.png " alt= "Wkiom1acqezsqtfhaaa7z5hn7l0049.png"/>

This allows the basic configuration of the Centos7 NIC to be completed, and then the server can be accessed remotely.


CentOS 7 Network Adapter configuration detailed

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.