在我的计算机上运行带有 LAMP 的 Ubuntu 12.04 时,无法检测到以太网。我记得做的最后一件事是按照这个教程进行操作: http://www.howtoforge.com/linux-basics-set-a-static-ip-on-ubuntu
这是我进行的检查。希望它能有所帮助。谢谢!
vest@vest-blue-server:~$ ifconfig
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:224 errors:0 dropped:0 overruns:0 frame:0
TX packets:224 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16736 (16.7 KB) TX bytes:16736 (16.7 KB)
vest@vest-blue-server:~$ clear
vest@vest-blue-server:~$ lspci -nnk | grep -iA2 net
00:07.0 Bridge [0680]: NVIDIA Corporation MCP61 Ethernet [10de:03ef] (rev a2)
Subsystem: ASUSTeK Computer Inc. M4N68T series motherboard [1043:83a4]
Kernel driver in use: forcedeth
vest@vest-blue-server:~$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 48:5b:39:eb:72:8e
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:23 Base address:0xe000
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:240 errors:0 dropped:0 overruns:0 frame:0
TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17680 (17.6 KB) TX bytes:17680 (17.6 KB)
vest@vest-blue-server:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet ghcp
vest@vest-blue-server:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
vest@vest-blue-server:~$ lsmod
Module Size Used by
snd_hda_codec_realtek 224066 1
snd_hda_intel 33773 3
snd_hda_codec 127706 2 snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 13668 1 snd_hda_codec
snd_pcm 97188 2 snd_hda_intel,snd_hda_codec
snd_seq_midi 13324 0
nouveau 774641 3
snd_rawmidi 30748 1 snd_seq_midi
snd_seq_midi_event 14899 1 snd_seq_midi
snd_seq 61896 2 snd_seq_midi,snd_seq_midi_event
ttm 76949 1 nouveau
drm_kms_helper 46978 1 nouveau
serio_raw 13211 0
drm 242038 5 nouveau,ttm,drm_kms_helper
snd_timer 29990 2 snd_pcm,snd_seq
snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq
k8temp 13057 0
edac_core 53746 0
i2c_algo_bit 13423 1 nouveau
mxm_wmi 12979 1 nouveau
wmi 19256 1 mxm_wmi
edac_mce_amd 23709 0
snd 78855 15 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
video 19596 1 nouveau
soundcore 15091 1 snd
snd_page_alloc 18529 2 snd_hda_intel,snd_pcm
bnep 18281 2
bluetooth 180104 7 bnep
parport_pc 32866 1
ppdev 17113 0
asus_atk0110 18078 0
i2c_nforce2 13058 0
mac_hid 13253 0
lp 17799 0
parport 46562 3 parport_pc,ppdev,lp
usbhid 47199 0
hid 99559 1 usbhid
sata_nv 32286 2
forcedeth 63460 0
pata_amd 14118 0
vest@vest-blue-server:~$ 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 0x10de:/sys/devices/pci0000:00/0000:00:07.0 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="48:5b:39:eb:72:8e", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
答案1
问题在于您的/etc/network/interfaces
文件当前内容为:
auto lo
iface lo inet loopback
iface eth0 inet ghcp
ghcp
不是这样的。将该文件改为:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
编辑:如果这是带有网络管理器的桌面(按照标准配置),则根本不需要描述符eth0
。它甚至可能与以下内容冲突,nm
因此我建议/etc/network/interfaces
将其剥离为:
auto lo
iface lo inet loopback
然后重新启动并重试。
答案2
将有线连接中的 MAC 地址更改为 12 位数字,如 12:12:12:12:12:12,然后重新启动系统,再次将 MAC 地址更改为默认地址,然后重新启动,您的以太网将正常工作。