编辑

编辑

我在 MiniPC 上安装了 Ubuntu Server 16.4,配有 RT3090 无线网卡。起初,WiFi 无法使用。

lshw -c network   
     ....
     *-network DISABLED
          description: Wireless interface
          product: RT3090 Wireless 802.11n 1T/1R PCIe
          vendor: Ralink 

发现建议将这些模块列入黑名单:

#Z Copied from http://askubuntu.com/questions/478018/ralink-rt3090-in-ubuntu-14-04-very-bad-reception-keeps-disconnecting
blacklist rt2800usb
blacklist rt2x00lib
blacklist rt2x00pci
blacklist rt2x00usb
blacklist rt2800mmio
blacklist rt2x00m

据我所记得,那时 - 烦恼DISABLED就消失了。我甚至设法用 手动连接到 WiFi wpa_supplicant。然后我安装了几个软件包,例如NetworkManager,尝试使连接自动进行 - 然后我失去了 WiFi :-( 我删除了NetworkManager,假设它造成了一些冲突。

现在,lshw网络中DISABLED又出现了。

已尝试rfkill-我不确定,但对我来说似乎还可以:

$ rfkill list all
0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
  • 在 WiFi 已经正常工作之后,什么可能导致其被禁用?

在 中dmesg,我现在看到了这个:

 [    8.519249] rt2800pci 0000:02:00.0 wlp2s0: renamed from wlan0
  • 这是否意味着rt2800pci是不是列入黑名单?

搜索了一下/var/log/kern.log ,发现了一些有趣的事情:

Nov  2 23:06:27 ubuntu-maty kernel: [  730.827229] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2860.bin'
Nov  2 23:06:27 ubuntu-maty kernel: [  730.828681] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.34
Nov  2 23:06:27 ubuntu-maty kernel: [  730.920573] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
Nov  2 23:11:50 ubuntu-maty kernel: [ 1053.650997] wlp2s0: authenticate with 38:d5:47:1e:60:a0
Nov  2 23:11:50 ubuntu-maty kernel: [ 1053.682302] wlp2s0: send auth to 38:d5:47:1e:60:a0 (try 1/3)
Nov  2 23:11:50 ubuntu-maty kernel: [ 1053.684214] wlp2s0: authenticated

看来这是 WiFi 为我工作的时间 - 并且它已加载rt2860.bin- 没有进一步提及。

  • 我如何返回rt2860.bin

编辑

添加wireless-info脚本的输出:

    ########## wireless info START ##########

    Report from: 03 Nov 2016 01:30 IST +0200

    Booted last: 03 Nov 2016 00:00 IST +0200

    Script from: 08 Jul 2016 02:16 UTC +0000

    ##### release ###########################

    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04.1 LTS
    Release:        16.04
    Codename:       xenial

    ##### kernel ############################

    Linux 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

    Parameters: ro

    ##### desktop ###########################

    sed: can't read /home/zvika/.dmrc: No such file or directory

    Could not be determined.

    ##### lspci #############################

    01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 06)
            Subsystem: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:0123]
            Kernel driver in use: r8169

    02:00.0 Network controller [0280]: Ralink corp. RT3090 Wireless 802.11n 1T/1R PCIe [1814:3090]
            Subsystem: Ralink corp. RT3090 Wireless 802.11n 1T/1R PCIe [1814:3090]
            Kernel driver in use: rt2800pci

    ##### lsusb #############################

    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 007: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive
    Bus 001 Device 006: ID 045e:0780 Microsoft Corp. Comfort Curve Keyboard 3000
    Bus 001 Device 005: ID 045e:077b Microsoft Corp.
    Bus 001 Device 004: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
    Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
    Bus 001 Device 002: ID 0658:0200 Sigma Designs, Inc.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    ##### PCMCIA card info ##################

    'pccardctl' is not installed (package "pcmciautils").

    ##### rfkill ############################

    0: phy0: Wireless LAN
            Soft blocked: no
            Hard blocked: no

    ##### lsmod #############################

    rt2800pci              16384  0
    rt2800mmio             20480  1 rt2800pci
    rt2800lib              94208  2 rt2800pci,rt2800mmio
    rt2x00pci              16384  1 rt2800pci
    rt2x00mmio             16384  2 rt2800pci,rt2800mmio
    rt2x00lib              57344  5 rt2x00pci,rt2800lib,rt2800pci,rt2800mmio,rt2x00mmio
    mac80211              737280  3 rt2x00lib,rt2x00pci,rt2800lib
    cfg80211              565248  2 mac80211,rt2x00lib
    eeprom_93cx6           16384  1 rt2800pci
    crc_ccitt              16384  1 rt2800lib
    snd_soc_rt5670        126976  0
    snd_soc_rl6231         16384  1 snd_soc_rt5670
    snd_soc_core          212992  2 snd_soc_rt5670,snd_soc_sst_mfld_platform
    snd_pcm               106496  8 snd_soc_rt5670,snd_soc_core,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_soc_sst_mfld_platform,snd_pcm_dmaengine,snd_hda_core

    ##### interfaces ########################

    source /etc/network/interfaces.d/*

    auto lo
    iface lo inet loopback

    auto enp1s0
    iface enp1s0 inet dhcp

    ##### ifconfig ##########################

    enp1s0    Link encap:Ethernet  HWaddr <MAC 'enp1s0' [IF1]>
              inet addr:192.168.1.191  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::<IP6 'enp1s0' [IF1]>/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2115 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1628 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:214067 (214.0 KB)  TX bytes:254823 (254.8 KB)

    wlp2s0    Link encap:Ethernet  HWaddr <MAC 'wlp2s0' [IF2]>
              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)

    ##### iwconfig ##########################

    lo        no wireless extensions.

    enp1s0    no wireless extensions.

    wlp2s0    IEEE 802.11bgn  ESSID:off/any
              Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
              Retry short limit:7   RTS thr:off   Fragment thr:off
              Power Management:off


    ##### 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 enp1s0
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp1s0

    ##### resolv.conf #######################

    nameserver 192.168.1.1

    ##### network managers ##################

    Installed:

            None found.

    Running:

            None found.

    ##### NetworkManager info ###############

    NetworkManager is not installed (package "network-manager").

    ##### NetworkManager.state ##############

    [main]
    NetworkingEnabled=true
    WirelessEnabled=true
    WWANEnabled=true

    ##### NetworkManager.conf ###############

    [main]
    plugins=ifupdown,keyfile,ofono
    dns=dnsmasq

    [ifupdown]
    managed=false

    ##### NetworkManager profiles ###########

    [[/etc/NetworkManager/system-connections/YairHatal]] (600 root)
    [connection] id=YairHatal | type=wifi | permissions=user:zvika:;
    [wifi] mac-address=<MAC 'wlp2s0' [IF2]> | mac-address-blacklist= | ssid=YairHatal
    [ipv4] method=auto
    [ipv6] method=auto

    ##### iw reg get ########################

    Region: Asia/Jerusalem (based on set time zone)

    country 00: DFS-UNSET
            (2402 - 2472 @ 40), (N/A, 20), (N/A)
            (2457 - 2482 @ 40), (N/A, 20), (N/A), NO-IR
            (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, NO-IR
            (5170 - 5250 @ 80), (N/A, 20), (N/A), NO-IR
            (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, NO-IR
            (5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, NO-IR
            (5735 - 5835 @ 80), (N/A, 20), (N/A), NO-IR
            (57240 - 63720 @ 2160), (N/A, 0), (N/A)

    ##### iwlist channels ###################

    lo        no frequency information.

    enp1s0    no frequency information.

    wlp2s0    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

    ##### iwlist scan #######################

    lo        Interface doesn't support scanning.

    enp1s0    Interface doesn't support scanning.

    wlp2s0    Interface doesn't support scanning : Network is down

    ##### module infos ######################

    [rt2800pci]
    filename:       /lib/modules/4.4.0-45-generic/kernel/drivers/net/wireless/rt2x00/rt2800pci.ko
    license:        GPL
    firmware:       rt2860.bin
    description:    Ralink RT2800 PCI & PCMCIA Wireless LAN driver.
    version:        2.3.0
    author:         http://rt2x00.serialmonkey.com
    srcversion:     26CCED9E0CE5EFBFA9B8882
    depends:        rt2x00lib,rt2800lib,rt2800mmio,rt2x00mmio,rt2x00pci,eeprom_93cx6
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions
    parm:           nohwcrypt:Disable hardware encryption. (bool)

    [rt2800mmio]
    filename:       /lib/modules/4.4.0-45-generic/kernel/drivers/net/wireless/rt2x00/rt2800mmio.ko
    license:        GPL
    description:    rt2800 MMIO library
    version:        2.3.0
    author:         http://rt2x00.serialmonkey.com
    srcversion:     01C1A7641505065E52E0388
    depends:        rt2800lib,rt2x00lib,rt2x00mmio
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions

    [rt2800lib]
    filename:       /lib/modules/4.4.0-45-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:     BB9F48B63A82C3FD3E73BAF
    depends:        rt2x00lib,mac80211,crc-ccitt
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions

    [rt2x00pci]
    filename:       /lib/modules/4.4.0-45-generic/kernel/drivers/net/wireless/rt2x00/rt2x00pci.ko
    license:        GPL
    description:    rt2x00 pci library
    version:        2.3.0
    author:         http://rt2x00.serialmonkey.com
    srcversion:     543B84557258F153AC267F0
    depends:        rt2x00lib,mac80211
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions

    [rt2x00mmio]
    filename:       /lib/modules/4.4.0-45-generic/kernel/drivers/net/wireless/rt2x00/rt2x00mmio.ko
    license:        GPL
    description:    rt2x00 mmio library
    version:        2.3.0
    author:         http://rt2x00.serialmonkey.com
    srcversion:     ADBE279820CFD0A1081C682
    depends:        rt2x00lib
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions

    [rt2x00lib]
    filename:       /lib/modules/4.4.0-45-generic/kernel/drivers/net/wireless/rt2x00/rt2x00lib.ko
    license:        GPL
    description:    rt2x00 library
    version:        2.3.0
    author:         http://rt2x00.serialmonkey.com
    srcversion:     72E39180D883A5541F66494
    depends:        mac80211,cfg80211
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions

    [mac80211]
    filename:       /lib/modules/4.4.0-45-generic/kernel/net/mac80211/mac80211.ko
    license:        GPL
    description:    IEEE 802.11 subsystem
    srcversion:     F1176862D12ECD05A1066CF
    depends:        cfg80211
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions
    parm:           minstrel_vht_only:Use only VHT rates when VHT is supported by sta. (bool)
    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/4.4.0-45-generic/kernel/net/wireless/cfg80211.ko
    description:    wireless configuration support
    license:        GPL
    author:         Johannes Berg
    srcversion:     25A45701AAA64DAC1E47D9D
    depends:
    intree:         Y
    vermagic:       4.4.0-45-generic SMP mod_unload modversions
    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 #################

    [rt2800pci]
    nohwcrypt: N

    [mac80211]
    beacon_loss_count: 7
    ieee80211_default_rc_algo: minstrel_ht
    max_nullfunc_tries: 2
    max_probe_tries: 5
    minstrel_vht_only: Y
    probe_wait_ms: 500

    [cfg80211]
    cfg80211_disable_40mhz_24ghz: N
    ieee80211_regdom: 00

    ##### /etc/modules ######################

    ##### 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
    blacklist rt2800usb
    blacklist rt2x00lib
    blacklist rt2x00pci
    blacklist rt2x00usb
    blacklist rt2800mmio
    blacklist rt2x00m

    [/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/mlx4.conf]
    softdep mlx4_core post: mlx4_en

    ##### rc.local ##########################

    exit 0

    ##### pm-utils ##########################

    ##### udev rules ########################

    ##### dmesg #############################

    [    8.177532] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3071, rev 0213 detected
    [    8.181522] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0005 detected
    [    8.518626] r8169 0000:01:00.0 enp1s0: link down (repeated 2 times)
    [    8.518719] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
    [    8.519249] rt2800pci 0000:02:00.0 wlp2s0: renamed from wlan0
    [   11.253234] r8169 0000:01:00.0 enp1s0: link up
    [   11.253259] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready

    ########## wireless info END ############

答案1

显示为 DISABLED 的接口正是 /etc/network/interfaces 中未声明的接口。请将文件修改为:

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

#auto enp1s0
iface enp1s0 inet dhcp

auto wlp2s0
iface wlp2s0 inet static
address 192.168.1.25
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8
wpa-ssid <your_network>
wpa-psk <your_secret_key>

我建议在服务器中使用静态地址,以便您可以通过 ftp 和 ssh 访问它。务必选择路由器、交换机或其他接入点中的 DHCP 服务器使用的范围之外的静态地址。

此外,你的黑名单毫无意义。我建议你这样做:

sudo gedit /etc/modprobe.d/blacklist.conf

如果您没有文本编辑器 gedit,请使用 nano 或 kate 或 leafpad。删除您添加的这些行。

#Z Copied from http://askubuntu.com/questions/478018/ralink-rt3090-in-ubuntu-14-04-very-bad-reception-keeps-disconnecting
blacklist rt2800usb
blacklist rt2x00lib
blacklist rt2x00pci
blacklist rt2x00usb
blacklist rt2800mmio
blacklist rt2x00m

仔细校对,保存并关闭文本编辑器。

拔下以太网电缆,重新启动并告诉我们您是否已连接。

相关内容