2019-08-12 04:58 AM
Board: STM32746G-Discovery
Project: LwIP_HTTP_Server_Netconn_RTOS
Position: ethernetif.c stm32f7xx_hal_conf.h
#define MAC_ADDR0 0U
#define MAC_ADDR1 2U
#define MAC_ADDR2 0U
#define MAC_ADDR3 0U
#define MAC_ADDR4 0U
#define MAC_ADDR5 0U
When set as above, DHCP works normally.
But when I change the Mac Address, DHCP doesn't work.
I'm looking for a way to solve this problem.
Help me!!!
Solved! Go to Solution.
2019-08-14 12:35 AM
Found a problem.
Our Router does not respond to any Mac address not purchased from IEEE.
2019-08-12 09:58 AM
You might want to read about the ARP and RARP protocols, which translates between logical IP addresses (supplied by DHCP) and the hardware MAC address. When you change the MAC you become a new, different node on the network. The DHCP address maps to the old address. If you must change the MAC then you have to clear the ARP cache, restart your TCP/IP network stack and allocate a new address from the DHCP server.
Jack Peacock
2019-08-12 10:54 AM
More details, https://community.st.com/s/question/0D50X0000BCMaF2SQL/dhcp-does-not-work-when-i-change-my-mac-address
2019-08-12 06:36 PM
Thanks for the answer.
I'm not changing the Mac address In operation.
After changing the Mac address, DHCP does not work after power cycle.
What should I do in this case?
2019-08-12 07:02 PM
Perhaps review the interaction with the DHCP server with wireshark or similar tools.
2019-08-14 12:35 AM
Found a problem.
Our Router does not respond to any Mac address not purchased from IEEE.
2019-08-14 02:02 AM
02:00:00:00:00:00 is also not registered, but works...
https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
Addresses can either be universally administered addresses (UAA) or locally administered addresses (LAA). A universally administered address is uniquely assigned to a device by its manufacturer. ... A locally administered address is assigned to a device by a network administrator, overriding the burned-in address.
Universally administered and locally administered addresses are distinguished by setting the second-least-significant bit of the first octet of the address. This bit is also referred to as the U/L bit, short for Universal/Local, which identifies how the address is administered. If the bit is 0, the address is universally administered. If it is 1, the address is locally administered.
https://en.wikipedia.org/wiki/MAC_address#Unicast_vs._multicast
These are all examples of group addresses, as opposed to individual addresses; the least significant bit of the first octet of a MAC address distinguishes individual addresses from group addresses. That bit is set to 0 in individual addresses and set to 1 in group addresses. Group addresses, like individual addresses, can be universally administered or locally administered.
Therefore most likely LAA works, but it's first byte has to be binary xxxxxx10. That's why the default MAC_ADDR0 is 2U.