Ubuntu 14.04。它可以检测到有线连接,但无法获取 IP 地址。我尝试过不同的有线网络,每次都遇到同样的问题,无论是使用 nm-applet 还是 wicd。我的另一台计算机可以毫无问题地连接到我的家庭网络。
它没有被阻止,无论是软的还是硬的。我尝试了建议这里但它并没有改变任何东西。需要注意的一点是,电缆不直接连接到笔记本电脑,而是通过专有连接器。这是 ifconfig 的输出:
eth0 Link encap:Ethernet HWaddr 24:f5:aa:c2:58:c7
inet6 addr: fe80::26f5:aaff:fec2:58c7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:378 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
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:8058 errors:0 dropped:0 overruns:0 frame:0
TX packets:8058 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2163118 (2.1 MB) TX bytes:2163118 (2.1 MB)
wlan0 Link encap:Ethernet HWaddr 6c:29:95:19:08:1b
inet addr:192.168.1.133 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::6e29:95ff:fe19:81b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2280079 errors:0 dropped:0 overruns:0 frame:0
TX packets:1500378 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2912209727 (2.9 GB) TX bytes:186227404 (186.2 MB)
这是 /etc/network/interfaces 的内容
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
这是 的输出sudo lspci -vvnn | grep -iA 10 ethernet
。
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
Subsystem: Samsung Electronics Co Ltd Device [144d:c109]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 61
Region 0: I/O ports at e000 [size=256]
Region 2: Memory at f7c00000 (64-bit, non-prefetchable) [size=4K]
Region 4: Memory at f0000000 (64-bit, prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
答案1
手动设置网络配置。为此,请按照以下命令操作:
ifconfig eth0 192.168.31.3 netmask 255.255.255.0 up
(IP 和网络掩码仅作为示例)
sevice networking restart
答案2
加入/etc/network/interfaces
(此为示例)
iface eth0 inet static
address 192.168.1.200
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
然后
sudo /etc/init.d/networking restart
此方式使用静态 IP 地址。