ubuntu18.04 mercury 水晶无线网卡驱动安装以及ap模式开启(开机自动启动)

编程知识 更新时间:2023-05-03 02:17:50

在ubuntu下安装mercury水晶无线网卡驱动,该驱动外观为下图.

UD6S型号

首先,将网卡插入到usb接口后,终端输入lsusb,找到该端口ID信息。

BUS 001 Device 007:ID 0bda:c811 Realtek Semiconductor Corp

安装对应驱动版本:

sudo apt update
sudo apt install build-essential git dkms
git clone https://github/brektrou/rtl8821CU.git
cd rtl8821CU
chmod +x dkms-install.sh
sudo ./dkms-install.sh
sudo modprobe 8821cu

安装完成后重启,终端输入ifconfig  ,显示wlan0部分的网络设备,表示安装成功,Ubuntu18.04 的wlan0是一长串字符名,如果网卡名称想改成wlan0,可按照如下步骤

sudo nano /etc/default/grub 
找到GRUB_CMDLINE_LINUX=""改为GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
然后sudo grub-mkconfig -o /boot/grub/grub.cfg

 将网卡设置为Ap模式发射信号,先查看电脑支持ap模式 终端输入iw list ,找到下图中含有AP表示支持。

Supported interface modes:
        *IBSS
        *managed
        *AP
        *monitor

安装需要的程序包

sudo apt-get update
sudo apt-get install hostapd isc-dhcp-server

创建hostapd的配置文件

zcat /usr/share/doc/hostapd/examples/hostapd.conf.gz | sudo tee -a /etc/hostapd/hostapd.conf

修改配置文件

interface=wlan0
ssid=tets #这里填写你自己的无线名称
hw_mode=a  #5 gHZ
wpa=2
channel=36
wpa_passphrase=12345678 #这里填写你自己的无线密码
wpa_key_mgmt=WPA-PSK WPA-EAP WPA-PSK-SHA256 WPA-EAP-SHA256

修改/etc/network/interfaces .

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
hostapd /etc/hostapd/hostapd.conf
address 172.16.52.39     #地址是无线网卡的ip地址 通过ifconfig 查找,名称为wlan0
netmask 255.255.255.0

 创建或修改/etc/dhcp/dhcpd.conf

ddns-update-style none;
option domain-name-servers 220.189.127.106, 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
subnet 172.16.52.0 netmask 255.255.255.0 {
	range 172.16.52.1 172.16.52.200;
	option routers 172.16.52.1
}

 然后执行

sudo dhcpd -4 -d -cf /etc/dhcp/dhcpd.conf wlan0

 出现下图的输出日志表示配置成功。

 关机后再开机,就可以搜索到无线网卡发射的wifi信号 ,名称为test,至此,安装完毕

最后一步会提示报错can't open /var/lib/dhcp/dhcpd.leases for append 这种错误,可执行

chmod 777 /var/lib/dhcp/dhcpd.leases

更改完权限执行最后一步 ,就没有报错了。

 

 

 

 

更多推荐

ubuntu18.04 mercury 水晶无线网卡驱动安装以及ap模式开启(开机自动启动)

本文发布于:2023-04-30 02:10:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/c294b4e0e41226807b8a1867eaca65f2.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自动启动   网卡驱动   水晶   模式   ap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 112813文章数
  • 28693阅读数
  • 0评论数