我在桌面上安装了 Ubuntu 14.04,现在 WiFi 连接出现问题。每次重启后,它都能正常工作,但一段时间后就会断线。有时会恢复,有时不会。一开始,我可以通过单击 WiFi 连接启动器图标并重新连接来重新启动它。但后来我搜索了互联网,找到了以下 2 个解决方法:
echo "options iwlwifi 11n_disable=1" | sudo tee /etc/modprobe.d/iwlwifi.conf
sudo modprobe -rfv iwlwifi
sudo modprobe -v iwlwifi
和
sudo -i
echo "options rtl8723be fwlps=0" > /etc/modprobe.d/rtl8723be.conf
modprobe -r rtl8723be
modprobe rtl8723be
exit
两者都做了,现在我无法通过单击图标重新连接,需要重新启动 PC。发现无需重新启动即可重新启动连接:
sudo service network-manager restart
以下是无线信息脚本的输出:
########## wireless info START ##########
Report from: 15 Aug 2015 15:58 EEST +0300
Booted last: 15 Aug 2015 15:49 EEST +0300
Script from: 14 Jul 2015 17:04 UTC +0000
##### release ###########################
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
##### kernel ############################
Linux 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Parameters: ro, quiet, splash, vt.handoff=7
##### desktop ###########################
Ubuntu
##### lspci #############################
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 06)
Subsystem: ASUSTeK Computer Inc. P8P67 and other motherboards [1043:8432]
Kernel driver in use: r8169
##### lsusb #############################
Bus 003 Device 002: ID 0781:5572 SanDisk Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 04f3:0103 Elan Microelectronics Corp. ActiveJet K-2024 Multimedia Keyboard
Bus 004 Device 002: ID 2188:0ae1
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
##### PCMCIA card info ##################
##### rfkill ############################
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
##### lsmod #############################
rtl8192cu 67741 0
rtl_usb 18448 1 rtl8192cu
rtlwifi 64255 2 rtl_usb,rtl8192cu
rtl8192c_common 53172 1 rtl8192cu
mac80211 652777 3 rtl_usb,rtlwifi,rtl8192cu
cfg80211 498458 2 mac80211,rtlwifi
eeepc_wmi 13151 0
asus_wmi 24094 1 eeepc_wmi
sparse_keymap 13948 1 asus_wmi
video 20128 1 asus_wmi
wmi 19193 1 asus_wmi
##### interfaces ########################
auto lo
iface lo inet loopback
##### ifconfig ##########################
eth0 Link encap:Ethernet HWaddr <MAC 'eth0' [IF]>
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)
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:6127 errors:0 dropped:0 overruns:0 frame:0
TX packets:5181 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4296934 (4.2 MB) TX bytes:785909 (785.9 KB)
##### iwconfig ##########################
eth0 no wireless extensions.
lo no wireless extensions.
wlan0 IEEE 802.11bgn ESSID:"krasota"
Mode:Managed Frequency:2.412 GHz Access Point: <MAC 'krasota' [AC1]>
Bit Rate=150 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr=2347 B Fragment thr:off
Power Management:off
Link Quality=54/70 Signal level=-56 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:5 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.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 862 1 0 15:49 ? 00:00:00 NetworkManager
##### NetworkManager info ###############
NetworkManager Tool
State: connected (global)
- Device: wlan0 [krasota] -----------------------------------------------------
Type: 802.11 WiFi
Driver: rtl8192cu
State: connected
Default: yes
HW Address: <MAC 'wlan0' [IF]>
Capabilities:
Speed: 150 Mb/s
Wireless Properties
WEP Encryption: yes
WPA Encryption: yes
WPA2 Encryption: yes
Wireless Access Points (* = current AP)
Keenetic-0134: Infra, <MAC 'Keenetic-0134' [AC2]>, Freq 2422 MHz, Rate 54 Mb/s, Strength 87 WPA2
Soti: Infra, <MAC 'Soti' [AC4]>, Freq 2452 MHz, Rate 54 Mb/s, Strength 54 WPA WPA2
nexus: Infra, <MAC 'nexus' [AC3]>, Freq 2437 MHz, Rate 54 Mb/s, Strength 20 WPA WPA2
RAMSA: Infra, <MAC 'RAMSA' [AN4]>, Freq 2432 MHz, Rate 54 Mb/s, Strength 4 WPA2
Lanet: Infra, <MAC 'Lanet' [AN5]>, Freq 2452 MHz, Rate 54 Mb/s, Strength 4 WPA WPA2
volia 30 2: Infra, <MAC 'volia 30 2' [AN6]>, Freq 2437 MHz, Rate 54 Mb/s, Strength 4 WEP
mimimishka: Infra, <MAC 'mimimishka' [AN7]>, Freq 2457 MHz, Rate 54 Mb/s, Strength 4 WPA2
EVA BRAUN: Infra, <MAC 'EVA BRAUN' [AN8]>, Freq 2462 MHz, Rate 54 Mb/s, Strength 4 WPA2
*krasota: Infra, <MAC 'krasota' [AC1]>, Freq 2412 MHz, Rate 54 Mb/s, Strength 60 WPA WPA2
putinKHUYLO: Infra, <MAC 'putinKHUYLO' [AN10]>, Freq 2462 MHz, Rate 54 Mb/s, Strength 4 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
- Device: eth0 -----------------------------------------------------------------
Type: Wired
Driver: r8169
State: unavailable
Default: no
HW Address: <MAC 'eth0' [IF]>
Capabilities:
Carrier Detect: yes
Wired Properties
Carrier: off
##### NetworkManager.state ##############
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
WimaxEnabled=true
##### NetworkManager.conf ###############
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
##### NetworkManager profiles ###########
[[/etc/NetworkManager/system-connections/mimimishka]] (600 root)
[connection] id=mimimishka | type=802-11-wireless
[802-11-wireless] ssid=mimimishka | mac-address=<MAC 'wlan0' [IF]>
[ipv4] method=auto
[ipv6] method=auto
[[/etc/NetworkManager/system-connections/krasota]] (600 root)
[connection] id=krasota | type=802-11-wireless
[802-11-wireless] ssid=krasota | mac-address=<MAC 'wlan0' [IF]>
[ipv4] method=auto
[ipv6] method=auto
##### iw reg get ########################
Region: Europe/Kiev (based on set time zone)
country UA:
(2400 - 2483 @ 40), (N/A, 20), NO-OUTDOOR
(5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR
(57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
##### iwlist channels ###################
eth0 no frequency information.
lo no frequency information.
wlan0 11 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
Current Frequency:2.412 GHz (Channel 1)
##### iwlist scan #######################
eth0 Interface doesn't support scanning.
lo Interface doesn't support scanning.
Channel occupancy:
1 APs on Frequency:2.412 GHz (Channel 1)
1 APs on Frequency:2.422 GHz (Channel 3)
1 APs on Frequency:2.437 GHz (Channel 6)
1 APs on Frequency:2.452 GHz (Channel 9)
wlan0 Scan completed :
Cell 01 - Address: <MAC 'krasota' [AC1]>
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=52/70 Signal level=-58 dBm
Encryption key:on
ESSID:"krasota"
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=00000002b8d0fe19
Extra: Last beacon: 84ms 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 'Keenetic-0134' [AC2]>
Channel:3
Frequency:2.422 GHz (Channel 3)
Quality=48/70 Signal level=-62 dBm
Encryption key:on
ESSID:"Keenetic-0134"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s
18 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=00000649a2dad2ce
Extra: Last beacon: 84ms ago
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 03 - Address: <MAC 'nexus' [AC3]>
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=12/70 Signal level=-98 dBm
Encryption key:on
ESSID:"nexus"
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=000001a689e7a006
Extra: Last beacon: 84ms ago
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 04 - Address: <MAC 'Soti' [AC4]>
Channel:9
Frequency:2.452 GHz (Channel 9)
Quality=42/70 Signal level=-68 dBm
Encryption key:on
ESSID:"Soti"
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=0000000185dbcfac
Extra: Last beacon: 84ms ago
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
##### module infos ######################
[rtl8192cu]
filename: /lib/modules/3.16.0-45-generic/kernel/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
firmware: rtlwifi/rtl8192cufw_TMSC.bin
firmware: rtlwifi/rtl8192cufw_B.bin
firmware: rtlwifi/rtl8192cufw_A.bin
firmware: rtlwifi/rtl8192cufw.bin
description: Realtek 8192C/8188C 802.11n USB wireless
license: GPL
author: Larry Finger <[email protected]>
author: Ziv Huang <[email protected]>
author: Georgia <[email protected]>
srcversion: 93FD064658D2AD5B6991075
depends: rtlwifi,rtl8192c-common,rtl_usb,mac80211
intree: Y
vermagic: 3.16.0-45-generic SMP mod_unload modversions
signer: Magrathea: Glacier signing key
sig_key: C1:A3:1E:DB:9F:C4:C6:4E:2D:95:A7:FF:18:A6:73:D1:8C:AB:15:A6
sig_hashalgo: sha512
parm: swenc:Set to 1 for software crypto (default 0)
(bool)
parm: debug:Set debug level (0-5) (default 0) (int)
[rtl_usb]
filename: /lib/modules/3.16.0-45-generic/kernel/drivers/net/wireless/rtlwifi/rtl_usb.ko
description: USB basic driver for rtlwifi
license: GPL
author: Larry Finger <[email protected]>
author: Realtek WlanFAE <[email protected]>
author: lizhaoming <[email protected]>
srcversion: 94CFED30E3318E18EC4B740
depends: rtlwifi,mac80211
intree: Y
vermagic: 3.16.0-45-generic SMP mod_unload modversions
signer: Magrathea: Glacier signing key
sig_key: C1:A3:1E:DB:9F:C4:C6:4E:2D:95:A7:FF:18:A6:73:D1:8C:AB:15:A6
sig_hashalgo: sha512
[rtlwifi]
filename: /lib/modules/3.16.0-45-generic/kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko
description: Realtek 802.11n PCI wireless core
license: GPL
author: Larry Finger <[email protected]>
author: Realtek WlanFAE <[email protected]>
author: lizhaoming <[email protected]>
srcversion: 8362106E96F806A9DBAE565
depends: mac80211,cfg80211
intree: Y
vermagic: 3.16.0-45-generic SMP mod_unload modversions
signer: Magrathea: Glacier signing key
sig_key: C1:A3:1E:DB:9F:C4:C6:4E:2D:95:A7:FF:18:A6:73:D1:8C:AB:15:A6
sig_hashalgo: sha512
[rtl8192c_common]
filename: /lib/modules/3.16.0-45-generic/kernel/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
description: Realtek 8192C/8188C 802.11n PCI wireless
license: GPL
author: Larry Finger <[email protected]>
author: Ziv Huang <[email protected]>
author: Georgia <[email protected]>
author: Realtek WlanFAE <[email protected]>
author: lizhaoming <[email protected]>
srcversion: A279C50E29ED7F277EAF738
depends:
intree: Y
vermagic: 3.16.0-45-generic SMP mod_unload modversions
signer: Magrathea: Glacier signing key
sig_key: C1:A3:1E:DB:9F:C4:C6:4E:2D:95:A7:FF:18:A6:73:D1:8C:AB:15:A6
sig_hashalgo: sha512
[mac80211]
filename: /lib/modules/3.16.0-45-generic/kernel/net/mac80211/mac80211.ko
license: GPL
description: IEEE 802.11 subsystem
srcversion: 315DCE1E2614AE1F38132D3
depends: cfg80211
intree: Y
vermagic: 3.16.0-45-generic SMP mod_unload modversions
signer: Magrathea: Glacier signing key
sig_key: C1:A3:1E:DB:9F:C4:C6:4E:2D:95:A7:FF:18:A6:73:D1:8C:AB:15:A6
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-45-generic/kernel/net/wireless/cfg80211.ko
description: wireless configuration support
license: GPL
author: Johannes Berg
srcversion: D48679749A6B8B822E391CA
depends:
intree: Y
vermagic: 3.16.0-45-generic SMP mod_unload modversions
signer: Magrathea: Glacier signing key
sig_key: C1:A3:1E:DB:9F:C4:C6:4E:2D:95:A7:FF:18:A6:73:D1:8C:AB:15:A6
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 #################
[rtl8192cu]
debug: 0
swenc: 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
rtc
##### 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]
options iwlwifi 11n_disable=1
[/etc/modprobe.d/mlx4.conf]
softdep mlx4_core post: mlx4_en
[/etc/modprobe.d/modesetting.conf]
options cirrus modeset=1
options mgag200 modeset=1
[/etc/modprobe.d/rtl8723be.conf]
options rtl8723be fwlps=0
##### rc.local ##########################
exit 0
##### pm-utils ##########################
##### udev rules ########################
[/etc/udev/rules.d/70-persistent-net.rules]
# PCI device 0x10ec:0x8168 (r8169)
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 (rtl8192cu)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<MAC 'wlan0' [IF]>", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
##### dmesg #############################
[ 20.635259] rtl8192cu: MAC auto ON okay!
[ 20.668023] rtl8192cu: Tx queue select: 0x05
[ 21.081076] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 22.700664] wlan0: authenticate with <MAC 'mimimishka' [AN7]>
[ 22.724773] wlan0: send auth to <MAC 'mimimishka' [AN7]> (try 1/3)
[ 22.726614] wlan0: authenticated
[ 22.728123] wlan0: associate with <MAC 'mimimishka' [AN7]> (try 1/3)
[ 22.740820] wlan0: RX AssocResp from <MAC 'mimimishka' [AN7]> (capab=0x411 status=0 aid=1)
[ 22.740880] wlan0: associated
[ 22.740888] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 27.074978] wlan0: deauthenticated from <MAC 'mimimishka' [AN7]> (Reason: 15=4WAY_HANDSHAKE_TIMEOUT)
[ 27.094197] wlan0: authenticate with <MAC 'mimimishka' [AN7]>
[ 27.106253] wlan0: send auth to <MAC 'mimimishka' [AN7]> (try 1/3)
[ 27.107837] wlan0: authenticated
[ 27.109691] wlan0: associate with <MAC 'mimimishka' [AN7]> (try 1/3)
[ 27.123577] wlan0: RX AssocResp from <MAC 'mimimishka' [AN7]> (capab=0x411 status=0 aid=1)
[ 27.123643] wlan0: associated
[ 31.274826] wlan0: deauthenticated from <MAC 'mimimishka' [AN7]> (Reason: 15=4WAY_HANDSHAKE_TIMEOUT)
[ 38.238369] wlan0: authenticate with <MAC 'krasota' [AC1]>
[ 38.250536] wlan0: send auth to <MAC 'krasota' [AC1]> (try 1/3)
[ 38.253479] wlan0: authenticated
[ 38.255457] wlan0: associate with <MAC 'krasota' [AC1]> (try 1/3)
[ 38.274106] wlan0: RX AssocResp from <MAC 'krasota' [AC1]> (capab=0x431 status=0 aid=3)
[ 38.274165] wlan0: associated
########## wireless info END ############
请帮忙。
答案1
你做错了一切。你尝试配置与无线适配器完全无关的驱动程序。
您需要通过这种方式安装正确的驱动程序。
sudo add-apt-repository ppa:hanipouspilot/rtlwifi
sudo apt-get update
sudo apt-get install rtl8192cu-dkms linux-firmware
如果你没有破坏其他任何东西,你的 USB 加密狗在之后应该可以更好地工作重启。
删除你创建的配置文件也是有意义的
sudo rm /etc/modprobe.d/iwlwifi.conf
sudo rm /etc/modprobe.d/rtl8723be.conf