USB 2.0 to Ethernet Adapter driver for OpenWRT

I bought this USB 2.0 to Ethernet adapter: https://technotech.co.in/product/usb-to-lan-adapter/

It comes with manufacturer driver on the small cd. Since I don't have that reader for CDs I was forced to find manually driver in order to test if device works. On my Windows machine I downloaded driver from https://www.driverscape.com/download/usb-to-ethernet-adapter and manually installed it. It works.

Now my question is, how can I get the driver for it on OpenWRT? I want to turn my old laptop with Intel i5 CPU into router. I installed OpenWRT on USB and I am live booting it and it works. Since on that laptop I have only 1 LAN port I bought that adapter. I want to use it as WAN interface and use my existing LAN port to connect with my Windwos machine. How can I achieve that? How can I get the driver for this adapter?

You need to download the kmod package for your hardware in order for it to work. Do this: unplug the usb Ethernet dongle, reboot device, plug it in. Post the last lines of output from dmesg which should give some clues as to which kmod is needed.

Sat Jan 27 19:24:19 2024 kern.info kernel: [ 74.436153] usb 1-1: new full-speed USB device number 5 using xhci_hcd

This is the only line that is shown when I plug in adapter.

Show the output of cat /sys/kernel/debug/usb/devices

Can you plug it on a windows computer, and find the device ID info ? There is no clue in the given doc to guess the manufacter and device. suggestion: have you tried an old realtek driver?

root@OpenWrt:~# cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh=16
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.137 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  5 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0fe6 ProdID=9700 Rev= 1.01
S:  Product=USB 2.0 10/100M Ethernet Adaptor
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=120mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   8 Ivl=1ms

T:  Bus=01 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=125f ProdID=cb10 Rev=11.00
S:  Manufacturer=ADATA
S:  Product=ADATA USB Flash Drive
S:  SerialNumber=2672118110040024
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=31875us

T:  Bus=01 Lev=01 Prnt=01 Port=05 Cnt=03 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.01 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=13d3 ProdID=56a6 Rev=17.11
S:  Manufacturer=Azurewave
S:  Product=Integrated Camera
S:  SerialNumber=0001
C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=0e(video) Sub=03 Prot=00
I:* If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=(none)
E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=4ms
I:* If#= 1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
I:  If#= 1 Alt= 1 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=05(Isoc) MxPS= 128 Ivl=125us
I:  If#= 1 Alt= 2 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=05(Isoc) MxPS= 512 Ivl=125us
I:  If#= 1 Alt= 3 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=05(Isoc) MxPS=1024 Ivl=125us
I:  If#= 1 Alt= 4 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=05(Isoc) MxPS=1536 Ivl=125us
I:  If#= 1 Alt= 5 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=05(Isoc) MxPS=2048 Ivl=125us
I:  If#= 1 Alt= 6 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=05(Isoc) MxPS=2688 Ivl=125us
I:  If#= 1 Alt= 7 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=05(Isoc) MxPS=3060 Ivl=125us

T:  Bus=01 Lev=01 Prnt=01 Port=13 Cnt=04 Dev#=  4 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0bda ProdID=b023 Rev= 1.10
S:  Manufacturer=Realtek
S:  Product=Bluetooth Radio
S:  SerialNumber=00e04c000001
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 8
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 5.15
S:  Manufacturer=Linux 5.15.137 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

kmod-usb-net-dm9601-ether

2 Likes

How can I install it? Do I need to somehow include it before making bootable usb or I can somehow download it directly from OpenWRT? If that is the case, how can I connect to the internet using OpenWRT?

You can add it to the image when you use firmware-selector.
Or you can download from OpenWrt, it is up to you.
Since you have a laptop you can probably use its wifi to connect to the internet.

Sat Jan 27 20:06:23 2024 kern.info kernel: [  225.166145] usb 1-1: new full-speed USB device number 7 using xhci_hcd
Sat Jan 27 20:06:23 2024 kern.info kernel: [  225.364718] dm9601 1-1:1.0 eth1: register 'dm9601' at usb-0000:00:14.0-1, Davicom DM96xx USB 10/100 Ethernet, 00:e0:4c:53:44:58

It looks like it is recognized now. Thank you.

One more question tho. When i run following command this is the output.

root@OpenWrt:~# uci show network network.loopback=interface network.loopback.device='lo' network.loopback.proto='static' network.loopback.ipaddr='127.0.0.1' network.loopback.netmask='255.0.0.0' network.globals=globals network.globals.ula_prefix='fdf3:9a50:4a76::/48' network.@device[0]=device network.@device[0].name='br-lan' network.@device[0].type='bridge' network.@device[0].ports='eth0' network.lan=interface network.lan.device='br-lan' network.lan.proto='static' network.lan.ipaddr='192.168.1.1' network.lan.netmask='255.255.255.0' network.lan.ip6assign='60'

There is no WAN interface automatically set like in this video: https://youtu.be/DET3EMl6-RM?si=iovpwUHadT0RTcWE&t=331

Do I need to configure it myself? Sorry about so many basic questions, I am new to this networking stuff. Please feel free to provide me with some useful resources if you have any where I can get the basics about setting up OpenWRT.

Yes. OpenWrt can't know what you would like to do with the new interface. Just add a new interface, assign it to WAN firewall zone.

go to Network → Interfaces → Add new interface… → Protocol : DHCP client, Interface: eth1
Assign the firewall zone as mentioned by @badulesia

When I created fresh bootable USB it automatically set it as on this vide: https://www.youtube.com/watch?v=DET3EMl6-RM&t=335s

I managed to connect my laptop-router to the ISP router WAN(on laptop-router) to LAN(on ISP's router) and eth0 interface from laptop-router to my Windows machine and it is connected to the network successfully.

How can I now set up WIFI access point on laptop-router and to connect all mobile devices to it instead of ISP's router WIFI? After I achieve that I want to set up SQM on OpenWRT, but let's go step by step.

Edit: I don't have Network -> Wireless option available

what you want to achieve is unclear. You are using a laptop as an OpenWrt router, behind your ISP router? Hence a double NAT?

In the same way that you add the USB NIC dongle. You need to install the right kmod. What is your wifi card ids ?

This is what I want to achieve: How to add new router to fix bufferbloat? - #3 by maurer

I am using laptop for now just to test things out and see if this can have some improvement in practice before purchasing router. I am unable to check what my wifi card id is. I will have to take a break from this project for several days.

Open your laptop to check?

It's a Realtek 8822BE Wireless LAN 802.11ac PCI-E NIC.
PCI\VEN_10EC&DEV_B822&CC_0280

kmod-rtw88-8822be :star_struck:
Also install wpad-basic-wolfssl (assuming you're on 23.05.2).

Thank you. How you find all that stuff?

Just browse the list of available packages.
system --> software --> update lists
than browse "available" with filter

I'm also using an old laptop as fallback router in case of ISP failure, catching internet from a smartphone.