On 18/04/16 02:57, Liuxilong (A) wrote:
We also do not want to make all of the boards the same MAC
address. But our client requires us to do it. The client thinks that VLAN can
solve this conflict of the same MAC through VLAN's isolation. What do you think
about it?
It's a bad idea. You're likely to hit multiple problems.
You may be able to work around it by running a separate IPv4 subnet on
each VLAN and using a separate DHCP server process on each of these
subnets. It's very messy.
A better solution would probably be to have the NIC driver generate a
transient random MAC address if the NIC does not have a valid permanent
MAC address. iPXE does this for some cards (e.g. Intel virtual
functions, which may not have their own addresses). You can use code
such as:
void eth_random_addr ( void *hw_addr ) {
uint8_t *addr = hw_addr;
unsigned int i;
for ( i = 0 ; i < ETH_ALEN ; i++ )
addr[i] = random();
addr[0] &= ~0x01; /* Clear multicast bit */
addr[0] |= 0x02; /* Set locally-assigned bit */
}
i.e. generate six random bytes, then convert it to a valid MAC address
by ensuring that the "multicast" bit is clear and the "locally-assigned"
bit is set.
Michael
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel