无线网还是有问题

最大的社区版本,Ubuntu的发源地
yangdawei.hit
帖子: 245
注册时间: 2015-01-02 15:32
系统: Debian

无线网还是有问题

#1

帖子 yangdawei.hit » 2015-10-29 0:16

今天无线网又闹罢工了,无罢有线上网。到了晚上,还是想尝试解决一下。

系统:Debian 8.2 tesing
症状:有线网正常,20M光纤;无线网连不上。似乎问题仍然出在DNS上。

折腾过程如下:

1. 发现是安装了wicd network manager 之后出的问题,于是卸载:

代码: 全选

sudo apt-get remove wicd 
sudo apt-get autoremove
卸载后能无线上网了,但上网速度还是较有线上网慢得多。

2. 有线上网时:

代码: 全选

 (114.114.114.114) 56(84) bytes of data.
64 bytes from 114.114.114.114: icmp_seq=1 ttl=71 time=55.9 ms
64 bytes from 114.114.114.114: icmp_seq=2 ttl=93 time=56.1 ms
64 bytes from 114.114.114.114: icmp_seq=3 ttl=93 time=53.9 ms
64 bytes from 114.114.114.114: icmp_seq=4 ttl=72 time=55.4 ms
64 bytes from 114.114.114.114: icmp_seq=5 ttl=83 time=61.0 ms
64 bytes from 114.114.114.114: icmp_seq=6 ttl=86 time=55.1 ms
64 bytes from 114.114.114.114: icmp_seq=7 ttl=92 time=55.1 ms
64 bytes from 114.114.114.114: icmp_seq=8 ttl=68 time=55.9 ms
64 bytes from 114.114.114.114: icmp_seq=9 ttl=70 time=54.7 ms

3. 无线上网时:

代码: 全选

 ping 114.114.114.114
PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
64 bytes from 114.114.114.114: icmp_seq=1 ttl=72 time=7484 ms
64 bytes from 114.114.114.114: icmp_seq=2 ttl=71 time=18737 ms
64 bytes from 114.114.114.114: icmp_seq=3 ttl=89 time=18744 ms
64 bytes from 114.114.114.114: icmp_seq=4 ttl=64 time=19043 ms
64 bytes from 114.114.114.114: icmp_seq=5 ttl=71 time=18035 ms
64 bytes from 114.114.114.114: icmp_seq=6 ttl=67 time=17027 ms
64 bytes from 114.114.114.114: icmp_seq=7 ttl=66 time=16023 ms
64 bytes from 114.114.114.114: icmp_seq=8 ttl=87 time=15015 ms
64 bytes from 114.114.114.114: icmp_seq=9 ttl=85 time=14015 ms
64 bytes from 114.114.114.114: icmp_seq=10 ttl=72 time=13007 ms

代码: 全选

ping www.baidu.com
PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.
64 bytes from 220.181.111.188: icmp_seq=1 ttl=54 time=11591 ms
64 bytes from 220.181.111.188: icmp_seq=2 ttl=54 time=19909 ms
64 bytes from 220.181.111.188: icmp_seq=3 ttl=54 time=18903 ms
64 bytes from 220.181.111.188: icmp_seq=4 ttl=54 time=17896 ms
64 bytes from 220.181.111.188: icmp_seq=5 ttl=54 time=16889 ms
64 bytes from 220.181.111.188: icmp_seq=6 ttl=54 time=15881 ms
64 bytes from 220.181.111.188: icmp_seq=7 ttl=54 time=14873 ms
4. 可能是因为升级的缘故,现在有线和无线网卡的名称也变了。

代码: 全选

enp9s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 08:9e:01:89:a2:24  txqueuelen 1000  (Ethernet)
        RX packets 3703  bytes 2901936 (2.7 MiB)
        RX errors 0  dropped 7  overruns 0  frame 0
        TX packets 3778  bytes 582229 (568.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 124  bytes 14921 (14.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 124  bytes 14921 (14.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.103  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::2ed0:5aff:feb2:10ca  prefixlen 64  scopeid 0x20<link>
        ether 2c:d0:5a:b2:10:ca  txqueuelen 1000  (Ethernet)
        RX packets 4607  bytes 3409256 (3.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 26094
6. 不知为什么,总有169.254.0.0

代码: 全选

sudo route -nv
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    600    0        0 wlp3s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp3s0
192.168.0.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp3s0

7. 网卡

代码: 全选

sudo lspci -knn  | grep Network
03:00.0 Network controller [0280]: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter [14e4:4727] (rev 01)
安装的是私有驱动broadcom-sta-dkms。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 无线网还是有问题

#2

帖子 poloshiao » 2015-10-29 1:04

不知为什么,总有169.254.0.0
上次已經說明過了
就是你的 dhcp 設定不完整
第一次沒成功分配 IPv4
所以自動生成 169.254.0.0 路由
以確保本機不同網卡之間可以通訊

要檢查 dhcp 設定是否正確
有時要檢查 是否 程式套件 有瑕疵

參見
http://askubuntu.com/questions/660355/w ... ting-table
If a DHCP client attempts to get an address, but fails to find a DHCP server after the timeout and retries period it will randomly assume an address from this network. This allows communication with hosts that have failed to obtain a DHCP address.
yangdawei.hit
帖子: 245
注册时间: 2015-01-02 15:32
系统: Debian

Re: 无线网还是有问题

#3

帖子 yangdawei.hit » 2015-10-29 10:03

我做了以下操作,问题解决了。但需要说明的是,我仍然认为没有找到问题出在哪里。

代码: 全选

sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
sudo  modprobe -r b44 b43 b43legacy ssb brcmsmac
sudo modprobe wl
参考:
https://wiki.debian.org/wl
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 无线网还是有问题

#4

帖子 vickycq » 2015-10-29 10:18

感觉是 169.254 问题和 驱动问题的叠加。
169.254 问题 @poloshiao 大神已经解释过如何处理
驱动问题,BCM4313 不稳定的帖子数不胜数:
http://askubuntu.com/questions/232049/w ... om-bcm4313
http://askubuntu.com/questions/124615/b ... s-too-slow
http://askubuntu.com/questions/465558/b ... untu-14-04
http://askubuntu.com/questions/450049/e ... eless-card

但是这么多帖子,却没有一个提出有效的解决方案。

楼上的操作,在 broadcom-sta-dkms 已被正确安装的前提下 理论上是无效的?
但需要说明的是,我仍然认为没有找到问题出在哪里。
可能 wl 驱动工作也不稳定。由于私有驱动不在开源软件的体系之内,可能在某些环境下运作正常,某些环境下故障频发。因此从某种程度上讲,debian testing 频繁的内核升级加剧了此问题。

以我的 BCM43142 为例,使用 wl 驱动 3.16-3.19 内核断流严重,4.1 内核十分稳定。现在 4.2 内核问题又出现了。

可以再观察一段时间。既然楼上的操作暂时有效,以后再出现此问题时,尝试重新加载 wl 驱动

代码: 全选

sudo modprobe -r wl
sudo modprobe wl
pkill wpa_supplicant
sudo systemctl restart NetworkManager.service
若有效,则可断定为wl 驱动也不稳定。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 无线网还是有问题

#5

帖子 vickycq » 2015-10-29 10:25

yangdawei.hit 写了:我做了以下操作,问题解决了。但需要说明的是,我仍然认为没有找到问题出在哪里。

代码: 全选

sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
sudo  modprobe -r b44 b43 b43legacy ssb brcmsmac
sudo modprobe wl
可能的解释:
broadcom-sta-dkms 只是推荐 linux-headers-amd64 而不依赖。因此可能之前只安装了某个特定版本的 内核头文件,却没有安装虚包 linux-headers-amd64。
这样一来,最近内核升级后,新内核的头文件未自动安装。导致 broadcom-sta-dkms 无法为新内核构建 dkms 模块。
如上操作后,才修复了此问题。
但理论上 无法为新内核构建 dkms 模块 应该完全不工作?晕了... :Faint
所以可能的解释还在4楼。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
yangdawei.hit
帖子: 245
注册时间: 2015-01-02 15:32
系统: Debian

Re: 无线网还是有问题

#6

帖子 yangdawei.hit » 2015-10-29 10:44

我想我渐渐懂得了一个道理:No Zuo No Die!
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 无线网还是有问题

#7

帖子 vickycq » 2015-10-29 10:51

yangdawei.hit 写了:我想我渐渐懂得了一个道理:No Zuo No Die!
不能这样说。博通的卡又几乎没有开源驱动支持,出现情况是难免的。
如果我呆在 stable,将会一直被 3.16-3.19 内核的断流困扰。也享受不到 4.1 内核的稳定。但也无法预知 4.2 内核问题又出现问题。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
yangdawei.hit
帖子: 245
注册时间: 2015-01-02 15:32
系统: Debian

Re: 无线网还是有问题

#8

帖子 yangdawei.hit » 2015-10-29 11:09

代码: 全选

deb http://ftp.cn.debian.org/debian/ stretch main non-free contrib
deb-src http://ftp.cn.debian.org/debian/ stretch main non-free contrib
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
我将源的版本名称固定为stretch,代替testing。这样能确保等到stretch冻结后,我的系统就不会再成为testing版了吧。
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 无线网还是有问题

#9

帖子 vickycq » 2015-10-29 11:26

yangdawei.hit 写了: 我将源的版本名称固定为stretch,代替testing。这样能确保等到stretch冻结后,我的系统就不会再成为testing版了吧。
是的。不过预计冻结时间为 2016年12月05日。

Debconf 15 会议上,确定了Debian 9 "Stretch" 将于 2016年12月05日冻结。

代码: 全选

\begin{frame}{The Stretch freeze}
    The important dates are: 
    \begin{itemize} 
        \item Now: Do cool stuff for Stretch 
        \item Summer 2016: Please finish up things for Stretch 
        \item 5th of September 2016: Transition freeze 
        \item 5th of November 2016: ``Softfreeze'' 
        \item 5th of December 2016: The freeze 
    \end{itemize}
    Yes, it says 20\textbf{16}, which is over a year from now! 
\end{frame}
上次由 vickycq 在 2015-10-29 11:55,总共编辑 1 次。
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 无线网还是有问题

#10

帖子 poloshiao » 2015-10-29 11:43

则可断定为wl 驱动也不稳定。
測試 開源驅動 brcm80211 試試
是否比較好 ? 試試才知道
viewtopic.php?p=3146243#p3146243
4. 如果 wl 無法完全滿意 試試 brcm80211
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 无线网还是有问题

#11

帖子 vickycq » 2015-10-29 11:53

poloshiao 写了:
则可断定为wl 驱动也不稳定。
測試 開源驅動 brcm80211 試試
是否比較好 ? 試試才知道
viewtopic.php?p=3146243#p3146243
4. 如果 wl 無法完全滿意 試試 brcm80211
之前一直是 brcm80211(brcmsmac),因为不稳定才装的 broadcom-sta。

https://wireless.wiki.kernel.org/en/use ... /brcm80211
wireless.wiki.kernel.org/en/users/drivers/brcm80211 写了: Please note: at least BCM4313 is not fully supported. Some models appears to work (users reported success), but some don't, and there's no indication that this is going to change. For example: http://marc.info/?t=138817851800006&r=1&w=2
不过也许是之前 brcm80211(brcmsmac) 未配置好,可以再仔细阅读 poloshiao 大神的分析 viewtopic.php?p=3146243#p3146243
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 无线网还是有问题

#12

帖子 poloshiao » 2015-10-29 12:28

也许是之前 brcm80211(brcmsmac) 未配置好
試試 加上這個 firmware-brcm80211 套件
https://packages.debian.org/search?keyw ... -brcm80211

資料來源
https://wiki.debian.org/zh_TW/brcm80211
Broadcom BCM4313, BCM43224, BCM43225 等裝置 (brcmsmac, brcm80211)
需要 firmware-brcm80211 套件中的Non-free韌體。
yangdawei.hit
帖子: 245
注册时间: 2015-01-02 15:32
系统: Debian

Re: 无线网还是有问题

#13

帖子 yangdawei.hit » 2015-10-29 13:05

不过也许是之前 brcm80211(brcmsmac) 未配置好,可以再仔细阅读 poloshiao 大神的分析 viewtopic.php?p=3146243#p3146243
最开始安装的就是brcm80211的驱动,且按这个链接安装的。后来出了问题发帖求助。
試試 加上這個 firmware-brcm80211 套件
https://packages.debian.org/search?keyw ... -brcm80211
据链接https://wiki.debian.org/bcm43xx 所述,bcm4313的驱动应为:brcmsmac(https://wiki.debian.org/brcm80211)。看了poloshiao发的链接,才发现,其实支持bcm4313的驱动应为b43,而wl和brcm80211是替代方案。换言之,我可以有上述三种选择。

刚又查了一下现在的网卡驱动,发现:

代码: 全选

sudo lshw -numeric -class network
[sudo] password for yangdawei: 
  *-network               
       description: Wireless interface
       product: BCM4313 802.11bgn Wireless Network Adapter [14E4:4727]
...
       configuration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) ip=192.168.0.103 latency=0 multicast=yes wireless=IEEE 802.11abg
此处poloshiao已指出:
broadcom-sta-dkms 套件包 並沒有 wl0 驅動模組
,我明明安装的是broadcom-sta-dkms,为了是使用wl驱动,那wl0是哪来的呢?

poloshiao还曾指出,可以将wl0加入到黑名单中,可否告诉我具休如何操作?对了,wl0是什么驱动,在上述链接都没有看到。
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: 无线网还是有问题

#14

帖子 vickycq » 2015-10-29 13:26

yangdawei.hit 写了: 据链接https://wiki.debian.org/bcm43xx 所述,bcm4313的驱动应为:brcmsmac(https://wiki.debian.org/brcm80211)。看了poloshiao发的链接,才发现,其实支持bcm4313的驱动应为b43,而wl和brcm80211是替代方案。换言之,我可以有上述三种选择。
根据 b43 文档,b43 完全不支持 BCM4313。参见 https://wireless.wiki.kernel.org/en/use ... f_hardware
14e4:4313 和 14e4:4727 支持状态都是 no。您的型号为 14e4:4727
我明明安装的是broadcom-sta-dkms,为了是使用wl驱动,那wl0是哪来的呢?
wl0 应该就是 wl。lsmod | grep wl 列出的是 wl,但 lshw -C network 列出的是 wl0。
参考 http://ubuntuforums.org/showthread.php? ... ost7464597
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
yangdawei.hit
帖子: 245
注册时间: 2015-01-02 15:32
系统: Debian

Re: 无线网还是有问题

#15

帖子 yangdawei.hit » 2015-10-29 13:35

根据 b43 文档,b43 完全不支持 BCM4313。参见 https://wireless.wiki.kernel.org/en/use ... f_hardware
14e4:4313 和 14e4:4727 支持状态都是 no。您的型号是 14e4:4727
确实是我看错了,没看到前面的supported? 一列,以为列在后面的就是支持的。
wl0 应该就是 wl。lsmod | grep wl 列出的是 wl,但 lshw -C network 列出的是 wl0。
参考 http://ubuntuforums.org/showthread.php? ... ost7464597
大神都是火眼金睛吗?这样的细节都搜得到。
回复