There is no ifconfig command in CentOS 7 and cannot be found eth0

Source: Internet
Author: User
Tags dmesg

1, because the installation is used to minimize the installation of CentOS 7, after the installation did not find the ifconfig command

There is no such command under Check/sbin. The root identity is used.

#yum install-y net-tools\*

Ifconfig can be successfully installed

[Email protected] ~]# Ls/sbin/if*/sbin/ifcfg/sbin/ifconfig/sbin/ifdown/sbin/ifenslave/sbin/ifstat/sbin/ifup

2, the installation process is not prompted to set up a network card, after installation has not found Ifcfg-eth0 configuration file.

[[email protected] ~]# ls /etc/sysconfig/network-scripts/ifcfg-eno16777736   ifdown-ib    ifdown-ppp       ifdown-tunnel   ifup-ib    ifup-plusb   ifup-team          network-functionsifcfg-lo            ifdown-ippp  ifdown-routes    ifup            ifup-ippp  ifup-post    ifup-TeamPort      network-functions-ipv6ifdown              ifdown-ipv6  ifdown-sit       ifup-aliases    ifup-ipv6  ifup-ppp     ifup-tunnelifdown-bnep         ifdown-isdn  ifdown-team      ifup-bnep       ifup-isdn  ifup-routes  ifup-wirelessifdown-eth          ifdown-post  ifdown-TeamPort  ifup-eth        ifup-plip  ifup-sit     init.ipv6-global

Using DMESG | grep-in ETH Check the boot information for any eth0 messages.

[Email protected] ~]# DMESG | Grep-in eth1688:[1.850428] e1000 0000:02:01.0 eth0: (pci:66mhz:32-bit) 00:0c:29:41:57:0b1689:[1.850433] e1000 000 0:02:01.0 Eth0:intel (R) pro/1000 Network Connection

The discovery was changed from interface eth0 to eno16777736

3, change the name of the network card-changed from eno16777736 to Eth0

[[email protected] ~]# vim/etc/default/grub grub_timeout=5 grub_distributor= "$ (SED ' s, release. *$,,g '/etc/system-r elease) "Grub_default=saved grub_disable_submenu=true grub_terminal_output=" console "grub_cmdline_linux=" Net.ifnam Es=0 crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet "grub_disable_recovery=" true "

Modify Grub_cmdline_linux in grub, append statement " net.ifnames=0 ".


Then execute # grub2-mkconfig-o/etc/grub2.cfg

After reboot # reboot

[Email protected] ~]# grub2-mkconfig-o/etc/grub2.cfg Generating grub configuration file ... Found Linux Image:/boot/vmlinuz-3.10.0-327.el7.x86_64found initrd Image:/boot/initramfs-3.10.0-327.el7.x86_64. Imgfound Linux Image:/boot/vmlinuz-0-rescue-4e4bd6a60e2f4848aa19b757b0d96522found initrd Image:/boot/ Initramfs-0-rescue-4e4bd6a60e2f4848aa19b757b0d96522.imgdone[[email protected] ~]# reboot

Check the NIC again and find that the name has changed.

[[Email protected] ~]# ifconfig eth0: flags=4163<up,broadcast,running,multicast >  mtu 1500        inet 192.168.1.124   netmask 255.255.255.0  broadcast 192.168.1.255         inet6 fe80::20c:29ff:fe41:570b  prefixlen 64  scopeid 0x20< Link>        ether 00:0c:29:41:57:0b  txqueuelen  1000   (Ethernet)         RX packets 124   bytes 13087  (12.7 kib)         rx errors  0  dropped 0  overruns 0  frame 0         TX packets 68  bytes 9617  (9.3 kib)           tx errors 0  dropped 0 overruns 0  carrier 0   collisions 0lo: flags=73<up,loopback,running>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10


However, you still need to rename/etc/sysconfig/network-scripts/ifcfg-eno16777736 to Ifcfg-eth0 and modify its contents to specify IP, NETMASK , and GATEWAY, while modifying onboot=no to Yes. Finally, the service restart network is executed.

[Email protected] ~]# cp-a ifcfg-eno16777736 ifcfg-eth0


There is no ifconfig command in CentOS 7 and cannot be found eth0

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.