CentOS7Modify the NIC toEth01.Edit Network card information
[[Email protected]~]# cd/etc/sysconfig/network-scripts/ # Enter the NIC directory
[[Email protected]]# mv ifcfg-eno16777728 Ifcfg-eth0 # rename nic name
[[Email protected]]# cat Ifcfg-eth0 # edit nic Information]
Type=ethernet
Bootproto=static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Name=eth0 #name modified to eth0
Onboot=yes
ipaddr=192.168.56.12
netmask=255.255.255.0
gateway=192.168.56.2
dns1=192.168.56.2
2.ModifyGrub
[[Email protected]~]# cat/etc/sysconfig/grub # Edit Kernel info , add Red field
Grub_timeout=5
Grub_default=saved
Grub_disable_submenu=true
grub_terminal_output= "Console"
grub_cmdline_linux= "CRASHKERNEL=AUTORHGB net.ifnames=0 biosdevname=0 quiet"
Grub_disable_recovery= "true"
[[Email protected]~]# grub2-mkconfig-o/boot/grub2/grub.cfg # build boot Menu
Generatinggrub configuration file ...
Foundlinux Image:/boot/vmlinuz-3.10.0-229.el7.x86_64
FOUNDINITRD Image:/boot/initramfs-3.10.0-229.el7.x86_64.img
Foundlinux Image:/boot/vmlinuz-0-rescue-1100f7e6c97d4afaad2e396403ba7f61
FOUNDINITRD Image:/boot/initramfs-0-rescue-1100f7e6c97d4afaad2e396403ba7f61.img
Done
The installation system interface settings can also be loaded at boot start.
3.Verify that the modification was successful
[[Email protected]~]# reboot # must be restarted for system to take effect
[[Email protected]~]# yum install net-tools # default centos7 does not support ifconfig Need to see the net-tools bag
[[Email protected]~]# ifconfig eth0 # check nic information at times
Eth0:flags=4163<up,broadcast,running,multicast> MTU 1500
inet 192.168.56.12 netmask 255.255.255.0 broadcast 192.168.56.255
Inet6 fe80::20c:29ff:fe5c:7bb1 Prefixlen ScopeID 0x20<link>
Ether 00:0c:29:5c:7b:b1 Txqueuelen (Ethernet)
RX Packets Bytes 14503 (14.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX Packets 98 Bytes 14402 (14.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
content from operations and architecture classes Liang Wai Architect's Road Blog
Http://www.xuliangwei.com/xubusi/102.html
This article is from the "Old boy Linux ops" blog, please be sure to keep this source http://oldboy.blog.51cto.com/2561410/1722101
CentOS7 Modify the NIC name to Eth0