LinuxSir.cn,穿越时空的Linuxsir!

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

【求助】网卡设置无效?

[复制链接]
发表于 2009-2-22 10:14:13 | 显示全部楼层 |阅读模式
gentoo系统已经装完。内核2.6.28
目前系统有三块网卡,2块板载千兆,1块pci

最初装系统的时候,板载网卡不认,后来编译内核后,认出网卡。
pci网卡一开始就没有问题。分配的是eth0

现在问题是,我想启用板载网卡。我在/etc/conf.d/net中设置了eth1和eth2

然后在ifconfig -a 中,看到了eth1和eth2 网卡,并且每个网卡的ip地址都是我指定的。

我在/etc/init.d/ 下:
# ln -sf net.lo net.eth1
# ln -sf net.lo net.eth2

然后在启动项中添加 了eth1

重启后,系统提示错误。
eth1.
SIOCADDRT: File exists
加载失败。

请教。我改如何处理这个问题?
以下是我使用过的命令
====================================

#uname -a
  1. Linux Orion 2.6.28-hardened #2 SMP Fri Feb 20 19:15:06 CST 2009 i686 Intel(R) Xeon(TM) CPU 3.00GHz GenuineIntel GNU/Linux
复制代码

#dmesg | grep eth
  1. [    1.149808] e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
  2. [    2.309158] This is not a software error! Something bad happened to your hardware or
  3. [    2.339604] e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
  4. [    3.498306] This is not a software error! Something bad happened to your hardware or
  5. [    3.528611] e1000: eth2: e1000_probe: Intel(R) PRO/1000 Network Connection
  6. [   14.487833] Driver 'sd' needs updating - please use bus_type methods
  7. [   14.530922] Driver 'sr' needs updating - please use bus_type methods
  8. [   19.132747] e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
  9. [   19.132907] ADDRCONF(NETDEV_UP): eth0: link is not ready
  10. [   19.134697] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
  11. [   30.058007] eth0: no IPv6 routers present
复制代码

# ifconfig -a
  1. ifconfig -a
  2. eth0      Link encap:Ethernet  HWaddr 00:02:b3:8f:a2:0e
  3.           inet addr:192.168.0.9  Bcast:192.168.0.255  Mask:255.255.255.0
  4.           inet6 addr: fe80::202:b3ff:fe8f:a20e/64 Scope:Link
  5.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  6.           RX packets:98 errors:0 dropped:0 overruns:0 frame:0
  7.           TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
  8.           collisions:0 txqueuelen:100
  9.           RX bytes:11302 (11.0 KiB)  TX bytes:10978 (10.7 KiB)
  10. eth1      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
  11.           inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0
  12.           BROADCAST MULTICAST  MTU:1500  Metric:1
  13.           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  14.           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  15.           collisions:0 txqueuelen:1000
  16.           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
复制代码

# ls /etc/init.d
  1. lrwxrwxrwx 1 root root    18 Feb 22 11:26 net.eth0 -> /etc/init.d/net.lo
  2. lrwxrwxrwx 1 root root    18 Feb 22 11:39 net.eth1 -> /etc/init.d/net.lo
复制代码

#cat /etc/conf.d/net
  1. # This blank configuration will automatically use DHCP for any net.*
  2. # scripts in /etc/init.d.  To create a more complete configuration,
  3. # please review /etc/conf.d/net.example and save your configuration
  4. # in /etc/conf.d/net (this file :]!).
  5. config_eth0=("192.168.0.9 netmask 255.255.255.0")
  6. routes_eth0=("default gw 192.168.0.254")
  7. config_eth1=("192.168.0.10 netmask 255.255.255.0")
  8. routes_eth1=("default gw 192.168.0.254")
复制代码

#/etc/init.d/net.eth1 status
  1. * status: stopped
复制代码

#/etc/init.d/net.eth1 start
  1. * Bringing up interface eth1
  2. *   192.168.0.10...
  3. SIOCSIFADDR: File exists
  4. SIOCSIFFLAGS: Cannot assign requested address
  5. SIOCSIFNETMASK: Cannot assign requested address                                                                         [ !! ]
  6. * ERROR: net.eth1 failed to start
复制代码

#/etc/init.d/net.eth0 status
  1. * status: started
复制代码

#rc-update
  1. fsck | boot
  2.                  mtab | boot
  3.                  ntpd |      default
  4.                  root | boot
  5.                  sshd |      default
  6.                  swap | boot
  7.                  udev |                                 sysinit
  8.               keymaps | boot
  9.                 devfs |                                 sysinit
  10.                 dmesg |                                 sysinit
  11.                 local |      default          nonetwork
  12.                 mysql |      default
  13.             savecache |              shutdown
  14.            vixie-cron |      default
  15.             syslog-ng |      default
  16.            localmount | boot
  17.           consolefont | boot
  18.               modules | boot
  19.              hostname | boot
  20.              mount-ro |              shutdown
  21.                net.lo | boot
  22.              net.eth1 |      default
  23.              net.eth0 |      default
  24.                procfs | boot
  25.              netmount |      default
  26.                sysctl | boot
  27.               urandom | boot
  28.          termencoding | boot
  29.               apache2 |      default
  30.               hwclock | boot
  31.              bootmisc | boot
  32.             killprocs |              shutdown
复制代码
 楼主| 发表于 2009-2-22 11:19:23 | 显示全部楼层
太郁闷了。。有谁能给个思路?
  1. cat /etc/conf.d/net
  2. # This blank configuration will automatically use DHCP for any net.*
  3. # scripts in /etc/init.d.  To create a more complete configuration,
  4. # please review /etc/conf.d/net.example and save your configuration
  5. # in /etc/conf.d/net (this file :]!).
  6. config_eth1=("192.168.0.10 netmask 255.255.255.0")
  7. routes_eth1=("default gw 192.168.0.254")
复制代码
回复 支持 反对

使用道具 举报

发表于 2009-2-22 11:59:59 | 显示全部楼层
/etc/udev/rules.d/70-persistent-net.rules
看看里面有没有你两块网卡的hardware address
回复 支持 反对

使用道具 举报

发表于 2009-2-22 12:00:58 | 显示全部楼层
修改一下/etc/udev/rules.d/70-persistent-net.rules
把里面的统统注释掉重启。系统自动会重新分配eth0, eth1 , eth2.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-22 12:06:06 | 显示全部楼层
cat /etc/udev/rules.d/70-persistent-net.rules
  1. # This file was automatically generated by the /lib/udev/write_net_rules
  2. # program run by the persistent-net-generator.rules rules file.
  3. #
  4. # You can modify it, as long as you keep each rule on a single line.
  5. # PCI device 0x8086:0x1008 (e1000)
  6. SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:02:b3:8f:a2:0e", KERNEL=="eth*", NAME="eth0"
复制代码

只有eth0.

我注释掉后重启试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-22 12:13:41 | 显示全部楼层
注释,重启后,eth1依然不好用。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-22 13:29:30 | 显示全部楼层
# lspci -v
  1. 00:00.0 Host bridge: Intel Corporation E7520 Memory Controller Hub (rev 0c)
  2.         Subsystem: Super Micro Computer Inc Device 5480
  3.         Flags: bus master, fast devsel, latency 0
  4.         Capabilities: [40] Vendor Specific Information <?>
  5. 00:00.1 Class ff00: Intel Corporation E7525/E7520 Error Reporting Registers (rev 0c)
  6.         Subsystem: Super Micro Computer Inc Device 5480
  7.         Flags: fast devsel
  8. 00:01.0 System peripheral: Intel Corporation E7520 DMA Controller (rev 0c)
  9.         Subsystem: Super Micro Computer Inc Device 5480
  10.         Flags: fast devsel, IRQ 5
  11.         Memory at da000000 (32-bit, non-prefetchable) [size=4K]
  12.         Capabilities: [b0] MSI: Mask- 64bit- Count=1/2 Enable-
  13. 00:02.0 PCI bridge: Intel Corporation E7525/E7520/E7320 PCI Express Port A (rev 0c) (prog-if 00 [Normal decode])
  14.         Flags: bus master, fast devsel, latency 0
  15.         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
  16.         Capabilities: [50] Power Management version 2
  17.         Capabilities: [58] MSI: Mask- 64bit- Count=1/2 Enable-
  18.         Capabilities: [64] Express Root Port (Slot-), MSI 00
  19.         Capabilities: [100] Advanced Error Reporting
  20.         Kernel driver in use: pcieport-driver
  21. 00:03.0 PCI bridge: Intel Corporation E7525/E7520/E7320 PCI Express Port A1 (rev 0c) (prog-if 00 [Normal decode])
  22.         Flags: bus master, fast devsel, latency 0
  23.         Bus: primary=00, secondary=02, subordinate=05, sec-latency=0
  24.         I/O behind bridge: 00002000-00003fff
  25.         Memory behind bridge: da100000-da3fffff
  26.         Prefetchable memory behind bridge: 00000000de000000-00000000dfffffff
  27.         Capabilities: [50] Power Management version 2
  28.         Capabilities: [58] MSI: Mask- 64bit- Count=1/2 Enable-
  29.         Capabilities: [64] Express Root Port (Slot-), MSI 00
  30.         Capabilities: [100] Advanced Error Reporting
  31.         Kernel driver in use: pcieport-driver
  32. 00:04.0 PCI bridge: Intel Corporation E7525/E7520 PCI Express Port B (rev 0c) (prog-if 00 [Normal decode])
  33.         Flags: bus master, fast devsel, latency 0
  34.         Bus: primary=00, secondary=06, subordinate=06, sec-latency=0
  35.         Capabilities: [50] Power Management version 2
  36.         Capabilities: [58] MSI: Mask- 64bit- Count=1/2 Enable-
  37.         Capabilities: [64] Express Root Port (Slot-), MSI 00
  38.         Capabilities: [100] Advanced Error Reporting
  39. Kernel driver in use: pcieport-driver
  40. 00:06.0 PCI bridge: Intel Corporation E7520 PCI Express Port C (rev 0c) (prog-if 00 [Normal decode])
  41.         Flags: bus master, fast devsel, latency 0
  42.         Bus: primary=00, secondary=07, subordinate=07, sec-latency=0
  43.         Capabilities: [50] Power Management version 2
  44.         Capabilities: [58] MSI: Mask- 64bit- Count=1/2 Enable-
  45.         Capabilities: [64] Express Root Port (Slot-), MSI 00
  46.         Capabilities: [100] Advanced Error Reporting
  47.         Kernel driver in use: pcieport-driver
  48. 00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02) (prog-if 00 [UHCI])
  49.         Subsystem: Super Micro Computer Inc Device 5480
  50.         Flags: bus master, medium devsel, latency 0, IRQ 16
  51.         I/O ports at 1400 [size=32]
  52.         Kernel driver in use: uhci_hcd
  53. 00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02) (prog-if 00 [UHCI])
  54.         Subsystem: Super Micro Computer Inc Device 5480
  55.         Flags: bus master, medium devsel, latency 0, IRQ 19
  56.         I/O ports at 1420 [size=32]
  57.         Kernel driver in use: uhci_hcd
  58. 00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02) (prog-if 00 [UHCI])
  59.         Subsystem: Super Micro Computer Inc Device 5480
  60.         Flags: bus master, medium devsel, latency 0, IRQ 18
  61.         I/O ports at 1440 [size=32]
  62.         Kernel driver in use: uhci_hcd
  63. 00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02) (prog-if 00 [UHCI])
  64.         Subsystem: Super Micro Computer Inc Device 5480
  65.         Flags: bus master, medium devsel, latency 0, IRQ 16
  66.         I/O ports at 1460 [size=32]
  67.         Kernel driver in use: uhci_hcd
  68. 00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])
  69.         Subsystem: Super Micro Computer Inc Device 5480
  70.         Flags: bus master, medium devsel, latency 0, IRQ 23
  71.         Memory at da001000 (32-bit, non-prefetchable) [size=1K]
  72.         Capabilities: [50] Power Management version 2
  73.         Capabilities: [58] Debug port: BAR=1 offset=00a0
  74.         Kernel driver in use: ehci_hcd
  75. 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2) (prog-if 00 [Normal decode])
  76.         Flags: bus master, fast devsel, latency 0
  77.         Bus: primary=00, secondary=08, subordinate=08, sec-latency=32
  78.         I/O behind bridge: 00004000-00004fff
  79.         Memory behind bridge: da400000-dbffffff
  80.         Prefetchable memory behind bridge: d1000000-d10fffff
  81. 00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)
  82.         Flags: bus master, medium devsel, latency 0
  83. 00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02) (prog-if 8a [Master SecP PriP])
  84.         Subsystem: Super Micro Computer Inc Device 5480
  85.         Flags: bus master, medium devsel, latency 0, IRQ 18
  86.         I/O ports at 01f0 [size=8]
  87.         I/O ports at 03f4 [size=1]
  88.         I/O ports at 0170 [size=8]
  89.         I/O ports at 0374 [size=1]
  90.         I/O ports at 14a0 [size=16]
  91.         Memory at d1100000 (32-bit, non-prefetchable) [size=1K]
  92.         Kernel driver in use: ata_piix
  93. 00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)
  94.         Subsystem: Super Micro Computer Inc Device 5480
  95.         Flags: medium devsel, IRQ 17
  96.         I/O ports at 1100 [size=32]
  97.         Kernel driver in use: i801_smbus
  98. 02:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev 09) (prog-if 00 [Normal decode])
  99.         Flags: bus master, fast devsel, latency 0
  100.         Bus: primary=02, secondary=03, subordinate=04, sec-latency=48
  101.         I/O behind bridge: 00002000-00002fff
  102.         Memory behind bridge: da200000-da2fffff
  103.         Prefetchable memory behind bridge: 00000000de000000-00000000dfffffff
  104.         Capabilities: [44] Express PCI/PCI-X Bridge, MSI 00
  105.         Capabilities: [5c] MSI: Mask- 64bit+ Count=1/1 Enable-
  106.         Capabilities: [6c] Power Management version 2
  107.         Capabilities: [d8] PCI-X bridge device
  108.         Capabilities: [100] Advanced Error Reporting
  109.         Capabilities: [300] Power Budgeting <?>
  110. 02:00.1 PIC: Intel Corporation 6700/6702PXH I/OxAPIC Interrupt Controller A (rev 09) (prog-if 20 [IO(X)-APIC])
  111.         Subsystem: Super Micro Computer Inc Device 5480
  112.         Flags: bus master, fast devsel, latency 0
  113.         Memory at da100000 (32-bit, non-prefetchable) [size=4K]
  114.         Capabilities: [44] Express Endpoint, MSI 00
  115.         Capabilities: [6c] Power Management version 2
  116. 02:00.2 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge B (rev 09) (prog-if 00 [Normal decode])
  117.         Flags: bus master, fast devsel, latency 0
  118.         Bus: primary=02, secondary=05, subordinate=05, sec-latency=64
  119.         I/O behind bridge: 00003000-00003fff
  120.         Memory behind bridge: da300000-da3fffff
  121.         Capabilities: [44] Express PCI/PCI-X Bridge, MSI 00
  122.         Capabilities: [5c] MSI: Mask- 64bit+ Count=1/1 Enable-
  123.         Capabilities: [6c] Power Management version 2
  124.         Capabilities: [d8] PCI-X bridge device
  125.         Capabilities: [100] Advanced Error Reporting
  126.         Capabilities: [300] Power Budgeting <?>
  127. 02:00.3 PIC: Intel Corporation 6700PXH I/OxAPIC Interrupt Controller B (rev 09) (prog-if 20 [IO(X)-APIC])
  128.         Subsystem: Super Micro Computer Inc Device 5480
  129.         Flags: bus master, fast devsel, latency 0
  130.         Memory at da101000 (32-bit, non-prefetchable) [size=4K]
  131.         Capabilities: [44] Express Endpoint, MSI 00
  132.         Capabilities: [6c] Power Management version 2
  133. 03:01.0 I2O: Adaptec (formerly DPT) SmartRAID V Controller (rev 01) (prog-if 01)
  134.         Subsystem: Adaptec (formerly DPT) 3010S Fibre Channel
  135.         Flags: bus master, 66MHz, slow devsel, latency 64, IRQ 24
  136.         BIST result: 00
  137.         Memory at de000000 (32-bit, prefetchable) [size=32M]
  138.         [virtual] Expansion ROM at da260000 [disabled] [size=32K]
  139.         Capabilities: [80] Power Management version 2
  140. 03:01.1 PCI bridge: Adaptec (formerly DPT) PCI Bridge (rev 01) (prog-if 00 [Normal decode])
  141.         Flags: bus master, 66MHz, slow devsel, latency 56
  142.         Bus: primary=03, secondary=04, subordinate=04, sec-latency=32
  143.         Capabilities: [68] Power Management version 2
  144. 03:03.0 Ethernet controller: Intel Corporation 82544EI Gigabit Ethernet Controller (Copper) (rev 02)
  145.         Subsystem: Intel Corporation PRO/1000 XT Server Adapter
  146.         Flags: bus master, 66MHz, medium devsel, latency 52, IRQ 28
  147.         Memory at da220000 (32-bit, non-prefetchable) [size=128K]
  148.         Memory at da200000 (32-bit, non-prefetchable) [size=128K]
  149.         I/O ports at 2000 [size=32]
  150.         [virtual] Expansion ROM at da240000 [disabled] [size=128K]
  151.         Capabilities: [68] Power Management version 2
  152. 03:03.0 Ethernet controller: Intel Corporation 82544EI Gigabit Ethernet Controller (Copper) (rev 02)
  153.         Subsystem: Intel Corporation PRO/1000 XT Server Adapter
  154.         Flags: bus master, 66MHz, medium devsel, latency 52, IRQ 28
  155.         Memory at da220000 (32-bit, non-prefetchable) [size=128K]
  156.         Memory at da200000 (32-bit, non-prefetchable) [size=128K]
  157.         I/O ports at 2000 [size=32]
  158.         [virtual] Expansion ROM at da240000 [disabled] [size=128K]
  159.         Capabilities: [dc] Power Management version 2
  160.         Capabilities: [e4] PCI-X non-bridge device
  161.         Capabilities: [f0] MSI: Mask- 64bit+ Count=1/1 Enable-
  162.         Kernel driver in use: e1000
  163. 05:02.0 Ethernet controller: Intel Corporation 82546GB Gigabit Ethernet Controller (rev 03)
  164.         Subsystem: Intel Corporation PRO/1000 MT Dual Port Server Adapter
  165.         Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 54
  166.         Memory at da300000 (64-bit, non-prefetchable) [size=128K]
  167.         I/O ports at 3000 [size=64]
  168.         Capabilities: [dc] Power Management version 2
  169.         Capabilities: [e4] PCI-X non-bridge device
  170.         Capabilities: [f0] MSI: Mask- 64bit+ Count=1/1 Enable-
  171.         Kernel driver in use: e1000
  172. 05:02.1 Ethernet controller: Intel Corporation 82546GB Gigabit Ethernet Controller (rev 03)
  173.         Subsystem: Intel Corporation PRO/1000 MT Dual Port Server Adapter
  174.         Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 55
  175.         Memory at da320000 (64-bit, non-prefetchable) [size=128K]
  176.         I/O ports at 3040 [size=64]
  177.         Capabilities: [dc] Power Management version 2
  178.         Capabilities: [e4] PCI-X non-bridge device
  179.         Capabilities: [f0] MSI: Mask- 64bit+ Count=1/1 Enable-
  180.         Kernel driver in use: e1000
  181. 08:01.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27) (prog-if 00 [VGA controller])
  182.         Subsystem: ATI Technologies Inc Rage XL
  183.         Flags: bus master, stepping, medium devsel, latency 66, IRQ 10
  184.         Memory at db000000 (32-bit, non-prefetchable) [size=16M]
  185.         I/O ports at 4000 [size=256]
  186.         Memory at da400000 (32-bit, non-prefetchable) [size=4K]
  187.         [virtual] Expansion ROM at d1000000 [disabled] [size=128K]
  188.         Capabilities: [5c] Power Management version 2
复制代码
回复 支持 反对

使用道具 举报

发表于 2009-2-22 13:42:57 | 显示全部楼层
#route -n

看一下

siocaddrt file exists, 好像跟路由表有关~
回复 支持 反对

使用道具 举报

发表于 2009-2-22 14:52:07 | 显示全部楼层
驱动的问题
udev没有认出来
所以你就别折腾了
dmesg里面也说了"something bad happened"
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-22 16:09:28 | 显示全部楼层
我如何给eth1指定具体的驱动?
回复 支持 反对

使用道具 举报

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

本版积分规则

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