我可以连接到 WiFi,但无法在 Ubuntu 14.04 上浏览互联网。之前它运行正常。
ifconfig 如下所示:
eth0 Link encap:Ethernet HWaddr 3c:97:0e:55:74:a7
inet6 addr: fe80::3e97:eff:fe55:74a7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1
RX packets:15017 errors:0 dropped:0 overruns:0 frame:0
TX packets:6709 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5679208 (5.6 MB) TX bytes:1147562 (1.1 MB)
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:137 errors:0 dropped:0 overruns:0 frame:0
TX packets:137 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9745 (9.7 KB) TX bytes:9745 (9.7 KB)
wlan0 Link encap:Ethernet HWaddr 20:16:d8:1f:e5:5f
inet addr:192.168.137.51 Bcast:192.168.137.255 Mask:255.255.255.0
inet6 addr: fe80::2216:d8ff:fe1f:e55f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:60 errors:0 dropped:0 overruns:0 frame:0
TX packets:1761 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6977 (6.9 KB) TX bytes:197694 (197.6 KB)
路线输出 -n
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.137.1 0.0.0.0 UG 0 0 0 wlan0
192.168.137.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
ping -c 4 google.com 的输出没有任何结果
ping -c 4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.137.43 icmp_seq=1 Destination Host Unreachable
From 192.168.137.43 icmp_seq=2 Destination Host Unreachable
From 192.168.137.43 icmp_seq=3 Destination Host Unreachable
From 192.168.137.43 icmp_seq=4 Destination Host Unreachable
06:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter [10ec:8176] (rev 01)
Subsystem: Realtek Semiconductor Co., Ltd. Device [10ec:8195]
Kernel driver in use: rtl8192ce
答案1
我认为您遇到了网关问题,请运行命令以确保traceroute 8.8.8.8
第一跳应该是网关。sudo apt-get install traceroute
安装跟踪路由。请发布结果。
您写道“之前运行良好”,因此您要么更改了网关,要么调整了设置/etc/networking/interface
。请发布您的界面设置。(请参阅帖子下方的示例)
如果你能 ping 8.8.8.8 但不能 ping google.com,那么你可能也遇到了 DNS 问题,
resolvconf 生成/etc/resolv.conf
,
# Generated by resolvconf
nameserver 8.8.8.8
nameserver 8.8.4.4
如果您已更新,/etc/resolv.conf
请通过systemctl restart networking
或重新启动sudo service networking restart
检查您是否有正确的名称服务器,您也可以重新安装 resolvconf 并查看是否可以解决问题。
sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf
如果您将DNS 配置为静态,则配置 DNS 的另一个地方是/etc/network/interfaces
。
例子/etc/network/interface
:
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4