Krescue duplicates mac address - all boards get same address

Started using rescue to make production boards but I think its cloning the mac address of the source board as all boards end up dhcp’ing to the same IP address

this is not good!

Am I missing something?

david

please clarify situation

  1. which emmc content (uboot)
  2. which board model

6 months to get a reply!

ubuntu, vim1

we ended up writing mac addresses into flash by hand, not great

sorry for late replay

please migrate from Krescue to oowow

oowow - gets tons of improvements and fixes

PS: i have check your eth mac issue - at this moment must generated from soc id which make unique mac for any device

PSS: if u still have problems please notify me

how can we create a mac address from soc id?

thanks

David

for example from uboot sources

../u-boot-v2021.07/arch/arm/mach-meson$ grep -m1 -A28 eth board-common.c 

int meson_generate_serial_ethaddr(void)
{
	u8 mac_addr[ARP_HLEN];
	char serial[SM_SERIAL_SIZE];
	u32 sid;
	u16 sid16;

	if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) {
		sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
		sid16 = crc16_ccitt(0, (unsigned char *)serial,	SM_SERIAL_SIZE);

		/* Ensure the NIC specific bytes of the mac are not all 0 */
		if ((sid & 0xffffff) == 0)
			sid |= 0x800000;

		/* Non OUI / registered MAC address */
		mac_addr[0] = ((sid16 >> 8) & 0xfc) | 0x02;
		mac_addr[1] = (sid16 >>  0) & 0xff;
		mac_addr[2] = (sid >> 24) & 0xff;
		mac_addr[3] = (sid >> 16) & 0xff;
		mac_addr[4] = (sid >>  8) & 0xff;
		mac_addr[5] = (sid >>  0) & 0xff;

		eth_env_set_enetaddr("ethaddr", mac_addr);
	} else
		return -EINVAL;

	return 0;
}

Ethernet HW/MAC address usage example

if we check mainline uboot shell

=> printenv ethaddr 
ethaddr=72:32:2d:d2:25:44

next bootup to oowow/krescue will be same

root@vim1-07b05:/# ifconfig eth0 | grep HW
eth0      Link encap:Ethernet  HWaddr 72:32:2D:D2:25:44  

next step try to reset MAC

setenv -f ethaddr 
=> printenv ethaddr
## Error: "ethaddr" not defined
=> saveenv 
Saving Environment to MMC... Writing to MMC(2)... OK
=> reset

reboot and check again its will be generated same unique MAC for current device

=> printenv ethaddr 
ethaddr=72:32:2d:d2:25:44

HOW-TO setup custom MAC

again go into uboot and setup custom MAC

=> setenv -f ethaddr 72:32:2d:d2:15:55
=> saveenv 
Saving Environment to MMC... Writing to MMC(2)... OK
=> reset

boot into oowow and check its already new custom MAC

root@vim1-07b05:/# ifconfig eth0 | grep HW
eth0      Link encap:Ethernet  HWaddr 72:32:2D:D2:15:55  

PS: MAC must depends from your current OS system, oowow/krescue can make UNIQ MAC warranty only via properly setup mac inside uboot stage

1 Like

in any way i planned some additional features for oowow network setup, and custom MAC its will be one of them

1 Like