Add udev rules for reverse ncm device interface service#2366
Add udev rules for reverse ncm device interface service#2366jemoreira merged 1 commit intogoogle:mainfrom
Conversation
Pixel 6+ phones in "Reverse Ncm Device Interface Service" mode (without/with adb debug interface) show up with USB VID:PID 18d1:4ef{2,3}.
This is effectively the reverse of ncm tethering.
In normal tethering the phone provides a DHCPv4 server (and broadcasts IPv6 RAs).
In reverse tethering the phone runs a DHCP client, and expects the other end of the connection to operate the DHCP server (and/or provide IPv6 RAs).
Cuttlefish already provides the required services (cvd-ebr bridge, dnsmasq, iptables MASQUERADE rules), so all we actually need to do is add the appropriate usb cdc ncm interface into the bridge and things magically just work.
This mode can be enabled via:
adb shell svc usb setFunctions 'rndis'
and disabled via:
adb shell svc usb setFunctions ''
Bug: 500283166
Signed-off-by: Maciej Żenczykowski <maze@google.com>
|
Somehow due to this being at priority 60 or in the cf directory [ /usr/lib/udev/rules.d/60-cuttlefish-base.rules ] instead of were I had it locally [ /usr/lib/udev/rules.d/99-reverse-tether.rules ] causes this to not work. :-( There's also a /usr/lib/udev/rules.d/60-cuttlefihs-base.rules [hs not sh] which I don't know where it is coming from. |
|
further experimentation seems to show this works as based on /usr/lib/udev/rules.d/78-sound-card.rules I'm guessing we rely on net-setup-link or something around there |
so probably want to be after that -- since we match on ENV{ID_NET_DRIVER} == "cdc_ncm"... maybe 88 would be a good priority??? |
Pixel 6+ phones in "Reverse Ncm Device Interface Service" mode (without/with adb debug interface) show up with USB VID:PID 18d1:4ef{2,3}.
This is effectively the reverse of ncm tethering.
In normal tethering the phone provides a DHCPv4 server (and broadcasts IPv6 RAs). In reverse tethering the phone runs a DHCP client, and expects the other end of the connection to operate the DHCP server (and/or provide IPv6 RAs).
Cuttlefish already provides the required services (cvd-ebr bridge, dnsmasq, iptables MASQUERADE rules), so all we actually need to do is add the appropriate usb cdc ncm interface into the bridge and things magically just work.
This mode can be enabled via:
adb shell svc usb setFunctions 'rndis'
and disabled via:
adb shell svc usb setFunctions ''
Bug: 500283166