openwrt 安装 usb 无线网卡详细安装教程

Author

Reads 314

Minimalist image of a power bank with blue USB charging cables on a white background.
Credit: pexels.com, Minimalist image of a power bank with blue USB charging cables on a white background.

OpenWRT is an open-source operating system that allows you to customize and optimize your router's performance.

To install a USB wireless network card on OpenWRT, you'll need to choose the right card that is supported by the system, such as the TP-Link TL-WN722N.

The installation process involves downloading the necessary packages, including kmod-usb-net and kmod-usb-net-rtl8187, which can be found in the OpenWRT package repository.

You'll also need to configure the USB wireless network card by creating a new file in the /etc/config/network directory.

A different take: Openwrt Build System Setup

OpenWrt 基础

OpenWrt 是一个开源的路由器固件,支持多种硬件平台。它可以在路由器上安装并配置。

OpenWrt 的配置文件存储在 /etc/config 目录中。这个目录包含了 OpenWrt 的配置文件,包括网络配置、用户管理等。

要在 OpenWrt 上安装 USB 无线网卡,需要先确保路由器支持 USB 接口。USB 接口用于连接 USB 设备,如 USB 无线网卡。

USB 无线网卡的驱动程序需要手动安装。可以在 OpenWrt 的 Package Manager 中搜索和安装适当的驱动程序。

Installation

To install a USB wireless network card on OpenWrt, you'll need to identify the type of card you have. For example, if you have a Tenda W311MI with an RT5370 chip, you'll need to install the corresponding drivers.

First, install the `usbutils` package to list USB devices. You can do this by running `opkg update` and then `opkg install usbutils`.

Consider reading: Openwrt Install Tailscale

Credit: youtube.com, USB有线网卡无线网卡在WR702N WR703N无线路由器OpenWRT系统中的快速设置使用

You'll also need to install the necessary kernel modules. For the RT5370 chip, you'll need to install `kmod-rt2800-lib`, `kmod-rt2800-usb`, `kmod-rt2x00-lib`, and `kmod-rt2x00-usb`.

Here are the packages you'll need to install:

  • kmod-mii
  • kmod-usb-net-cdc-ether
  • kmod-usb-net-rndis
  • kmod-usb-net
  • libusb-1.0
  • usb-modeswitch

Once you've installed the necessary packages, you can install the USB wireless network card driver by running `opkg update` and then `opkg install kmod-usb-net-rndis usb-modeswitch`.

配置和设置

To configure and set up your USB WiFi on NanoPi-R2S, you'll need to insert the USB WiFi into the USB port. Make sure to use a WiFi chip module that supports AP mode, such as those listed in the provided recommendations.

After inserting the USB WiFi, click on the "系统>重启" menu and then click "执行重启" to reboot your NanoPi-R2S. Once rebooted, navigate to "网络>无线" to access the wireless WiFi configuration interface.

To set up your WiFi, click on the "编辑" button to edit the WiFi settings. In the "接口配置" section, you can set the WiFi mode and SSID, and then click on "无线安全" to modify the encryption method and WiFi password. The default password is "password". After making your changes, click "保存" to save the settings.

Related reading: Openwrt Wifi 6

Configuration

Credit: youtube.com, A3 SP configuration setting内部参数设置

To configure your USB WiFi as an access point (AP), you'll need to insert it into the NanoPi-R2S's USB port. Make sure to use a WiFi chip module that supports AP mode, such as those listed in the recommended modules.

Click the "系统>重启" menu and select "执行重启" to reboot the NanoPi-R2S after inserting the USB WiFi. This will ensure the device recognizes the new hardware.

In the "网络>无线" configuration interface, click the "编辑" button to modify the WiFi settings. You can set the WiFi mode, SSID, and other parameters in the "接口配置" section.

To secure your WiFi network, navigate to the "无线安全" section and modify the encryption method and password. The default password is "password", but you should change it to something more secure.

After configuring the WiFi settings, save the changes and restart the device. Your phone or computer should be able to detect the WiFi network with the specified SSID.

Change Default WiFi Hotspot Settings

A sleek WiFi 6 router with antennas and cable on a wooden desk, perfect for modern home networks.
Credit: pexels.com, A sleek WiFi 6 router with antennas and cable on a wooden desk, perfect for modern home networks.

You can change the default WiFi hotspot settings on your device. The default settings are often set to make the WiFi hotspot work with most devices, but they might not be optimal for your specific needs.

One of the ways to change the default settings is by modifying the file that controls the WiFi hotspot behavior. This file is usually located at /etc/config/wireless.

To access this file, you'll need to enter the "防火墙" (firewall) settings and change the "转发" (forwarding) setting to "接受" (accept). This will allow you to modify the WiFi hotspot settings.

Here are the steps to change the default WiFi hotspot settings:

  • Enter the "防火墙" settings
  • Change the "转发" setting to "接受"
  • Close the "软件流量分载" (software traffic offloading) setting

By following these steps, you can customize the WiFi hotspot settings to better suit your needs and improve your overall WiFi experience.

Before connecting your NanoPi-R2S to the internet, it's crucial to set up some essential security settings. Setting a secure password is a must, as using no password or a weak password makes your device an easy target for network attacks.

Sleek white wireless router with four antennas emitting soft blue and pink light.
Credit: pexels.com, Sleek white wireless router with four antennas emitting soft blue and pink light.

To change the password, make sure to update the default password to a strong one that's difficult to guess.

Restricting SSH access is also vital. You can do this by limiting SSH access to the local network (LAN) and changing the default port to something unusual, such as port 23333.

Lastly, double-check your firewall settings to ensure they're configured correctly.

On a similar theme: Openwrt Ap

USB WiFi 使用

To use your USB WiFi, you'll need to install the necessary drivers. First, install the `usbutils` package with the `opkg update` and `opkg install usbutils` commands. Then, install the required driver components with `opkg install kmod-rt2800-lib`, `opkg install kmod-rt2800-usb`, `opkg install kmod-rt2x00-lib`, and `opkg install kmod-rt2x00-usb`.

If you're installing offline, you'll need to download the packages `kmod-mii`, `kmod-usb-net-cdc-ether`, `kmod-usb-net-rndis`, `kmod-usb-net`, `libusb-1.0`, and `usb-modeswitch`.

To configure your USB WiFi, you'll need to know its type. You can use the `lsusb` command to find the device ID, which will help you identify the chip type. For example, the ID `0BDA:C811` corresponds to the Realtek 8811CU chip.

Take a look at this: Do New Iphones Use Usb C

Credit: youtube.com, 开箱 COMFAST CF-913AC V2 USB无线网卡

Once you've identified your chip type, you can configure your USB WiFi as an access point. To do this, insert your USB WiFi into your device's USB port, restart your device, and then configure the WiFi settings in the "无线" interface. You can set the WiFi mode, SSID, and password in the "接口配置" and "无线安全" sections.

If you encounter any issues, refer to the troubleshooting guide in section 5.15.3. Some common problems include not generating the configuration file, not seeing the `wlan0` interface, or the hotspot not working properly. You can try changing the channel and country code, or adding a `usb_modeswitch` configuration to the `/etc/usb_modeswitch.d` directory.

You might like: USB Video Device Class

支持的 Wi-Fi 模型

Supported Wi-Fi models include the RTL8822CE, RTL8821CU (with VID: 0BDA, Pid: C811), and RTL8812AU.

You can also use MediaTek MT7662 (with VID: 0E8D, Pid: 7612), which is found in devices like the COMFAST CF-WU782AC V2.

To identify the Wi-Fi chip in your USB device, you can use the command line interface in FriendlyWrt. Simply insert the USB device and run the command to see the new device ID, which should be 0BDA:C811.

This ID corresponds to the Realtek 8811CU chip, as shown in search results.

Elaine Block

Junior Assigning Editor

Elaine Block is a seasoned Assigning Editor with a keen eye for detail and a passion for storytelling. With a background in technology and a knack for understanding complex topics, she has successfully guided numerous articles to publication across various categories. Elaine's expertise spans a wide range of subjects, from cutting-edge tech solutions like Nextcloud Configuration to in-depth explorations of emerging trends and innovative ideas.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.