After CentOS mini is installed, no Nic or Nic becomes em1. Problem Solving

Source: Internet
Author: User

After CentOS mini is installed, no Nic or Nic becomes em1. Problem Solving

CentOS6.3 is the latest CentOS version and the latest Enterprise Edition that is synchronized with the Redhat version! After the mini installation is minimized today, the system restarts and the NIC is invisible to the system. ifconfig also displays only one local loose interface,

Check the NIC configuration file under/etc/sysconfig/network-scripts/, and no configuration file like ifcfg-eth0 was found, but there were two more configuration files like ifcfg-em1 and ifcfg-em2; is it hard for Linux to get closer to FreeBSD? The NIC code is also in the em format? Later, the following line of information was displayed in dmesg:

Kernel: udev: renamed network interface eth0 to em1

The original device management process of udev changed the default eth0 to em1 during the boot process. In fact, em1 corresponds to the original eth0 Nic of the system; because I did not configure the network during mini installation, the system does not activate the NIC by default, so ifconfig cannot see any Nic; you only need to set parameters in/etc/sysconfig/network-scripts/ifcfg-em1Change ONBOOT = no to yes, and then the service network restartThe network card em1 appears! The fixed IP configuration is also in this configuration file:

  1. DEVICE = em1
  2. BOOTPROTO = none
  3. HWADDR = 00: 26: b9: xx: b1: xx
  4. NM_CONTROLLED = yes
  5. ONBOOT = yes// Set yes to enable the NIC at startup
  6. TYPE = Ethernet
  7. UUID = "7799bca7-4a68-4619-a685-xxxxxxx2345"
  8. IPADDR = 192.168.2.80
  9. NETMASK = 255.255.255.0
  10. DNS2 = 8.8.8.8
  11. GATEWAY = 192.168.2.254
  12. DNS1 = 192.168.2.88
  13. IPV6INIT = no
  14. USERCTL = no

I always feel that the NIC code of Linux is not used to em1. It is also possible to restore it to the familiar eth0. Adjust the NIC naming rule configuration file of udev./Etc/udev/rules. d/70-persistent-net.rulesThe modification content is as follows:

  1. #PCIDevice0x14e4: 0x163b(Bnx2)(CustomNameProvidedByExternalTool)
  2. SUBSYSTEM = "net ",ACTION = "add ",DRIVERS = "? *",ATTR {address} = "00: 26: b9: 80: b1:
  3. A5 ",ATTR {type }== "1 ",KERNEL = "eth *",NAME = "em2"// Change to eth1
  4. #PCIDevice0x14e4: 0x163b(Bnx2)(CustomNameProvidedByExternalTool)
  5. SUBSYSTEM = "net ",ACTION = "add ",DRIVERS = "? *",ATTR {address} = "00: 26: b9: 80: b1:
  6. A4 ",ATTR {type }== "1 ",KERNEL = "eth *",NAME = "em1"// Change to eth0

My machine has two NICs, so this rule configuration file specifies the eth * Device identified by the kernel to em1 and em2 respectively (the em code starts from 1, em0 is not used by default. Here we only need to replace em1 and em2 with eth0 and eth1 respectively!

In this way, the system restores the NIC name to eth0, but we also need to modify the NIC configuration file. Otherwise, the network and IP configuration will not be applied to the eth0 Nic;

Rename the/etc/sysconfig/network-scripts/ifcfg-em1 file to/etc/sysconfig/network-scripts/ifcfg-eth0,

And change DEVICE = em1 to DEVICE = eth0 in the file.

If multiple NICs exist, modify them accordingly. Pay attention to the corresponding Nic code;

Restart the system. The familiar eth0 Nic is back, and the ipsettings take effect!

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.