Disable (?) NM random mac for shared XO wifi - USB0 / Chrome/ Pi Zero

Carrol Riddle ebox382 at scishare.com
Tue Jul 10 10:50:44 EDT 2018


Soliciting info or pointers to resources for disabling mac address randomization by NetworkManager for USB0 (eth1) on XO's.  Wifi mac addresses are not randomized.

An XO can share its Wifi over wired ethernet link (USB0) where it can be used by
a Chromium browser on a linked Raspberry Pi Zero (not W).  SSH -X on the link
allows XO keyboard and display to be used for Chromium.

The several setup steps are simple, but must be repeated with each boot since
NetworkManager (version 0.9.8.* on XO's) supplies a different mac address for
the link on each boot.  To provide a simple Sugar wrapper to run Chromium, a
consistent mac address would be needed.

Methods from web searches have not been successful in disabling randomization, 
largely since they use features added after 0.9.8.   Using a udev rule to "ifconfig
usb0 hw ether address" has come the closest, but breaks after a few boots and returns to
randomization.

BACKGROUND

For those interested, details are below, but are only peripheral to question.  This use of the XO's display, keyboard and wifi by Chromium / Zero provides a low cost way to access a widely accepted browser. The Zero can be plugged into XO USB for power and signals. The Zero is
available for < $10, and with SD card and plug, total cost should be $15 - 20
USD. 


______________________________________


MANUAL METHOD - XO (after Pi Zero setup)

In Sugar, connect to wifi . This needs to be done only the first time and is
persistent between boots.  Switch to Gnome and disconnect from the "Wired
connection ?" that just formed. Edit the connection :  IPv6 to ignore, IPv4 to
require IPv4 and "shared to other computers"   and save.  Connect to this
connection.  The connection info should show ip address starting with 10:  .
This link is not persistent between boots.

systemctl enable sshd.service

PI ZERO SETUP (prior)

Raspberry Pi Zero with Raspbian Desktop installed.  To   /boot/config.txt on  Pi
SD edit and add dtoverlay=dwc2 .  To /boot/cmdline.txt add after "rootwait"
 modules-load=dwc2,g_ether host_addr=00:22:82:ff:ff:20 dev_addr=00:22:82:ff:ff:22          (Substitute local mac addresses.)   To start with SSH, add dummy "ssh" file to /boot directory.  On XO, ssh pi at raspberrypi.local with password raspberry   .   Configure Zero to boot to
command line (CLI) with raspi-config  .  To use Raspbian desktop,  ssh -X
pi at raspberry.local, and then /etc/X11/Xsession.  The Pi Tool Bar partially
overlaps the Gnome Tool Bar, but selecting "medium display size" minimizes
affects.

UDEV INFO FOR RULES  (but not able to make work)

DRIVERS=="cdc_ether"

ATTRS{idVendor=1d6b}

ATTRS{idProduct=0001}

RUN+="/etc/udev/scripts/rpi"


Script rpi:

ifconfig usb0 down

ifconfig usb0 hw ether 00:22:82:FF:FF:20

ifconfig usb0 up

_____________________________

Carrol Riddle

ebox382 at scishare.com


More information about the Devel mailing list