I am always getting a random hardware address when using the Zero 3W as a usb gadget. On Raspberry pi I edit the /boot/cmdline.txt file and add:
g_ether.dev_addr=12:34:56:78:9a:bc g_ether.host_addr=16:23:45:78:9a:bc
I can see that the Zero 3W uses cdc_ether instead of g_ether… is there a similar boot command that I can use?
Thanks.
Zero 3W gadget mode random MAC address
I created a script and udev rule to handle the random hardware address. Ubuntu always creates an interface name starting with “enx” followed by the random hardware address.
This script takes care of Ubuntu:
#!/bin/bash
interface=$(ifconfig | grep -oh “^enx\w*”)
out=$(ifconfig $interface 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255)
echo $out
systemctl restart NetworkManager