You are not logged in.

#1 2021-09-03 08:35:10

M5Hc6UsQ
Member
Registered: 2018-02-26
Posts: 30

Ethernet Gadget - Issue with fixed MAC address

Hello,

I'm trying to setup up a Raspberry Pi Zero as an ethernet gadget with a fixed host mac address but I ran into a strange issue. Hopefully I can resolve this with your help.

I've configured the g_ether module an the Pi with a fixed MAC address. Pretty easy and no issues so far.

pizero 〉modprobe -c | grep g_ether
options g_ether host_addr=fa:00:f7:b4:72:88

The Kernel messages indicate that this address is set successfully. The device MAC address is randomly generated.

[    9.869927] using host ethernet address: fa:00:f7:b4:72:88
[    9.871550] usb0: HOST MAC fa:00:f7:b4:72:88
[    9.912125] usb0: MAC 3a:0d:7b:df:d0:67

The resulting interface on the Pi looks like this.

2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 3a:0d:7b:df:d0:67 brd ff:ff:ff:ff:ff:ff

The issue I'm seeing is on the host side. The first time I plug the Pi in the following interface is created.

3: enp0s20f0u2u3i1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether d2:a7:76:c7:db:e6 brd ff:ff:ff:ff:ff:ff

If I unplug the Pi and plug it in again I get the expected interface. Note the different interface name and (correct) MAC address.

4: enp0s20f0u2u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether fa:00:f7:b4:72:88 brd ff:ff:ff:ff:ff:ff

I'm pretty sure this problem is on the host side, because it always shows the wrong d2:a7:76:c7:db:e6 MAC address in this case, while the client would generate a random address if not configured or something goes wrong. It would be great if someone could shed some light on this or has some suggestion how I can track this issue further down. Thank you!

Last edited by M5Hc6UsQ (2021-09-03 08:36:09)

Offline

Board footer

Powered by FluxBB