USB-Ethernet device for Linux
For our Embedded Linux training sessions, I was looking for a USB to Ethernet device. Since Linux supported devices are often difficult to find, I’m glad to share my investigations here.
When you use an embedded development board, you must connect it to your computer with an Ethernet cable, for example to transfer a new kernel image to U-boot through tftp, or to make your board boot on a directory on your workstation, exported with NFS.
You could connect both the board and computer to your local network, which would still allow your computer to connect to the Internet while you work with the board. However, you may create conflicts on your local network if you don’t use DHCP to assign an IP address to your board (if your DHCP server even accepts this new device on the network). In a training environment, you are also likely to run out of Ethernet outlets in the training room if you have to connect 8 such boards. Hence, a direct connection between the board and your workstation’s Ethernet port is often the most convenient solution.
If you can’t use WIFI to keep your computer connected to the outside world, a good solution is to add an extra Ethernet port to your computer by using an USB-to-Ethernet device.
My colleague Thomas and I started looking for such devices that would be supported by Linux. Here are a few that we found:
- D-Link DUB-E100. Supported by the USB_NET_AX8817X driver. However, this product is bulky and quite heavy (at least 100 grams).
- TRENDnet TU2-E100. Supported by the same driver, but still bulk (August 2015 update: now replaced by a more recent version, now almost as small as the Apple one, and supported out of the box in Linux. See the comment about this device.)
- Linksys USB 200m. Supported by the same Linux driver and has a much more acceptable size, but customer reviews complain that its connector can break easily.
- Apple USB Ethernet Adapter. This should be working out of the box in Linux. At least the MB442Z/A or MC704ZM/A references did, but Apple now sells a new reference that might have a different chipset. It is beautiful, small and light. Support for this device (at least the references I mentioned) was added to Linux 2.6.26 through the same driver. You should be able to use it in recent distros.
So, I recommend the Apple device. I event posted a comment on the Apple Store, titled “Perfect for Linux”! I hope the Apple droids won’t censor it. Don’t hesitate to buy it, so that we can confirm that the latest reference is supported too.
I can’t tell whether this could happen with Apple. This was the first Apple device I ever bought…
Author: Michael Opdenacker
Michael Opdenacker is the founder of Bootlin, and was its CEO until 2021. He is best known for all the free embedded Linux and kernel training materials that he created together with Thomas Petazzoni. He is always looking for ways to increase performance, reduce size and boot time, and to maximize Linux’ world domination. More details. View all posts by Michael Opdenacker
41 thoughts on “USB-Ethernet device for Linux”
Yes, it is really nice.
Apple Store is also really efficient!!
A question: does u-boot support this device?
I own both the linksys and apple one and I must say that the linksys one is extremely flimsy and wider than a standard usb plug, so for ‘horizontal’ hub you loose 3 slots. The apple one is sturdy and only takes one usb slot in ‘horizontal’ hubs.
Good news. Apple accepted my “Perfect for Linux” comment (Webmaster note: page no longer available). Well, Apple may not see Linux as a direct threat as Microsoft does, but I didn’t expect them to accept Linux related comments on their websites.
I absolutely agree that Apple Ethernet adapter works very well under Linux (running on MIPS in our case). We’ve tested others, but none worked as well as Apple’s.
How to set up an usb/ethernet interface in Linux?
I have an usb to ethernet adapter connected to my linux system. I edited the connection information, and gave manual ip 192.168.1.21 in the connections menu available at the top right. In the above command lines we can see the available connection information on my system. I am not able to make the interface up for the en0016b68261f . Below are my interfaces present in /etc/network :
interfaces(5) file used by ifup(8) and ifdown(8) #The loopback network interface auto lo iface lo inet loopback # The primary network interface iface eno1 inet dhcp
When I try to ping the port at the other end of the usb to ethernet adapter, whose ip address is 192.168.1.14, I am not able to ping this ip address of my development board. How can my usb to ethernet adapter be set up? Traceroute shows this:
me@me:/$ traceroute 192.168.1.21 traceroute to 192.168.1.21 (192.168.1.21), 30 hops max, 60 byte packets 1 192.168.1.21 (192.168.1.21) 0.231 ms 0.192 ms 0.180 ms me@me:/$ traceroute 192.168.1.14 traceroute to 192.168.1.14 (192.168.1.14), 30 hops max, 60 byte packets 1 * * * 2 * * * (. ) 29 * * * 30 * * *
What makes you think 192.168.1.14 is ping able? Please add your routing table ( ip route show ) to your question.
You should have a close look at the machine 192.168.1.14 . Your network configuration on 192.168.1.21 looks OK. I suspect that the problem lies on the other machine which either block your pings requests, or its ping replies. Or you may have a problem with your network equipments/cables (you didn’t tell us how the two machines were connected; direct cable?).
nope it is accepting the ping when it is on dhcp on another machine. When i login and give the ip as 192.168.1.14 for the ethernetport on the other machine. Then i am able to ping. If i set the above ip address as a static ip address I am not able to ping it from my machine through 192.168.1.21
Yeah i have attached my traceroute in the above question, is traceroute command equivalent to iproute command in linux??
Absolutely not. Despite your beliefs, you should really take a look at the other side. At least spy what comes and go at the other end of the Ethernet cable (on 192.168.1.14 ) with a tool like tcpdump or wireshark.
USB Ethernet адаптер Realtek RTL8152B с честными 100Мбит/с с поддержкой OpenWRT (Linux)
а вот тест
подключил к Android TV Box TTK sb-214 (версия андроида 5.1.1) не распознал
подключил через OTG кабель к двум смартфонам samsung
samsung на android 9.0 не распознал
****
samsung на android 6.0.1 не распознал
но aida64 его видит
не знаю может графический интерфейс для ethernet samsung не добавлял и тупо не сможем сеть настроить