apt install wireless-tools
安装完后，就可以使用iwconfig按下面步骤设置无线网络了
iwconfig wlan0 power on
ifconfig wlan0 up
iwconfig wlan0 essid "无线名称"
//然后使用wpa_passphrase生成无线密钥
sudo -i 
wpa_passphrase 无线名称 密码 > /etc/wpa_supplicant.conf
vim /etc/wpa_supplicant.conf
//里面应该有大致以下内容
network={
        ssid="my_network"   #注意ssid名区分大小写。
        proto=RSN           #Robust Security Network:强健安全网络，表示这个网络配置比WEP模式要更安全。
        key_mgmt=WPA-PSK    #请无论你是使用WPA-PSK，WPA2-PSK，都请在这里输入 WPA-PSK。这在wpa_supplicant看来WPA-PSK，WPA2-PSK都是 WPA-PSK
        pairwise=CCMP TKIP  #关键点，wpa_supplicant目前还不认AES的加密标准
        group=CCMP TKIP     #同上
        psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515 #wpa_supplicant算出来的加密密码。
chmod +wrx /etc/wpa_supplicant.conf
//以上配置文件设置完成后，接下来手动应用配置
//为了开机自动开启wifi，需要将启动脚本加到自动执行服务中，首先在/etc/rc.local中加入如下脚本：
#!/bin/bash
ip link set wlan0 up && killall wpa_supplicant && wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf &&
dhclient wlan0
exit 0
chmod a+x /etc/rc.local
然后编辑 /lib/systemd/system/rc-local.service加入如下配置：
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionPathExists=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
[Install]
WantedBy=multi-user.target
Alias=rc-local.service

systemctl enable rc-local.service
systemctl disable rc-local.service
systemctl start rc-local.service
systemctl status rc-local.service
如下内容为成功了
● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/rc-local.service.d
           └─debian.conf
   Active: active (running) since Fri 2019-10-25 16:03:17 UTC; 26min ago
     Docs: man:systemd-rc-local-generator(8)
  Process: 1621 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 1056)
   CGroup: /system.slice/rc-local.service
           ├─1627 wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
           └─1647 dhclient wlan0
//重启
reboot 