今天启动 CentOS 6 发现 IP 自动改变了,网卡设备名称也变成了 eth1。
重启 网卡提示以下报错
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
[FAILED]
问题状态:
1、通过查看 IP 信息发现以前使用的 eth0 变成 eth1,可能是网卡有变动
[root@hexingxing ~]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:0C:29:02:E8:FB
inet addr:10.0.1.123 Bcast:10.0.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:e8fb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:167 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13868 (13.5 KiB) TX bytes:1943 (1.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:960 (960.0 b) TX bytes:960 (960.0 b)
2、查看网卡设备网络规则文件
[root@hexingxing ~]# cat /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 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:67:ee:c7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:02:e8:fb", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
问题描述:
1、通过查看网卡设备网络规则文件确认是有 eth1,说明是之前手动配置 IP 信息的 eth0 失效了,系统自动启用了 eth1 并使用 DHCP 自动获取 IP。
2、此时我们只要将原来的 eth0 配置为 eth1 的相关信息并启用 eth1 即可解决该问题。
解决方案:
1、将原来的 ifcfg-eth0 文件修改为 ifcfg-eth1
[root@hexingxing network-scripts]# mv ifcfg-eth0 ifcfg-eth1
[root@hexingxing network-scripts]# ls ##查看是否修改成功
ifcfg-eth1 ifdown-ippp ifdown-sit ifup-ib ifup-post init.ipv6-global
ifcfg-lo ifdown-ipv6 ifdown-tunnel ifup-ippp ifup-ppp net.hotplug
ifdown ifdown-isdn ifup ifup-ipv6 ifup-routes network-functions
ifdown-bnep ifdown-post ifup-aliases ifup-isdn ifup-sit network-functions-ipv6
ifdown-eth ifdown-ppp ifup-bnep ifup-plip ifup-tunnel
ifdown-ib ifdown-routes ifup-eth ifup-plusb ifup-wireless
2、在 ifcfg-eth1 文件中将 DEVICE="eth0" 修改为 DEVICE="eth1"
[root@hexingxing network-scripts]# cat ifcfg-eth1
DEVICE="eth1" ##将之前的 eth0 改为 eth1
BOOTPROTO="static"
HWADDR="00:0C:29:67:EE:C7"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="536203db-b01e-4646-b622-23ce22265d50"
IPADDR=10.0.1.85
NETMASK=225.225.225.0
GATEWAY=10.0.1.255
3、重启网卡,解决问题。
[root@hexingxing network-scripts]# service network restart
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth1: Determining if ip address 10.0.1.85 is already in use for device eth1...
[ OK ]
友情提示:本站所有文章,如无特殊说明或标注,均为何星星原创发布。与此同时,趋于近年来本站的文章内容频繁被他站盗用与机器采集,现已全局禁用网站文字内容操作,了解详情或转载文章请 点此 继续!
1 条评论
CentOS 6 弹出界面eth0: 错误:没有找到合适的设备 – 何小湘 · 2017年5月14日 20:57
[…] <<CentOS 6 报错 Bringing up interface eth0: Device eth0 does…>> […]