Centos7 the NIC name defaults to ENOXXX when the installation is complete, the familiar ethx is not, always feel strange. If the ifconfig command is not found in the minimized installation, install the Net-tools package. The steps to change are as follows:
-
[[email protected] ~] #vi/etc/sysconfig/network-scripts/ifcfg-enoxxx
HWADDR=00:0C:29:AF:BF:18
type=ethernet
BOOTPROTO=dhcp
defroute=yes
peerdns=yes
PEERROUTES=YES
NAME=enoXXX / /change enoxxx here to ethx
uuid=17cdd976-0b81-4286-80cf-185ec95f5ae8
onboot=no ///To change No to Yes
-
[[Email protected] ~] #cd/etc/sysconfig/network-scripts
[[Email protected] ~] #mv ifcfg-enoxxx Ifcfg-eth0
-
[Email protected] ~]# Vi/etc/default/grub
Grub_timeout=5
Grub_distributor= "$ (SED ' s, release. *$,,g '/etc/system-release)"
Grub_default=saved
Grub_disable_submenu=true
grub_terminal_output= "Console"
grub_cmdline_linux= "Vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun16 net.ifnames=0 Biosdevname=0 RHGB Quiet "
Grub_disable_recovery= "true"//Add two parameters marked in red
-
//execute this command to reload under Grub configuration
Generating Grub Configuration file ...
Found Linux Image:/boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd Image:/boot/initramfs-3.10.0-123.el7.x86 _64.img
Warning:please don ' t use the old title ' CentOS Linux, with the Linux 3.10.0-123.el7.x86_64 ' for Grub_default, use ' ADV anced options for CentOS Linux>centos Linux, with Linux 3.10.0-123.el7.x86_64 ' (for versions before 2.00) or ' gnulinux- advanced-66b96693-051c-4021-85ef-5f7ef0f970e2>gnulinux-3.10.0-123.el7.x86_64- Advanced-66b96693-051c-4021-85ef-5f7ef0f970e2 ' (for 2.00 or later)
Found Linux Image:/boot/ vmlinuz-0-rescue-b6f54d97b52944738996d2d9aeb3d59b
Found initrd Image:/boot/ Initramfs-0-rescue-b6f54d97b52944738996d2d9aeb3d59b.img
Done
-
[email protected] ~]# reboot
After restarting the operating system, the name of the CENTOS7 network card is changed.
CentOS 7 nic Name change