Centos 7.0 Nic configuration and rename tutorial

Source: Internet
Author: User

Centos 7.0 Nic configuration and rename tutorial
After centos 7.0 is installed, the NIC is disabled by default, and the NIC name is changed. In centos 5 and earlier, the network card was named eth0 eth1. In the centos 6 era, the network card name changed to em1 em2, the bigger change appeared in the centos 7 era, and the NIC name changed directly to ens192 eno12312. The following describes how to configure the centos 7.0 Nic.
After the system is installed, enter the NIC configuration folder.

Here we can see that my Nic name is currently ifcfg-ens192
The last few lines of the vi ifcfg-ens192 are the configuration files you need to add yourself

 
 
  1. HWADDR = 00: 50: 56: bf: 00: 25
  2. TYPE = Ethernet
  3. BOOTPROTO = static # enable static IP addresses
  4. DEFROUTE = yes
  5. PEERDNS = yes
  6. PEERROUTES = yes
  7. 20174_failure_fatal = no
  8. IPV6INIT = yes
  9. IPV6_AUTOCONF = yes
  10. Required 6_defroute = yes
  11. IPV6_PEERDNS = yes
  12. 20176_peerroutes = yes
  13. 20176_failure_fatal = no
  14. NAME = ens192
  15. UUID = ae0965e7-22b9-45aa-8ec9-3f0a20a85d11
  16. ONBOOT = yes # enable automatic network connection to enable startup. Remember to modify
  17. IPADDR0 = 10.0.0.101 # Set the IP address
  18. PREFIXO0 = 24 # Set the subnet mask
  19. GATEWAY0 = 10.0.0.1 # Set the Gateway
  20. DNS1 = 202.102.152.3 # Set primary DNS
  21. DNS2 = 202.102.128.68 # Set the backup DNS. Here I write the dns server in Jinan. You can enter it as needed.
Save and exit.
Restart the NIC. Here you can use service network restart or the new centos7 command systemctl restart network. service.
Finally, check the NIC information and run the command systemctl status network. status.


Of course, the NIC name can be modified as needed, and can be changed to eth0 em1.
Edit the/etc/sysconfig/grub file and add "net. ifnames = 0 biosdevname = 0"


Run: grub2-mkconfig-o/boot/grub2/grub. cfg

Rename the file
Mv/etc/sysconfig/network-scripts/ifcfg-ens192/etc/sysconfig/network-scripts/ifcfg-eth0

Change the NAME = ens192 in the configuration file to the same NAME as above = eth0.
After the configuration is complete, restart the system and view the NIC configuration information ifocnfig

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.