Debian系列Linux的WiFi配置

Debian系列Linux共用相同的deb安裝包,擁有大量的各類軟件,是Linux裏面最主要的生態系。包括Ubuntu及其衍生版本如Lubuntu/Mate/Kubuntu等,在ARM上也有恆好的支持如Rapsberry、LXDE、Hypriot等。ubuntu

對於Linux服務器的版本如Hypriot,初始鏡像沒有鏈接無線網絡,怎麼安裝上網絡支持呢?服務器

須要首先鏈接有線網,或者下載network-manager相應版本,而後運行dpkg -i 安裝上,而後就可使用nmcli的命令行進行網絡管理了。網絡

sudo apt install network-manager

安裝完後,可使用下面的nmcli命令行或者nmtui進入交互界面進行管理。less

 

Devices

列出網絡設備:ui

# nmcli dev
DEVICE     TYPE              STATE        
wlan0      802-11-wireless   disconnected     <====
usb0       802-3-ethernet    unmanaged    
eth0       802-3-ethernet    connected

Connections

列出當前鏈接的網絡:spa

#nmcli con    
NAME                      UUID                                   TYPE              TIMESTAMP-REAL                    
Wired connection 1        00000000-4a11-43d1-9252-4b92de0e75c3   802-3-ethernet    Thu Oct 23 05:46:02 2014          
WLAN-A69E22               29eeb2f6-cf80-0000-0000-d23733e97eb4   802-11-wireless   Thu Oct 30 16:06:14 2014          
Wireless connection 1     bfaa9524-a1d9-0000-8279-71a56720c06c   802-11-wireless   Wed Feb 24 02:33:55 2015          
Wireless connection 2     00000000-d5cc-411b-a62e-000000000000   802-11-wireless   Wed Oct 22 23:31:24 2014

Networks

#nmcli dev wifi list
SSID                              BSSID               MODE             FREQ       RATE       SIGNAL   SECURITY   ACTIVE  
'MAR'                       00:00:00:86:D0:22   Infrastructure   2462 MHz   54 MB/s    80       WEP        no      
'MYHOME'                    00:00:00:00:2D:16   Infrastructure   5180 MHz   44 MB/s    80       WPA WPA2   no

加入Wifi鏈接 SSID MYHOME ,在Fedora上:

nmcli con add con-name MyCafe ifname wlan0 type wifi ssid MyCafe ip4 192.168.100.101/24 gw4 192.168.100.1

HELP

Connections

# nmcli con help
Usage: nmcli con { COMMAND | help }
  COMMAND := { list | status | up | down | delete }

  list [id <id> | uuid <id>]
  status [id <id> | uuid <id> | path <path>]
  up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--timeout <timeout>]
  down id <id> | uuid <id>
  delete id <id> | uuid <id>

Devices

# nmcli dev help
Usage: nmcli dev { COMMAND | help }

  COMMAND := { status | list | disconnect | wifi }

  status
  list [iface <iface>]
  disconnect iface <iface> [--nowait] [--timeout <timeout>]
  wifi [list [iface <iface>] [bssid <BSSID>]]

查看指定網絡狀況:命令行

nmcli -f GENERAL,WIFI-PROPERTIES dev list iface wlan0

GENERAL.DEVICE:                         wlan0
GENERAL.TYPE:                           802-11-wireless
GENERAL.VENDOR:                         Realtek
GENERAL.PRODUCT:                        802.11n NIC
GENERAL.DRIVER:                         rtl8812au
GENERAL.HWADDR:                         04:8D:38:0F:D9:32
GENERAL.STATE:                          30 (disconnected)
GENERAL.REASON:                         42 (The supplicant is now available)
GENERAL.UDI:                            /sys/devices/ocp.3/47400000.usb/musb-hdrc.1.auto/usb1/1-1/1-1.3/1-1.3:1.0/net/wlan0
GENERAL.IP-IFACE:                       
GENERAL.NM-MANAGED:                     yes
GENERAL.FIRMWARE-MISSING:               no
GENERAL.CONNECTION:                     not connected
WIFI-PROPERTIES.WEP:                    yes
WIFI-PROPERTIES.WPA:                    yes
WIFI-PROPERTIES.WPA2:                   yes
WIFI-PROPERTIES.TKIP:                   yes
WIFI-PROPERTIES.CCMP:                   yes

查看網絡配置狀況,可使用ifconfig。3d

相關文章
相關標籤/搜索