/sbin/ifup: configuration for eth0 not found.

在linux系统下配置网卡时出现了下面这个问题,
/sbin/ifup: configuration for eth0 not found.
Usage: ifup <device name>

以下是这个问题的解决方法。

经查询及参考/etc/sysconfig/network-scripts/ifup-eth文件,

     if is_bonding_device ${DEVICE} ; then
            for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
            is_ignored_file "$device" && continue
            /sbin/ifup ${device##*/}
            done
     fi

系统应该是在/etc/sysconfig/network-scripts/文件夹下查找device name的,可是我的这个文件夹下只有ifcfg-lo文件,没有ifcfg-eth0文件,这应该就是原因吧。我发现/etc/sysconfig/networking/devices目录下存在一个ifcfg-eth0文件,打开一看,就是所要求的配置文件啦。遂cp了一份到/etc/sysconfig/network-scripts/文件夹下。
再在网络配置工具里激活eth0网卡,ok!





问题二:

Device eth0 has different MAC address than expected
这个问题应该是dmesg 和 eth0 配置文件之间的冲突。



[root@localhost ~]# dmesg | grep eth0
divert: allocating divert_blk for eth0
eth0: RTL-8139C+ at 0xd0842000, 00:16:36:61:61:98, IRQ 11

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=54:52:00:34:63:61
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.122.101
NETMASK=255.255.255.0
GATEWAY=192.168.122.1
DNS1=192.168.122.1

改正很简单,去掉HWADDR=54:52:00:34:63:61 即可。这样网卡就可以生效了。

猜你喜欢

转载自doublegenius.iteye.com/blog/894734