USB Over Network OpenWrt

Introduction

USB Over Network is a technology that allows you to share USB devices over a network. With USB Over Network, you can connect USB devices to one computer and access them from another computer on the same network. This can be useful in various scenarios, such as sharing a printer, scanner, or storage device between multiple computers.

In this article, we will explore how to set up USB Over Network on OpenWrt, a popular open-source firmware for routers. We will also provide code examples to illustrate the configuration steps.

Prerequisites

Before getting started, make sure you have the following:

  • A router running OpenWrt firmware.
  • A USB device that you want to share over the network.
  • Two computers connected to the same network.

Installation

  1. Connect the USB device to the router's USB port.

  2. Log in to OpenWrt's web interface and navigate to "System" -> "Software".

  3. Click on "Update lists" to refresh the package list.

  4. Search for and install the usbip package. This package provides the necessary tools for USB over IP functionality.

Configuration

  1. SSH into the OpenWrt router using a terminal.

  2. Run the following command to load the usbip kernel module:

modprobe usbip-core
  1. Enable USB Over Network on the router by running the following command:
usbipd -D
  1. List the available USB devices on the router by running the following command:
usbip list -l

Note down the ID of the USB device you want to share.

  1. Bind the USB device to the USBIP driver by running the following command:
usbip bind -b <device_ID>

Replace <device_ID> with the ID of the USB device obtained in the previous step.

  1. On the client computer, install the usbip package using the package manager of your operating system.

  2. Run the following command on the client computer to list the available USB devices on the network:

usbip list -r <router_IP>

Replace <router_IP> with the IP address of the OpenWrt router.

  1. Attach the remote USB device to the client computer by running the following command:
usbip attach -r <router_IP> -b <device_ID>

Replace <router_IP> with the IP address of the OpenWrt router, and <device_ID> with the ID of the USB device.

  1. The USB device is now available on the client computer and can be used as if it were directly connected.

Conclusion

USB Over Network allows you to share USB devices over a network, providing flexibility and convenience in accessing and using USB devices from different computers. In this article, we discussed how to set up USB Over Network on OpenWrt routers and provided code examples to illustrate the configuration steps. By following these instructions, you can easily share and access USB devices over your network.