cancel
Showing results for 
Search instead for 
Did you mean: 

DHCP does not work when I change my Mac Address.

Joseph Jeong
Associate II

 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!!!

1 ACCEPTED SOLUTION

Accepted Solutions
Joseph Jeong
Associate II

Found a problem.

Our Router does not respond to any Mac address not purchased from IEEE.

View solution in original post

6 REPLIES 6
Jack Peacock_2
Senior III

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

More details, https://community.st.com/s/question/0D50X0000BCMaF2SQL/dhcp-does-not-work-when-i-change-my-mac-address

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Joseph Jeong
Associate II

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?

Perhaps review the interaction with the DHCP server with wireshark​ or similar tools.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Joseph Jeong
Associate II

Found a problem.

Our Router does not respond to any Mac address not purchased from IEEE.

Piranha
Chief II

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.