无线网卡的一种配置方法,通过wpa_supplicant并依据SSID及口令生成相关配置文件,然后讲配置文件挂接进网卡的的配置即可(树莓派中也使用这种方法)。当然也可以直接在interface无线网卡中配置明文的相关配置,条条大路通罗马而已。

ubuntu@ubuntu:~$ ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 28:d2:44:98:33:2a brd ff:ff:ff:ff:ff:ff
3: wlp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 18:cf:5e:00:84:ba brd ff:ff:ff:ff:ff:ff
    inet 192.168.224.102/24 brd 192.168.224.255 scope global wlp5s0
       valid_lft forever preferred_lft forever
    inet6 fe80::1acf:5eff:fe00:84ba/64 scope link 
       valid_lft forever preferred_lft forever

ubuntu-server16.0本身没有自带wpa_supplicant,所以一开始必须练有线网络安装

apt-get install wpasupplicant

把WiFi-ssid和密码写入一个配置文件

wpa_passphrase ssid password > xxx.conf

编辑网络配置文件vi /etc/network/interfaces

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
auto wlp5s0
iface wlp5s0 inet dhcp
wpa-conf /home/ubuntu/xxx.conf
# The primary network interface

生成无线网卡的配置文件需要用到一下的方法,当然了wpa_supplicant是需要单独安装的。

wpa_supplicant  -i wlp5s0  -c /home/ubuntu/xxx.conf

Logo

更多推荐