Friday, June 15, 2012

Cannot get device settings No such device.


I had a strange problem. I had a Network card. When I do the command "ethtool eth0", I got this error information instead.

Settings for eth0:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available

Strange, I have ifcfg-eth0 file in /etc/sysconfig/network-script directory.

But if I take a closer look at /var/log/messages by using dmesg:
# dmesg |grep eth0

I see error
bnx2 0000:04:00.0: eth0: Broadcom NetXtreme II BCM5708 1000Base-T (B2) 
PCI-X 64-bit 133MHz found at mem c8000000, IRQ 18, node addr 00:14:5e:fd:6d:76
udev: renamed network interface eth0 to eth3

This issue is similar to "Device eth0 does not seem to be present" on cloned CentOS VM.
You have to go to /etc/udev/rules.d/70-persistent-net.rules and take a look

# PCI device 0x0000:0x0001 (bnx2)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:00:00:00:00:01", ATTR{type}=="1", 
KERNEL=="eth*", NAME="eth3"

(1a) One method is to simply rename your original ifcfg-eth0 file

# mv /etc/sysconfig/network-script/ifcfg-eth0 
/etc/sysconfig/network-script/ifcfg-eth3

(1b) Rename your  DEVICE parameter inside /etc/sysconfig/network-script/ifcfg-eth3
DEVICE="eth3"
...
...


(2) Another method is actually to clean up all the SUBSYSTEM Information and reboot. Hopefully, the eth0 is mapped back to /etc/sysconfig/network-script/ifcfg-eth0

(3) Or you could try modifying the /etc/udev/rules.d/70-persistent-net.rules and reboot.

# PCI device 0x0000:0x0001 (bnx2)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:00:00:00:00:01", ATTR{type}=="1", 
KERNEL=="eth*", NAME="eth3"

# PCI device 0x0000:0x0001 (bnx2)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:00:00:00:00:01", ATTR{type}=="1", 
KERNEL=="eth*", NAME="eth0"

Once you are done, reload the udev configuration. See Updating the udev configuration on CentOS

No comments: