CentOS 7.0 network adapter configuration and renaming tutorial

Source: Internet
Author: User

When the CentOS 7.0 installation is complete, the NIC is not powered on by default, and the name of the NIC is changed. In CentOS 5 and the previous system Nic named eth0 eth1 such name, and to the CentOS 6 era the name of the network card changed to EM1 em2 such name, the larger changes appear in the CentOS 7 era, the name of the network card changed directly into ens192 The appearance of eno12312 and so on. The following is specific to the CentOS 7.0 network adapter configuration operation.
System installation Complete, enter the network card configuration folder

Here you can see the name of My network card is currently ifcfg-ens192
VI ifcfg-ens192 The last few lines are the configuration files that you need to add yourself

Click ( here) to collapse or open

  1. HWADDR=00:50:56:bf:00:25
  2. TYPE=ethernet
  3. Bootproto=static #启用静态IP地址
  4. Defroute=yes
  5. Peerdns=yes
  6. Peerroutes=yes
  7. Ipv4_failure_fatal=no
  8. Ipv6init=yes
  9. ipv6_autoconf=yes
  10. Ipv6_defroute=yes
  11. Ipv6_peerdns=yes
  12. Ipv6_peerroutes=yes
  13. Ipv6_failure_fatal=no
  14. NAME=ens192
  15. UUID=ae0965e7-22b9-45aa-8ec9-3f0a20a85d11
  16. Onboot=yes #开启自动启用网络连接 Set boot start, be sure to remember to modify
  17. IPADDR0 =10.0.0.101 #设置IP地址
  18. PREFIXO0 =#设置子网掩码
  19. GATEWAY0 =10.0.0.1 #设置网关
  20. DNS1 =202.102.152.3 #设置主DNS
  21. DNS2 =202.102.128.68 #设置备DNS I write here is the DNS server in Jinan, you can fill in according to their own needs

Save exit.
Restart the NIC here you can use the service network restart or you can use the CENTOS7 new command systemctl restart Network.service
Finally look at the information of the network card using the command systemctl status Network.status


Of course, the name of the network card can be modified according to their own needs, can be changed to eth0 EM1, etc.
Edit/etc/sysconfig/grub file contents, add "net.ifnames=0 biosdevname=0"


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

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

Note Modify the name =ens192 in the configuration fileto be the same as the one above. Name=eth0
After the configuration is complete, restart the system to view the network card configuration information ifocnfig

CentOS 7.0 network adapter configuration and renaming tutorial

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.