Linux - CentOS Linux Solves Device eth0 does not seem to be present

Keywords: network Mac

For reprint, please indicate the source: https://blog.csdn.net/l1028386804/article/details/80939203

ifconfig... did not see eth0.. Then restart the network card and report the following error.

Fault phenomenon

service network restart
Shutting down loopback insterface:                                                                                                     [  OK  ]
Bringing up loopback insterface:                                                                                                          [  OK  ]
Bringing up interface eth0:  Device eth0 does not seem to be present,delaying initialization.                    [FAILED]

Solution

Scheme 1

First, open / etc/udev/rules.d/70-persistent-net.rules as shown in the following example:

# vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8f:89:97", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:17", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
Record the mac address of eth1 network card at 00:0c:29:50:bd:17

Next, open / etc/sysconfig/network-scripts/ifcfg-eth0

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Change DEVICE="eth0" to DEVICE="eth1".
Change HWADDR="00:0c:29:8f:89:97" to the mac address above, HWADDR="00:0c:29:50:bd:17"

Finally, restart the network

# service network restart
//perhaps
# /etc/init.d/network restart
It's normal.

Option two

First, open / etc/udev/rules.d/70-persistent-net.rules as shown in the following example:

# vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8f:89:97", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:17", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Here, we modify the 70-persistent-net.rules file to change the Mac address of eth0 to the Mac address of eth1, that is, 00:0c:29:8f:89:97 to 00:0c:29:50:bd:17. At the same time, we delete the following information:

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:17", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

The modified 70-persistent-net.rules file is as follows:

# vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:17", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Next, open / etc/sysconfig/network-scripts/ifcfg-eth0

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Change HWADDR="00:0c:29:8f:89:97" to the mac address above, HWADDR="00:0c:29:50:bd:17"

Finally, restart the network

# service network restart
//perhaps
# /etc/init.d/network restart
It's normal.

If there are still problems after operation according to scheme 2, we will restart the system directly and then it will be normal. Anyway, I'm normal after restarting the system.


Posted by den160593 on Mon, 04 Feb 2019 20:33:15 -0800