How to load rndis_host module on usb plug-in

My cable internet access is unreliable and often down for days so I must sometimes use an Android phone with USB tethering to make a connection. Since RNDIS is blacklisted I do “sudo modprobe rndis_host” to load the module when needed but I would prefer to allow rndis_host to be loaded automatically when I plug in the phone and enable USB tethering.

This issue is discussed in a previous post here but I don’t know how to suspend blacklisting.

Is this the correct approach, and if so is there a step by step guide on how to do this?

Yes, copy file /usr/lib/modprobe.d/50-blacklist-rndis.conf to /etc/modprobe.d/50-blacklist-rndis.conf and edit it such that it reads:

# RNDIS is considered insecure (bsc#1205767, jsc#PED-5731)
blacklist rndis_wlan
blacklist usb_f_rndis
# blacklist rndis_host

A step by step may be the following. Open a terminal and issue:

su -
<root password>
cp /usr/lib/modprobe.d/50-blacklist-rndis.conf /etc/modprobe.d/
nano /etc/modprobe.d/50-blacklist-rndis.conf 

or you can use another editor if you don’t like nano.

1 Like

What about simply loading the module on boot (systemd unit)? Then it is always there. Just a suggestion, I would probably do so.

Edit: I guess @OrsoBruno is better, because it does not even depend on future boots :wink:

Thank you. Your confirmation gives me confidence.
The README in /etc/modprobe.d suggested this approach and I did as you suggest, leaving the original file untouched in /lib/modprobe.d. However when I rebooted the system and attempted to use usb tethering, I could not establish a connection.
Perhaps something else was amiss. I will try again.

Did you check if after boot the module was loaded?

Thankyou for your suggestion. If I can’t tweek udev I will give it a try.

Please show the result of

cat /etc/modprobe.d/50-blacklist-rndis.conf

between code tags (use the </> button above the editing area.
That file just undoes the blacklisting, then it depends on the interaction between the phone and the system. Anyway no udev tweaking was needed here, but that might depend on the phone model or Android version.

I already deleted the file copy I made, but it had “#” prefix added to the line with blacklist rndis_host, as you suggested.
You have given me the confidence to persist. Thank you.

Report back.
Thanks to both responders to this thread. Your kindness is appreciated.
I have learned that RNDIS module is required for usb tethering on older android phones (in my case a 4 year old LG V30 running Android 9) but that the RNDIS module is not automatically loaded because the protocol is known to be insecure.
To enable RNDIS (and usb tethering) do: sudo modprobe rndis_host
To allow automatic loading of the rndis_host module on start up of USB tethering

  1. copy the file “50-blacklist-rndis.conf” from /lib/modprobe.d to etc/modprobe.d and
  2. edit the file to comment out (#) the line “blacklist rndis_host”

I did this but wrongly assumed that the process had failed when USB tethering did not seem to work. I should have checked if the module had loaded. It had.

Before USB plug in (top 5 lines) :~ # lsmod
Module                  Size  Used by
af_packet              53248  4
rc_dib0700_rc5         16384  0
qrtr                   20480  4
ns                     32768  1 qrtr
dib7000p               45056  2

After USB plug in (top 5 lines) :~ # lsmod
Module                  Size  Used by
rndis_host             20480  0
cdc_ether              24576  1 rndis_host
usbnet                 57344  2 rndis_host,cdc_ether
cdc_acm                40960  2
mii                    16384  1 usbnet

So, something else was causing the connection to fail almost as soon as it was established.
An Internet search suggested three other useful lines of investigation.
a) ensure that usb debugging is enabled - it is;
b) ensure that the phone’s MAC address is OK - it was not - I set it to Random in NM; and,
c) ensure that ModemManager.service is not switching NM settings from ‘wired ethernet’ (the setting required for USB tethering) to Mobile Broadband (the setting required for a USB cellular wireless dongle) - it was, so I did “systemctl stop ModemManager.service” to suspend the service.
These additional steps seem to have resolved the problem. I now have what seems to be a stable ‘USB Tethering’ connection .
I regret that the subject of this thread has proved to be a bit misleading. A simpler title like “KDE USB Tethering” may have been better. Please amend it if that would be useful.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.