Ubuntu Server 12.04 上未检测到以太网卡

Ubuntu Server 12.04 上未检测到以太网卡

重新安装 Server 12.04 后,无法检测到我的板载以太网。出于某些原因,我在这里就不多说了,我不得不将服务器的驱动器放入另一台机器来安装 Ubuntu,然后再换回服务器。

因此,除了“等待网络配置”之外,服务器启动正常。

我在另一篇文章中看到,默认情况下,与 Ubuntu Desktop 不同,Server 不会动态处理硬件更改的新 mac 地址,但查看 /etc/udev/rules.d/70-persistent-net.rules 只会显示一个以太网接口。难道它不应该同时显示旧的和新的吗?

lspci -vv 显示以太网接口,那么到底发生了什么?

我应该提到板载 LAN 已在 BIOS 中启用。

我知道这并不重要,但这一切都始于我在重新安装之前在 webmin 中更改了一些网络配置设置。它无法下载任何更新,所以我做了一些调整。它坏了,安装了 FreeNAS,虽然能用,但我不喜欢它,然后又回到了 Ubuntu Server,现在我陷入了困境。

谢谢您的任何建议!

答案1

看着

/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:/sys/devices/pci0000:00/0000:00:1e.0/0000:02:08.0 (e100)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:07:e9:3c:34:1f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0/0000:02:01.0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:07:e9:3c:34:1f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

它说我的新网卡是 eth1 - 但它不能作为 eth1 工作,所以我注释掉了所有内容,然后重启后,udev 发现我的新卡是 eth0

# 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:/sys/devices/pci0000:00/0000:00:1e.0/0000:02:08.0 (e100)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:07:e9:3c:34:1f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0/0000:02:01.0 (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:07:e9:3c:34:1f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0/0000:02:01.0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:07:e9:3c:34:1f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

ifconfig:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:07:e9:3c:34:1f  
          inet addr:192.168.0.16  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::207:e9ff:fe3c:341f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:189 errors:0 dropped:0 overruns:0 frame:0
          TX packets:112 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:16698 (16.6 KB)  TX bytes:14257 (14.2 KB)

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:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:440 (440.0 B)  TX bytes:440 (440.0 B)

我的网络配置文件:

$ cat /etc/network/interfaces 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.16
netmask 255.255.255.0
gateway 192.168.0.4

现在一切正常 - 系统正常运行

相关内容