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
- HWADDR=00:50:56:bf:00:25
- TYPE=ethernet
- Bootproto=static #启用静态IP地址
- Defroute=yes
- Peerdns=yes
- Peerroutes=yes
- Ipv4_failure_fatal=no
- Ipv6init=yes
- ipv6_autoconf=yes
- Ipv6_defroute=yes
- Ipv6_peerdns=yes
- Ipv6_peerroutes=yes
- Ipv6_failure_fatal=no
- NAME=ens192
- UUID=ae0965e7-22b9-45aa-8ec9-3f0a20a85d11
- Onboot=yes #开启自动启用网络连接 Set boot start, be sure to remember to modify
- IPADDR0 =10.0.0.101 #设置IP地址
- PREFIXO0 =#设置子网掩码
- GATEWAY0 =10.0.0.1 #设置网关
- DNS1 =202.102.152.3 #设置主DNS
- 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