[HN Gopher] Why Android can't use CDC Ethernet (2023)
       ___________________________________________________________________
        
       Why Android can't use CDC Ethernet (2023)
        
       Author : goodburb
       Score  : 91 points
       Date   : 2025-06-08 20:49 UTC (2 hours ago)
        
 (HTM) web link (jordemort.dev)
 (TXT) w3m dump (jordemort.dev)
        
       | progbits wrote:
       | Fun deep dive article!
       | 
       | Looked up the source and it appears the regex was changed from
       | `eth\\\d` to just `*` in October 2023, presumably fixing this
       | issue:
       | 
       | https://android-review.googlesource.com/c/platform/packages/...
       | 
       | The description says "The default will include both usb\d+ and
       | eth%d named interfaces on Android U+", "U+" being version 14 I
       | think (https://en.wikipedia.org/wiki/Android_version_history)
        
         | mshockwave wrote:
         | It was later reverted[1] because "there are devices in the
         | field using usbX interfaces for tethering". Shortly after that,
         | it got re-landed but only supported Android V+[2]
         | 
         | [1]: https://android-
         | review.googlesource.com/c/platform/packages/...
         | 
         | [2]: https://android-
         | review.googlesource.com/c/platform/packages/...
        
       | MBCook wrote:
       | The article says that iOS doesn't support CDC Ethernet adapters.
       | But I've plugged just standard USB ethernet adapters into my
       | phone and had them work.
       | 
       | Does iOS communicate with them using some other standard?
        
         | robingchan wrote:
         | yes - ASIX / realtek chipsets are whats in your generic dongle,
         | the drivers for which are bundled in iOS. CDC ECM is not
         | supported.
         | 
         | I found this out when using CAN bus to ethernet on iPhone
        
           | brigade wrote:
           | macOS definitely does not ship drivers for Realtek's
           | proprietary interface, and _only_ supports them via ECM /NCM.
           | Are you claiming iOS is the exact opposite?
        
       | tripdout wrote:
       | cs.android.com is a simpler alternative than downloading the
       | whole 100+ Gb source.
        
       | ck2 wrote:
       | My tablet with lineageOS works with very few select usb-ethernet
       | adapters (ASIX AX88179 chipset)
       | 
       | But since it doesn't support charging while in OTG host mode, it
       | cannot stay plugged into the adapter for long (old battery)
       | 
       | Some newer devices like Samsung support ACA OTG (Accessory
       | charging adaptor)) with charging while powering the adapter
        
         | myself248 wrote:
         | Another fun reason for wireless charging -- sometimes it's just
         | easier to sneak power into the device by a side-channel than to
         | try to find the right chain of adapters.
        
       | franga2000 wrote:
       | Looking at the LineageOS commit history, it seems seems this has
       | been fixed [0], reverted [1] due to compatibility issues, then
       | unreverted again [2] but only for the latest Android versions. If
       | I'm reading the commits right, someone at Google was involved, so
       | this might be in the official Google build now.
       | 
       | [0]
       | https://github.com/LineageOS/android_packages_modules_Connec...
       | [1]
       | https://github.com/LineageOS/android_packages_modules_Connec...
       | [2]
       | https://github.com/LineageOS/android_packages_modules_Connec...
        
       | hypercube33 wrote:
       | Thats super weird. I have like 15 USB ethernet adapters and all
       | of them work just fine. I'm pretty sure they are a few different
       | chipsets from Realtek and AXIS or something like that, too. If
       | you get ones that dont need drivers on linux you're good to go
       | with pretty much any OS and BIOS
        
         | Retric wrote:
         | Fixed in 2023:
         | 
         | https://news.ycombinator.com/item?id=44219502
        
           | goodburb wrote:
           | Same issue exists here on Android 15 and 16 with a Moto phone
           | running kernel 6.1.84.
           | 
           | NCM, ECM, RNDIS are all visible from adb shell as usb* and
           | not configured unless they start with eth.
           | 
           | Few real-world examples: USB3 2.5-10Gbit adapters and new
           | 1Gbit Realtek models, mobile hotspots and cellular dongles,
           | phone to phone tethering over USB, browser-based provisioning
           | solutions that use ethernet over USB.
        
         | Grazester wrote:
         | Yeah I came to say ethernet adapter on my thunderbolt/usb dock
         | works just fine on my on my pixel 5 and pixel 9 phones
        
       | userbinator wrote:
       | _There is no way to work around this, short of rooting the phone
       | to change the value of config_ethernet_iface_regex._
       | 
       | Another reason why having root is important on a device that you
       | own.
        
         | bigyabai wrote:
         | Being able to arbitrarily redirect networking traffic is
         | perhaps the single greatest reason to not have superuser privs
         | in userland. I support anybody that wants to pressure OEMs into
         | allowing bootloader unlocks, but I also can't name a use for
         | root that justifies the insanely expanded surface area for
         | attackers, at least on Android.
        
           | userbinator wrote:
           | The corporate FUD has gotten strong enough that people are
           | getting scared of freedom. That should disturb you more than
           | any perceived paranoia about "attackers".
        
             | stavros wrote:
             | Seriously, people are acting like the "do you want to give
             | this application elevated privileges" popup is some arcane
             | magick that we as a race can never hope to possess.
        
               | bigyabai wrote:
               | That really should not surprise people when their
               | smartphone has been telling them it is the wrong design
               | pattern for over a decade.
               | 
               | Point the finger at whoever you want. If you need to find
               | who broke the bicycle for the mind, I think most of us
               | know who's responsible.
        
               | stavros wrote:
               | I'm not sure what you mean, I find smartphones' "do you
               | want to allow this application access to X?" a pretty
               | understandable and secure pattern.
        
           | Zak wrote:
           | Do you believe the same thing about desktop PCs?
        
             | bigyabai wrote:
             | Yes? I don't use a single computer I own as root.
        
               | Zak wrote:
               | Few people do; "don't use root as your primary login" has
               | been standard advice for decades. Do you ever use sudo or
               | equivalent?
        
               | beeflet wrote:
               | I've used sudo before, but I find that it is really
               | difficult to type with the safety gloves on because I
               | keep fatfingering the password and locking myself out.
               | 
               | My family recently got me a new computer setup that won't
               | require sudo and other practices considered harmful. It
               | even does shapes, colors, and animal sounds, which is
               | good enough for my use case.
        
               | zoky wrote:
               | Oh wow, you got on the Windows 12 Preview somehow?
        
       | russellbeattie wrote:
       | I had to look it up: CDC stands for "USB Communications Device
       | Class".
       | 
       | I've never once tried to hook any of my many, many Android
       | devices over the last decade+ to wired Ethernet using a USB
       | adapter, but I had assumed it would just work if I did.
       | Interesting.
        
       | hansjorg wrote:
       | > CDC stands for Communications Device Class
       | https://en.m.wikipedia.org/wiki/USB_communications_device_cl...
       | 
       | Why is this buried almost at the end of the article? Why even
       | mention it at that point?
        
         | andix wrote:
         | Rule of thumb: Explain every abbreviation the first time it is
         | used in an article or a meeting. Only really obvious things
         | like USB or HTTP can be skipped.
        
         | stavros wrote:
         | Thank you, I decided to say "fuck it" and read the entire
         | article mentally expanding it into "center for disease control
         | devices", and I have no regrets.
        
       | secondcoming wrote:
       | The Android code also allowed for 'test interfaces'. I wonder why
       | the author didn't go down that path.
       | 
       | The Android revert message is also interesting:
       | there are devices in the field using usbX interfaces for
       | tethering
       | 
       | What's the problem with this?
        
       | Zak wrote:
       | A related thing that used to annoy me is that vanilla Android
       | wouldn't connect to ad-hoc WiFi networks. Third-party ROMs
       | usually would, so it wasn't due to a hard problem.
       | 
       | The bug report had a _two-digit_ number and Google steadfastly
       | refused to fix it for years. I haven 't seen an ad-hoc network in
       | a long time, but they were common when Android was young.
        
       | jordemort wrote:
       | I wrote this after a bad week at a previous job trying to get an
       | Android device to work with a CDC Ethernet adapter.
       | 
       | Since writing this, a couple people have let me know that there
       | is a particular bit in the MAC address, that if flipped, will
       | cause the kernel to assign an `ethX` name instead of `usbX` name.
       | I haven't tried it myself or updated the post with that
       | information because I moved on to a different job, and Android
       | devices are no longer a large part of my life.
       | 
       | Of course, that only helps if you have a CDC device where you're
       | in control of the MAC address (i.e. maybe another Linux device
       | pretending to be a CDC adapter)
        
       | rcxdude wrote:
       | It also, very annoyingly, can't connect to multiple networks at
       | once. e.g. connecting to a wifi network which doesn't have
       | internet access (and doesn't even advertise a default route) and
       | a cell phone network at the same time. Linux can do it, Windows
       | can do it, Android stubbornly refuses (and indeed many variants
       | will refuse to stay connected to a wifi network without internet,
       | if not just make you jump through confusing hoops). There are
       | some APIs which mean that if you write an app, you can do it just
       | in the app, but there's no way as a user to get it to do so.
        
       ___________________________________________________________________
       (page generated 2025-06-08 23:00 UTC)