Problems with changing MAC address on Raspberry Pi 5

Hello all,

I have a Raspberry Pi 5 with OpenWRT. Connected to the Pi is an ethernet cable to my pc (eth0) and an usb to ethernet adapter (UGREEN CM209) to my router (eth1).

this is the build I have flashed on the SD card.

I haven't done any weird configurations, because I don't know what everything does. I only want to change the MAC adress of the port that goes to the main router at home. And no, I don't have access to the main routers settings.
I have tried just changing the MAC adress in the devices settings tab and even in the /etc/config/network file, but for some reason the Pi doesn't get a connection to the router. As far as I can see, the Pi doesn't get an IP assigned.

Does anybody know why this might be happening and what the solution is?

Start by flashing proper Openwrt.

https://firmware-selector.openwrt.org/?version=SNAPSHOT&target=bcm27xx%2Fbcm2712&id=rpi-5

I've flashed an official image now, but the issue is still there.
When I change the MAC adress presented to the main router it still doesn't get an IP, but when I use the default MAC it receives an IP.
When I plug the cable from the router to my pc and change it's MAC adress the router does give my pc an IP and it works just fine.

your /etc/config/network from when you're not getting an IP.

I'm guessing you're interrested in the file.

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix '' // left empty, but filled with default generated value

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config device
        option name 'eth1'
        option macaddr '00:11:22:33:44:55'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option proto 'dhcp'
        option device 'eth1'

What does dmesg or logread say when you disconnect and reconnect the wan port Ethernet cable ?

I can't post the whole log, but there are some notable messages:

Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.596054] usbcore: registered new device driver r8152-cfgselector
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.602370] usbcore: registered new interface driver r8152
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.608197] usbcore: registered new interface driver usbhid
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.613791] usbhid: USB HID core driver
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.618011] usbcore: registered new interface driver ax88179_178a
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.624250] usbcore: registered new interface driver cdc_ether
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.836142] cdc_ncm 4-1:2.0: MAC-Address: 20:7b:d2:d2:18:e4
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.841743] cdc_ncm 4-1:2.0: setting rx_max = 16384
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.859674] cdc_ncm 4-1:2.0: setting tx_max = 16384
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.874188] cdc_ncm 4-1:2.0 eth1: register 'cdc_ncm' at usb-xhci-hcd.1-1, CDC NCM (NO ZLP), 20:7b:d2:d2:18:e4
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.941877] usbcore: registered new interface driver cdc_ncm
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.962435] PPP generic driver version 2.4.2
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.966880] NET: Registered PF_PPPOX protocol family
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.979473] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
Sat Jul  6 16:45:04 2024 kern.info kernel: [    5.988244] usbcore: registered new interface driver brcmfmac
Sat Jul  6 16:45:04 2024 kern.warn kernel: [    5.994060] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,5-model-b.bin failed with error -2
Sat Jul  6 16:45:04 2024 kern.warn kernel: [    6.005769] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43455-sdio.raspberrypi,5-model-b.bin
Sat Jul  6 16:45:04 2024 user.info kernel: [    6.017094] kmodloader: done loading kernel modules from /etc/modules.d/*
Sat Jul  6 16:45:04 2024 kern.info kernel: [    6.171322] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
Sat Jul  6 16:45:04 2024 kern.info kernel: [    6.179396] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jul 29 2022 02:15:20 version 7.45.250 (70e9766 CY) FWID 01-e53e306b

I think it has to do with the CDC NCM (NO ZLP), but I don't know how to "fix" it.
Here is the entire log: pastebin

I have looked a little bit up about usb to eth on openwrt. I don't know for sure, but I might need to install something to make it work.
For now I have switched up the ethernet ports so eth0, the built-in port, is wan and eth1, the usb dongle, is my lan and now it works with a different mac.
I still would like to try and figure out why the usb dongle won't successfully change mac adress though.

Have you tried changing the pi 5 LAN IP address, perhaps is in same subnet of the router.

I don't know it that might help. Like I said, I've tried changing the mac adress on both eth0 and eth1, and only eth0 works with a different mac as wan. I still have the same lan ip's. And the wan is set to dhcp.
Could it be a problem with either the usb to ethernet adapter itself or some driver for it? Am I maybe missing something?