Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
fuss:linux [2020/02/25 05:07] – [Determining the Last Power On Method] officefuss:linux [2020/05/08 21:53] – [Automatically Add all RNDIS Devices to a Bridge] office
Line 1118: Line 1118:
 In doing so, the power management issue seems to be resolved. In doing so, the power management issue seems to be resolved.
  
 +====== Automatically Add all RNDIS Devices to a Bridge ======
  
 +Edit or create the file at ''/etc/udev/rules.d/70-persistent-net.rules'' with the following contents:
 +<code>
 +SUBSYSTEM=="net", ACTION=="add", ATTRS{idProduct}=="a4a2", ATTRS{idVendor}=="0525", RUN+="/bin/sh -c '/sbin/ip link set dev %k up && /sbin/brctl addif br0 %k'"
 +</code>
 +where:
 +  * ''br0'' is the interface name of the bridge that the RNDIS devices will be added to.
 +
 +followed by the command:
 +<code bash>
 +udevadm control --reload
 +</code>
 +
 +to reload all udev rules.
 +
 +The reason this works is due to ''a4a2'' and ''0525'' respectively being the identifiers for the RNDIS driver and not for the device itself. For instance, by issuing:
 +<code bash>
 +udevadm info -a /sys/class/net/usb0
 +</code>
 +
 +will show at the top the RNDIS device without any identifiers whereas the parent ''RNDIS/Ethernet Gadget'' matches the identifiers.
 +
 +One usage case for this rule is to connect a bunch of RNDIS devices to an USB hub and have them join the network automatically as they are hotplugged; for instance, Raspberry Pis [[fuss/raspberry_pi#logging-in_via_ssh_over_usb|can be configured as USB gadgets]] and then connected to an USB hub.
  
  

fuss/linux.txt · Last modified: 2024/02/21 06:47 by office

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.