LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1731|回复: 7

求解:两块网卡启动识别顺序混乱

[复制链接]
发表于 2006-9-22 11:48:54 | 显示全部楼层 |阅读模式
三台硬件一样的机器,板载一个网卡,主板pci上插了一块网卡。
两台装了桌面版A,B,一台C是server版本。

A,B上在Gnome上的图形管理界面中总识别出来是eth2,和eth3。而且每次启动的时候,两块网卡的顺序会换一下。这两块网卡,配置的是不同网段的机器,这让实际工作中碰到了很大的问题。现在每次启动一下就要去换一下网线。

从dmesg |grep eth 看:

dmesg |grep eth  
[4294671.526000] Driver 'sd' needs updating - please use bus_type methods
[4294684.228000] eth0: RealTek RTL8139 at 0xf8962100, 00:16:76:80:08:34, IRQ 177
[4294684.228000] eth0:  Identified 8139 chip type 'RTL-8101'
[4294684.229000] eth1: RealTek RTL8139 at 0xf8964000, 00:e0:4c:26:da:d6, IRQ 217
[4294684.229000] eth1:  Identified 8139 chip type 'RTL-8139C'
[4294684.642000] eth2: link up, 100Mbps, full-duplex, lpa 0x41E1
[4294685.125000] eth3: link up, 100Mbps, full-duplex, lpa 0x41E1
[4294700.674000] hda-intel: Invalid position buffer, using LPIB read method instead.
[4294707.620000] eth3: no IPv6 routers present
[4294708.422000] eth2: no IPv6 routers present
[4295614.052000] eth3: link down
[4295615.632000] eth2: link down
[4295617.281000] eth3: link up, 100Mbps, full-duplex, lpa 0x41E1
[4295619.571000] eth2: link up, 100Mbps, full-duplex, lpa 0x41E1


而服务器C (只插了一根网线)上 dmsg |grep eth 看到的情况是:

[42949378.250000] Driver 'sd' needs updating - please use bus_type methods
[42949385.220000] eth0: RealTek RTL8139 at 0xf88ac100, 00:16:76:80:07:a5, IRQ 11
[42949385.220000] eth0:  Identified 8139 chip type 'RTL-8101'
[42949385.220000] eth1: RealTek RTL8139 at 0xf88ee000, 00:e0:4c:20:e0:95, IRQ 11
[42949385.220000] eth1:  Identified 8139 chip type 'RTL-8139C'
[42949385.490000] eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
[42949405.920000] eth0: no IPv6 routers present


在A机器上使用
#ifup eth0
得到
Ignoring unknown interface eth0=eth0.

尝试使用在 A /etc/network/interfaces 的map命令来解决。但未果。

map eth0 到abc,然后在命令行下 ifup abc 结果说没有abc这个driver。
发表于 2006-9-22 12:00:06 | 显示全部楼层
文件 /etc/iftab 里可以定义网卡设备好
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-22 12:50:20 | 显示全部楼层
天啊,强啊。终于找到原因了。
我这三台机器,一台原装,两台ghost安装的。
所以/etc/iftab的eth0,eth1都写的是第一台机器上的mac地址的。
结果A,B启动的时候,因为eth0,eth1都指定了,就自动顺延取名为eth2,eth3了。
顺延的时候,顺序就不能保证了。现在全部OK了。
再次感谢,这些可以安心:sleep
回复 支持 反对

使用道具 举报

发表于 2006-9-22 13:10:38 | 显示全部楼层
请问,如果把这个文件删除了,重启后会发生什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-22 16:31:02 | 显示全部楼层
没有试验过,等会试一试。
回复 支持 反对

使用道具 举报

发表于 2006-9-23 21:42:33 | 显示全部楼层
这个东西靠自动靠不住吧,最好还是设置固定了MAC-IP对才可安心。论坛上以前曾经有兄弟解决过了,搜索一下也许可以找得到。
参考一下,用udev使用MAC地址与网上名字对应起来,成功了说一下
http://wiki.archlinux.org/index. ... ing_Order_Each_Boot
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-24 11:05:11 | 显示全部楼层
Post by 超级用户
请问,如果把这个文件删除了,重启后会发生什么?

删除文件后,重新启动,/etc/iftab文件没有重建,网卡还是可以用的。顺序也对。我想可能是因为原来iftab中本来记的就是识别出来的顺序。
回复 支持 反对

使用道具 举报

发表于 2006-9-25 08:14:35 | 显示全部楼层
ok! Thank you very much!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表