![Wifi 已连接但无法访问互联网(Lubuntu 14.04)](https://linux22.com/image/878843/Wifi%20%E5%B7%B2%E8%BF%9E%E6%8E%A5%E4%BD%86%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E4%BA%92%E8%81%94%E7%BD%91%EF%BC%88Lubuntu%2014.04%EF%BC%89.png)
我的电脑同时通过 wifi 和 lan 连接,wifi 可以连接互联网,而 lan 则可以将我连接到家庭网络上的其他电脑。
如果我拔掉/断开局域网,互联网可以工作,但当 wifi 和局域网都连接时,互联网会暂时工作,然后断开连接。我无法打开任何网站,甚至 ping 也不起作用,例如“ping google.com”给出:
ping:未知主机 google.com
但我可以在互联网上 ping 通 IP,例如“ping 8.8.8.8”得到以下结果:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=110 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=98.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=101 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 98.492/103.462/110.263/4.983 ms
无线信息脚本的输出如下:
########## wireless info START ##########
Report from: 01 Jan 2016 23:18 IST +0530
Booted last: 01 Jan 2016 22:31 IST +0530
Script from: 27 Sep 2015 00:34 UTC +0000
##### release ###########################
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
##### kernel ############################
Linux 3.16.0-55-generic #74~14.04.1-Ubuntu SMP Tue Nov 17 10:16:12 UTC 2015 i686 athlon i686 GNU/Linux
Parameters: ro, quiet, splash, vt.handoff=7
##### desktop ###########################
Lubuntu
##### lspci #############################
00:07.0 Bridge [0680]: NVIDIA Corporation MCP61 Ethernet [10de:03ef] (rev a2)
Subsystem: ASUSTeK Computer Inc. Device [1043:8234]
Kernel driver in use: forcedeth
##### lsusb #############################
Bus 001 Device 002: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
##### PCMCIA card info ##################
'pccardctl' is not installed (package "pcmciautils").
##### rfkill ############################
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
##### lsmod #############################
rt2800usb 26712 0
rt2x00usb 20041 1 rt2800usb
rt2800lib 83150 1 rt2800usb
rt2x00lib 48886 3 rt2x00usb,rt2800lib,rt2800usb
mac80211 563196 3 rt2x00lib,rt2x00usb,rt2800lib
cfg80211 422935 2 mac80211,rt2x00lib
crc_ccitt 12627 1 rt2800lib
mxm_wmi 12893 1 nouveau
wmi 18689 2 mxm_wmi,nouveau
##### interfaces ########################
auto lo
iface lo inet loopback
##### ifconfig ##########################
eth0 Link encap:Ethernet HWaddr <MAC 'eth0' [IF]>
inet addr:192.168.0.100 Bcast:192.168.0.127 Mask:255.255.255.128
inet6 addr: fe80::<IP6 'eth0' [IF]>/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11067 errors:0 dropped:0 overruns:0 frame:0
TX packets:15850 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:770753 (770.7 KB) TX bytes:14862732 (14.8 MB)
wlan0 Link encap:Ethernet HWaddr <MAC 'wlan0' [IF]>
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::<IP6 'wlan0' [IF]>/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2574 errors:0 dropped:0 overruns:0 frame:0
TX packets:2434 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:604557 (604.5 KB) TX bytes:350301 (350.3 KB)
##### iwconfig ##########################
lo no wireless extensions.
eth0 no wireless extensions.
wlan0 IEEE 802.11bgn ESSID:"Tata-Photon-Max-Wi-Fi-4994"
Mode:Managed Frequency:2.462 GHz Access Point: <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]>
Bit Rate=39 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=39/70 Signal level=-71 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:4 Invalid misc:4 Missed beacon:0
##### route #############################
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.128 U 1 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
##### resolv.conf #######################
nameserver 127.0.1.1
##### network managers ##################
Installed:
NetworkManager
Running:
root 1057 1 0 22:31 ? 00:00:00 NetworkManager
##### NetworkManager info ###############
NetworkManager Tool
State: connected (global)
- Device: eth0 [Wired connection 1] -------------------------------------------
Type: Wired
Driver: forcedeth
State: connected
Default: no
HW Address: <MAC 'eth0' [IF]>
Capabilities:
Carrier Detect: yes
Speed: 100 Mb/s
Wired Properties
Carrier: on
IPv4 Settings:
Address: 192.168.0.100
Prefix: 25 (255.255.255.128)
Gateway: 192.168.0.2
DNS: 192.168.0.2
- Device: wlan0 [Tata-Photon-Max-Wi-Fi-4994] ----------------------------------
Type: 802.11 WiFi
Driver: rt2800usb
State: connected
Default: yes
HW Address: <MAC 'wlan0' [IF]>
Capabilities:
Speed: 39 Mb/s
Wireless Properties
WEP Encryption: yes
WPA Encryption: yes
WPA2 Encryption: yes
Wireless Access Points (* = current AP)
linksys: Infra, <MAC 'linksys' [AC3]>, Freq 2462 MHz, Rate 54 Mb/s, Strength 100 WPA WPA2
*Tata-Photon-Max-Wi-Fi-4994: Infra, <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]>, Freq 2462 MHz, Rate 54 Mb/s, Strength 53 WPA WPA2
IPv4 Settings:
Address: 192.168.1.102
Prefix: 24 (255.255.255.0)
Gateway: 192.168.1.1
DNS: 192.168.1.1
##### NetworkManager.state ##############
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
WimaxEnabled=true
##### NetworkManager.conf ###############
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
no-auto-default=<MAC 'eth0' [IF]>,
[ifupdown]
managed=false
##### NetworkManager profiles ###########
[[/etc/NetworkManager/system-connections/Tata-Photon-Max-Wi-Fi-4994]] (600 root)
[connection] id=Tata-Photon-Max-Wi-Fi-4994 | type=802-11-wireless
[802-11-wireless] ssid=Tata-Photon-Max-Wi-Fi-4994 | mac-address=<MAC 'wlan0' [IF]>
[ipv4] method=auto
[ipv6] method=auto
##### iw reg get ########################
'iw' is not installed (package "iw").
##### iwlist channels ###################
lo no frequency information.
eth0 no frequency information.
wlan0 14 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Channel 12 : 2.467 GHz
Channel 13 : 2.472 GHz
Channel 14 : 2.484 GHz
Current Frequency=2.462 GHz (Channel 11)
##### iwlist scan #######################
lo Interface doesn't support scanning.
eth0 Interface doesn't support scanning.
Channel occupancy:
1 APs on Frequency:2.412 GHz (Channel 1)
2 APs on Frequency:2.462 GHz (Channel 11)
wlan0 Scan completed :
Cell 01 - Address: <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]>
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=49/70 Signal level=-61 dBm
Encryption key:on
ESSID:"Tata-Photon-Max-Wi-Fi-4994"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=000000075d57040d
Extra: Last beacon: 172ms ago
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Cell 02 - Address: <MAC 'dlink-39D0' [AC2]>
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=37/70 Signal level=-73 dBm
Encryption key:on
ESSID:"dlink-39D0"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=00000045f9e8938e
Extra: Last beacon: 2884ms ago
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Cell 03 - Address: <MAC 'linksys' [AC3]>
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=70/70 Signal level=-35 dBm
Encryption key:on
ESSID:"linksys"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=000000144ac5ea0b
Extra: Last beacon: 232ms ago
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
##### module infos ######################
[rt2800usb]
filename: /lib/modules/3.16.0-55-generic/kernel/drivers/net/wireless/rt2x00/rt2800usb.ko
license: GPL
firmware: rt2870.bin
description: Ralink RT2800 USB Wireless LAN driver.
version: 2.3.0
author: http://rt2x00.serialmonkey.com
srcversion: 80C4499E147864C0B13476F
depends: rt2x00lib,rt2800lib,rt2x00usb
intree: Y
vermagic: 3.16.0-55-generic SMP mod_unload modversions 686
signer: Magrathea: Glacier signing key
sig_key: CE:7D:DF:85:0B:DF:98:9C:CF:49:92:BB:EA:D0:EB:19:6E:A3:49:1D
sig_hashalgo: sha512
parm: nohwcrypt:Disable hardware encryption. (bool)
[rt2x00usb]
filename: /lib/modules/3.16.0-55-generic/kernel/drivers/net/wireless/rt2x00/rt2x00usb.ko
license: GPL
description: rt2x00 usb library
version: 2.3.0
author: http://rt2x00.serialmonkey.com
srcversion: 21417B97E30FD4E6E469E1F
depends: rt2x00lib,mac80211
intree: Y
vermagic: 3.16.0-55-generic SMP mod_unload modversions 686
signer: Magrathea: Glacier signing key
sig_key: CE:7D:DF:85:0B:DF:98:9C:CF:49:92:BB:EA:D0:EB:19:6E:A3:49:1D
sig_hashalgo: sha512
[rt2800lib]
filename: /lib/modules/3.16.0-55-generic/kernel/drivers/net/wireless/rt2x00/rt2800lib.ko
license: GPL
description: Ralink RT2800 library
version: 2.3.0
author: http://rt2x00.serialmonkey.com, Bartlomiej Zolnierkiewicz
srcversion: EDDCA794C9E4C3981037918
depends: rt2x00lib,mac80211,crc-ccitt
intree: Y
vermagic: 3.16.0-55-generic SMP mod_unload modversions 686
signer: Magrathea: Glacier signing key
sig_key: CE:7D:DF:85:0B:DF:98:9C:CF:49:92:BB:EA:D0:EB:19:6E:A3:49:1D
sig_hashalgo: sha512
[rt2x00lib]
filename: /lib/modules/3.16.0-55-generic/kernel/drivers/net/wireless/rt2x00/rt2x00lib.ko
license: GPL
description: rt2x00 library
version: 2.3.0
author: http://rt2x00.serialmonkey.com
srcversion: 71EFA3CA86D02D0528C49EE
depends: mac80211,cfg80211
intree: Y
vermagic: 3.16.0-55-generic SMP mod_unload modversions 686
signer: Magrathea: Glacier signing key
sig_key: CE:7D:DF:85:0B:DF:98:9C:CF:49:92:BB:EA:D0:EB:19:6E:A3:49:1D
sig_hashalgo: sha512
[mac80211]
filename: /lib/modules/3.16.0-55-generic/kernel/net/mac80211/mac80211.ko
license: GPL
description: IEEE 802.11 subsystem
srcversion: 477882071593B10E01388C8
depends: cfg80211
intree: Y
vermagic: 3.16.0-55-generic SMP mod_unload modversions 686
signer: Magrathea: Glacier signing key
sig_key: CE:7D:DF:85:0B:DF:98:9C:CF:49:92:BB:EA:D0:EB:19:6E:A3:49:1D
sig_hashalgo: sha512
parm: max_nullfunc_tries:Maximum nullfunc tx tries before disconnecting (reason 4). (int)
parm: max_probe_tries:Maximum probe tries before disconnecting (reason 4). (int)
parm: beacon_loss_count:Number of beacon intervals before we decide beacon was lost. (int)
parm: probe_wait_ms:Maximum time(ms) to wait for probe response before disconnecting (reason 4). (int)
parm: ieee80211_default_rc_algo:Default rate control algorithm for mac80211 to use (charp)
[cfg80211]
filename: /lib/modules/3.16.0-55-generic/kernel/net/wireless/cfg80211.ko
description: wireless configuration support
license: GPL
author: Johannes Berg
srcversion: 046346857FD53951C911443
depends:
intree: Y
vermagic: 3.16.0-55-generic SMP mod_unload modversions 686
signer: Magrathea: Glacier signing key
sig_key: CE:7D:DF:85:0B:DF:98:9C:CF:49:92:BB:EA:D0:EB:19:6E:A3:49:1D
sig_hashalgo: sha512
parm: ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)
parm: cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)
##### module parameters #################
[rt2800usb]
nohwcrypt: N
[mac80211]
beacon_loss_count: 7
ieee80211_default_rc_algo: minstrel_ht
max_nullfunc_tries: 2
max_probe_tries: 5
probe_wait_ms: 500
[cfg80211]
cfg80211_disable_40mhz_24ghz: N
ieee80211_regdom: 00
##### /etc/modules ######################
lp
##### modprobe options ##################
[/etc/modprobe.d/blacklist-ath_pci.conf]
blacklist ath_pci
[/etc/modprobe.d/blacklist.conf]
blacklist evbug
blacklist usbmouse
blacklist usbkbd
blacklist eepro100
blacklist de4x5
blacklist eth1394
blacklist snd_intel8x0m
blacklist snd_aw2
blacklist i2c_i801
blacklist prism54
blacklist bcm43xx
blacklist garmin_gps
blacklist asus_acpi
blacklist snd_pcsp
blacklist pcspkr
blacklist amd76x_edac
[/etc/modprobe.d/blacklist-rare-network.conf]
alias net-pf-3 off
alias net-pf-6 off
alias net-pf-9 off
alias net-pf-11 off
alias net-pf-12 off
alias net-pf-19 off
alias net-pf-21 off
alias net-pf-36 off
[/etc/modprobe.d/iwlwifi.conf]
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211
[/etc/modprobe.d/libpisock9.conf]
blacklist visor
[/etc/modprobe.d/mlx4.conf]
softdep mlx4_core post: mlx4_en
[/etc/modprobe.d/modesetting.conf]
options cirrus modeset=1
options mgag200 modeset=1
##### rc.local ##########################
exit 0
##### pm-utils ##########################
##### udev rules ########################
[/etc/udev/rules.d/70-persistent-net.rules]
# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<MAC 'eth0' [IF]>", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# USB device 0x:0x (rt2800usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<MAC 'wlan0' [IF]>", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
##### dmesg #############################
[ 23.974692] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5390, rev 0502 detected
[ 24.003062] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5370 detected
[ 32.941352] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[ 33.083601] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29
[ 33.313855] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 33.318289] forcedeth 0000:00:07.0 eth0: MSI enabled
[ 36.860352] wlan0: authenticate with <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]>
[ 36.898849] wlan0: send auth to <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]> (try 1/3)
[ 36.900438] wlan0: authenticated
[ 36.904047] wlan0: associate with <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]> (try 1/3)
[ 36.907662] wlan0: RX AssocResp from <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]> (capab=0x411 status=0 aid=3)
[ 36.914154] wlan0: associated
[ 36.914185] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 39.386661] wlan0: deauthenticating from <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]> by local choice (Reason: 2=PREV_AUTH_NOT_VALID)
[ 39.429725] wlan0: authenticate with <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]>
[ 39.448838] wlan0: send auth to <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]> (try 1/3)
[ 39.451964] wlan0: authenticated
[ 39.456054] wlan0: associate with <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]> (try 1/3)
[ 39.459305] wlan0: RX AssocResp from <MAC 'Tata-Photon-Max-Wi-Fi-4994' [AC1]> (capab=0x411 status=0 aid=3)
[ 39.465794] wlan0: associated
########## wireless info END ############
在网络连接 -> Wifi 连接下使用“仅自动 (DHCP) 地址”添加 8.8.8.8 作为附加 DNS 服务器
nslookup google.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
*** Can't find google.com: No answer
sudo nano /etc/resolvconf/resolv.conf.d/tail 添加了名称服务器 8.8.8.8 sudo service network-manager restart
仍然不起作用。
请注意主题行上的一个更正,应该是 Lubuntu 14.04,而不是 Ubuntu 14.04
猫/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
nameserver 127.0.1.1
nameserver 8.8.8.8
答案1
按照网址中的说明进行操作resolv.conf 中的名称服务器 127.0.1.1 不会消失! 并在 /etc/NetworkManager/NetworkManager.conf 中注释掉 dns=dnsmasq 并且现在可以正常工作
答案2
我遇到了同样的问题。通过进入系统工具 > 网络解决了这个问题。在 DNS 选项卡上,我注意到一个我不认识的 172.* 服务器。我将其替换为 8.8.8.8,一切正常。
答案3
如果您可以 ping 通 IP,但无法访问域,这听起来像是 DNS 服务器出了问题。尝试nslookup google.com
查看 DNS 查找是否有效。如果不行,尝试更改你的 DNS 服务器至 8.8.8.8 (Google 的公共 DNS)。