sandy56
Posts: 5
Joined: Tue Jan 02, 2018 4:28 pm

setting mac address through device tree

Fri Jan 26, 2018 4:22 pm

I am trying to set the ethernet mac address through the device tree. I tried adding

Code: Select all

 local-mac-address = [01 02 03 04 05 06];
to the usbether@1 node in the .dts file and compiled it. But on rebooting I find that the mac-address is still in its default address. Does anyone know how to set the mac-address to the device tree?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1733
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: setting mac address through device tree

Fri Jan 26, 2018 4:31 pm

You've got two options:
1. Set the "mac-address" property in the same location as the "local-mac-address" property is found in the .dtb. The firmware overwrites "local-mac-address" but leaves "mac-address" (which is checked first) free in case the .dtb wants to override it.
2. Use the "force_mac_address=aa:bb:cc:dd:ee:ff" config.txt setting, which overrides the normal serial-number-derived value for "local-mac-address".

Return to “Device Tree”

Who is online

Users browsing this forum: No registered users and 3 guests