以太网无法连接到有线连接

分享于 

3分钟阅读

ubuntu

  繁體

问题


lspci -nnk | grep -iEA3"(network|wireless|ethernet)"



它显示


03:00.0 Network controller [0280]: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)


 Subsystem: AzureWave AW-NB037H 802.11bgn Wireless Half-size Mini PCIe Card [AR9002WB-1NGCD] [1a3b:2c37]


 Kernel driver in use: ath9k


04:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller [1b21:1042]


 Subsystem: ASUSTeK Computer Inc. Device [1043:1059]


--


05:00.0 Ethernet controller [0200]: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet [1969:1083] (rev c0)


 Subsystem: ASUSTeK Computer Inc. Device [1043:1851]


 Kernel driver in use: atl1c



 
sudo ifconfig



它显示


eth0 Link encap:Ethernet HWaddr c8:60:00:43:c7:82 


 inet6 addr: fe80::ca60:ff:fe43:c782/64 Scope:Link


 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1


 RX packets:985 errors:0 dropped:16 overruns:0 frame:0


 TX packets:32 errors:0 dropped:0 overruns:0 carrier:1


 collisions:0 txqueuelen:1000 


 RX bytes:71604 (71.6 KB) TX bytes:6652 (6.6 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:65536 Metric:1


 RX packets:144 errors:0 dropped:0 overruns:0 frame:0


 TX packets:144 errors:0 dropped:0 overruns:0 carrier:0


 collisions:0 txqueuelen:0 


 RX bytes:11744 (11.7 KB) TX bytes:11744 (11.7 KB)



wlan0 Link encap:Ethernet HWaddr 00:08:ca:f0:51:5a 


 UP 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)




答案1

看来你没有IPv4地址,设置此值:

首先,打开终端,然后键入以下内容:


sudo nano /etc/network/interfaces



这将打开一个文件,在文件中键入以下内容:


auto eth0


iface eth0 inet static


 address 192.168.1.100


 netmask 255.255.255.0


 network 192.168.1.0


 broadcast 192.168.1.255


 gateway 192.168.1.1



(输入你自己的IP地址,而不是上面的,或者,如果不需要静态IP,只需在文件中键入以下行:


auto eth0


iface eth0 inet dhcp



保存文件(CTL+X,Y,enter ),并重新启动网络服务:


sudo service network-manager restart



希望这有帮助。



CAN  Ethernet