CentOS7 配置USB无线网卡驱动及wifi连接
Posted shlyao的学习笔记
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7 配置USB无线网卡驱动及wifi连接相关的知识,希望对你有一定的参考价值。
一、安装USB无线网卡驱动
使用命令lsusb 查看:
[root@localhost 桌面]# lsusb
Bus 001 Device 002: ID 17ef:602d Lenovo
Bus 001 Device 003: ID 17ef:602e Lenovo
Bus 003 Device 002: ID 8087:8008 Intel Corp.
Bus 004 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 0bda:818b Realtek Semiconductor Corp.
通过百度等搜索DeviceID 为0bda:818b 对应的驱动为 rtl8192eu
下载源码并编译安装:
make clean
make
make install
源码编译出现错误,可能是linux内核版本不匹配,建议重新查找相关资源下载
通过命令lsmod | grep 8192 查看驱动是否安装好
[root@localhost 桌面]# lsmod | grep 8192
8192eu 953074 0
二、通过wireless_tools连接wifi
通过百度等搜索wireless_tools.29 下载源码并编译安装
使用命令:
make && make install
使用查看无线网卡配置:iwconfig
[lucasyao@localhost ~]$ iwconfig
enp3s0 no wireless extensions.
wlan0 IEEE 802.11bgn ESSID:"YAO123456" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.452 GHz Access Point: C8:94:BB:D0:6A:FC
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=98/100 Signal level=99/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
左边显示的是网卡接口名
扫描附近的Wifi热点:iwlist wlan0 scan | grep -i ssid
[lucasyao@localhost ~]$ iwlist wlan0 scanning | grep -i ssid
ESSID:"不是你的网你连啥?"
ESSID:"YAO123456"
若wifi需要密码,可以建立一个文件保存密码:
vi /etc/wpa_supplicant/wpa_supplicant.conf
内容为:
network={
ssid="YAO123456"
key_mgmt=WPA-PSK
psk="你的密码"
priority=1
}
然后通过命令进行连接:
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
若通过后台连接可加上 -B
连接上之后使用dhcp进行分配IP:
dhclient wlan0
之后通过ifconfig 查看连接情况:
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.13 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::32b4:9eff:fe68:ca8a prefixlen 64 scopeid 0x20<link>
ether 30:b4:9e:68:ca:8a txqueuelen 1000 (Ethernet)
RX packets 4747 bytes 4125306 (3.9 MiB)
RX errors 0 dropped 221 overruns 0 frame 0
TX packets 4074 bytes 768662 (750.6 KiB)
TX errors 0 dropped 29 overruns 0 carrier 0 collisions 0
以上是关于CentOS7 配置USB无线网卡驱动及wifi连接的主要内容,如果未能解决你的问题,请参考以下文章
WiFi无线示波器,Lan以太网示波器无线测量及远程测量的配置
Linux 驱动开发:USB无线wifi驱动开发(MT7601)完成WIFI管理工具安装