我有一些配备 Broadcom BCM43225 802.11b/g/n WiFi 卡的笔记本电脑。我安装了驱动程序wl0
版本 6.30.223.141 (r415941)。
我使用隐藏的 wifi ssid 进行连接。当我带着笔记本电脑四处走动时,没有问题,它会与其他接入点 (AP) 建立连接。但是当我关闭笔记本电脑并在另一个 AP 区域打开它时,它不会自动重新连接。似乎只能自动连接到它之前连接过的 AP。
更换驱动程序只会带来改进,即重新连接不再需要密码。
有什么建议可以让 Ubuntu 14.04 在另一个接入点区域启动笔记本电脑时自动重新连接到隐藏的 wifi ssid?
大约有 80 台笔记本电脑和几十个接入点以及使用访客会话的学生。
$ sudo lshw -C network
*-network
description: Wireless interface
product: BCM43225 802.11b/g/n
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:01:00.0
logical name: wlan0
version: 01
serial: 5c:ac:4c:04:dd:d7
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=wl0 driverversion=6.30.223.141 (r415941) ip=172.17.23.137 latency=0 multicast=yes wireless=IEEE 802.11abg
resources: irq:16 memory:95400000-95403fff
带有日志信息的新测试:
启动笔记本电脑:获取 wifi 连接 MRTG_WIFI3 到之前连接过的接入点
关闭笔记本电脑
移至另一个接入点
启动笔记本电脑:没有自动连接到MRTG_WIFI3
移动(漫游)到另一个“已知”接入点:它立即连接到MRTG_WIFI3
网络相关的系统日志:
$ sudo grep -i networkmanager /var/log/syslog :
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> Loaded plugin (null): (null)
Oct 7 11:12:26 kw1-03 NetworkManager[940]: Ifupdown: get unmanaged devices count: 0
Oct 7 11:12:26 kw1-03 NetworkManager[940]: SCPlugin-Ifupdown: (17629936) ... get_connections.
Oct 7 11:12:26 kw1-03 NetworkManager[940]: SCPlugin-Ifupdown: (17629936) ... get_connections (managed=false): return empty list.
Oct 7 11:12:26 kw1-03 NetworkManager[940]: keyfile: parsing MRTG_WIFI3 ...
Oct 7 11:12:26 kw1-03 NetworkManager[940]: keyfile: read connection 'MRTG_WIFI3'
Oct 7 11:12:26 kw1-03 NetworkManager[940]: keyfile: parsing mrtg_guest ...
Oct 7 11:12:26 kw1-03 NetworkManager[940]: keyfile: read connection 'mrtg_guest'
Oct 7 11:12:26 kw1-03 NetworkManager[940]: keyfile: parsing MRTG_WIFI3 ...
Oct 7 11:12:26 kw1-03 NetworkManager[940]: keyfile: read connection 'MRTG_WIFI3'
Oct 7 11:12:26 kw1-03 NetworkManager[940]: SCPlugin-Ofono: (17414592) ... get_connections.
Oct 7 11:12:26 kw1-03 NetworkManager[940]: SCPlugin-Ofono: (17414592) connections count: 0
Oct 7 11:12:26 kw1-03 NetworkManager[940]: Ifupdown: get unmanaged devices count: 0
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> monitoring kernel firmware directory '/lib/firmware'.
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> rfkill1: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/ieee80211/phy0/rfkill1) (driver wl)
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> rfkill2: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/wlan0/rfkill2) (driver wl)
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> rfkill0: found WiFi radio killswitch (at /sys/devices/platform/acer-wmi/rfkill/rfkill0) (platform driver acer-wmi)
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> WiFi enabled by radio killswitch; enabled by state file
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> WWAN enabled by radio killswitch; enabled by state file
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> WiMAX enabled by radio killswitch; enabled by state file
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> Networking is enabled by state file
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (wlan0): using nl80211 for WiFi device control
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (wlan0): new 802.11 WiFi device (driver: 'wl' ifindex: 3)
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (wlan0): exported as /org/freedesktop/NetworkManager/Devices/0
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (wlan0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (wlan0): bringing up device.
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (wlan0): preparing device.
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (wlan0): deactivating device (reason 'managed') [2]
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <warn> failed to allocate link cache: (-12) Object not found
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (eth0): carrier is OFF
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (eth0): new Ethernet device (driver: 'tg3' ifindex: 2)
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (eth0): exported as /org/freedesktop/NetworkManager/Devices/1
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (eth0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Oct 7 11:12:26 kw1-03 NetworkManager[940]: <info> (eth0): bringing up device.
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> (eth0): preparing device.
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> (eth0): deactivating device (reason 'managed') [2]
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> Added default wired connection 'Wired connection 1' for /sys/devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/eth0
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <warn> /sys/devices/virtual/net/lo: couldn't determine device driver; ignoring...
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <warn> /sys/devices/virtual/net/lo: couldn't determine device driver; ignoring...
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> urfkill disappeared from the bus
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> wpa_supplicant started
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> ModemManager available in the bus
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> (wlan0) supports 1 scan SSIDs
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <warn> Trying to remove a non-existant call id.
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: starting -> ready
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> (wlan0): device state change: unavailable -> disconnected (reason 'supplicant-available') [20 30 42]
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: ready -> disconnected
Oct 7 11:12:27 kw1-03 NetworkManager[940]: <info> (wlan0) supports 1 scan SSIDs
Oct 7 11:12:28 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: disconnected -> inactive
Oct 7 11:12:37 kw1-03 NetworkManager[940]: <info> WiFi hardware radio set enabled
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Auto-activating connection 'MRTG_WIFI3'.
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0) starting connection 'MRTG_WIFI3'
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> (wlan0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> NetworkManager state is now CONNECTING
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled...
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started...
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled...
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0/wireless): connection 'MRTG_WIFI3' has security, and secrets exist. No new secrets needed.
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Config: added 'ssid' value 'MRTG_WIFI3'
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Config: added 'scan_ssid' value '1'
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Config: added 'key_mgmt' value 'WPA-PSK'
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Config: added 'psk' value '<omitted>'
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> Config: set interface ap_scan to 1
Oct 7 11:28:39 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: inactive -> scanning
Oct 7 11:28:45 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: scanning -> associating
Oct 7 11:28:45 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: associating -> group handshake
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: group handshake -> completed
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0/wireless) Stage 2 of 5 (Device Configure) successful. Connected to wireless network 'MRTG_WIFI3'.
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) scheduled.
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) started...
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> (wlan0): device state change: config -> ip-config (reason 'none') [50 70 0]
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Beginning DHCPv4 transaction (timeout in 45 seconds)
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> dhclient started with pid 3218
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Beginning IP6 addrconf.
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) complete.
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> (wlan0): DHCPv4 state changed nbi -> preinit
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> (wlan0): DHCPv4 state changed preinit -> reboot
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> address 172.17.23.123
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> prefix 24 (255.255.255.0)
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> gateway 172.17.23.254
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> nameserver '172.16.2.30'
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> nameserver '172.16.2.33'
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> domain name 'ourdomainMRTG.nl'
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> wins '172.16.2.30'
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Configure Commit) scheduled...
Oct 7 11:28:48 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Commit) started...
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> (wlan0): device state change: ip-config -> secondaries (reason 'none') [70 90 0]
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Commit) complete.
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> (wlan0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> NetworkManager state is now CONNECTED_GLOBAL
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> Policy set 'MRTG_WIFI3' (wlan0) as default for IPv4 routing and DNS.
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> DNS: starting dnsmasq...
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <warn> dnsmasq not available on the bus, can't update servers.
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <error> [1412674129.764669] [nm-dns-dnsmasq.c:396] update(): dnsmasq owner not found on bus: Could not get owner of name 'org.freedesktop.NetworkManager.dnsmasq': no such name
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <warn> DNS: plugin dnsmasq update failed
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> Writing DNS information to /sbin/resolvconf
Oct 7 11:28:49 kw1-03 NetworkManager[940]: <info> (wlan0): roamed from BSSID C8:CB:B8:FB:AA:51 (MRTG_WIFI3) to C8:CB:B8:EC:54:B1 (MRTG_WIFI3)
Oct 7 11:28:50 kw1-03 NetworkManager[940]: <info> Activation (wlan0) successful, device activated.
Oct 7 11:28:50 kw1-03 NetworkManager[940]: <warn> dnsmasq appeared on DBus: :1.118
Oct 7 11:28:50 kw1-03 NetworkManager[940]: <info> Writing DNS information to /sbin/resolvconf
Oct 7 11:29:03 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: completed -> group handshake
Oct 7 11:29:03 kw1-03 NetworkManager[940]: <info> (wlan0): supplicant interface state: group handshake -> completed
Oct 7 11:29:03 kw1-03 NetworkManager[940]: <info> (wlan0): roamed from BSSID C8:CB:B8:EC:54:B1 (MRTG_WIFI3) to (none) ((none))
Oct 7 11:29:09 kw1-03 NetworkManager[940]: <info> (wlan0): IP6 addrconf timed out or failed.
Oct 7 11:29:09 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
Oct 7 11:29:09 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) started...
Oct 7 11:29:09 kw1-03 NetworkManager[940]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) complete.
Oct 7 11:29:21 kw1-03 NetworkManager[940]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted
Oct 7 11:29:42 kw1-0 roamed 3 NetworkManager[940]: <info> (wlan0): roamed from BSSID (none) ((none)) to C8:CB:B8:FB:BE:D1 (MRTG_WIFI3)
答案1
我在此链接上找到的答案脚本有效: 无需提升权限即可自动连接隐藏无线网络
#!/bin/sh
#
# Automatically try to connect to 'MRTG_WIFI3' when WiFi is enabled
#
# the output of nmcli should be in English
LC_ALL=C
# loop for a while until NetworkManager is accepting commands
while [ "$(nmcli -t -f WIFI,STATE nm)" = 'enabled:disconnected' ]
do
nmcli con up id MRTG_WIFI3
sleep 5
done
exit 0
按照答案中所写的方式在启动时运行脚本: 如何在以 root 身份启动时运行脚本 使其适用于所有用户(包括来宾会话)