ubuntu18.04.2安装wifi模块以及配置命令提示行连接无线

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/xianlvfan2224/article/details/93159244

ubuntu18.04.2系统安装无线模块并调试连接

首先需要安装网卡驱动

sudo apt-get update更新软件源
sudo apt install broadcom-sta-dkms
会提示有未能满足的依赖关系执行下面命令
sudo apt --fix-broken install
成功安装wifi驱动

查看是否已经正确安装无线网卡

iwconfig

我这里的是wlp3s0网卡

若是找不到iwconfig命令执行sudo apt-get install wireless-tools,然后在查看网卡信息

启动无线网卡, 如果网卡是wlp3s0

使用以下命令

ifconfig wlp3s0 up  或者ip link set wlp3s0 up

扫描二维码关注公众号,回复: 7578185 查看本文章

扫描可用的WiFi

不加less可能会产生太多输出 iw dev wlp3s0 scan |less

 或者 iwlist wlp3s0 scanning

创建口令文件, 并连接

建立配置文件 wpa_passphrase ESSID PWD > wlp3s0 .conf (ESSID上一步的命令中可以看到。PWD为无线密码wlp3s0 .conf可以任意命名xxxx.conf)

要是出现Command 'wpa_passphrase' not found

执行sudo apt install wpasupplicant
 

使用配置文件连接 wpa_supplicant -B -i wlp3s0 -Dwext -c ./xxx.conf 

查看连接结果

iwconfig wlp3s0

设置为dhcp client,获取IP

dhclient wlp3s0

要是需要设置开机自动连接的话

修改/etc/network/interface文件中的无线设置

vi /etc/network/interfaces

修改后的文件如下:

auto wlp3s0
iface wlp3s0 inet dhcp
wpa-conf /home/sdmt/wlp3s0.conf

猜你喜欢

转载自blog.csdn.net/xianlvfan2224/article/details/93159244