This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Duplicate IP address after changing the MAC address with netIF_SetOption

Hello,

Regarding the Keil documentation, for changing the MAC address we can use the netIF_SetOption function. I configured my STM MCU network like this:

	uint8_t mac_addr[NET_ADDR_ETH_LEN];	
	netInitialize ();
	//Set New mac_addr value
	netIF_SetOption (NET_IF_CLASS_ETH | 0, netIF_OptionMAC_Address, mac_addr, sizeof (mac_addr));	

It successfully changed my Mac address but in Wireshark, I saw that it created a duplicate IP address device ( one with the old Mac address "1E-30-6C-A2-45-5F" and the new one with the new Mac address "6a:ad:d5:59:52:19")

I need to know how I can change the MAC address while the old value is being removed(prevent from a duplicate IP)

I appreciate your help.

Parents
  • When you change the MAC address, the device will no longer respond to requests directed to the old MAC address. The IP address, however, is still the same. If you also want a new IP address after changing the MAC address, it is necessary to stop (netDHCP_Disable) and restart the DHCP client (netDHCP_Enable).

    In your case, Wireshark knew the history, so it found that two devices with different MAC addresses are responding to the same IP address. This is actually not true, as it is the same device that just changed its MAC address. The solution is to clear the Wireshark log. Alternatively, you can close and restart Wireshark to avoid this notification.

Reply
  • When you change the MAC address, the device will no longer respond to requests directed to the old MAC address. The IP address, however, is still the same. If you also want a new IP address after changing the MAC address, it is necessary to stop (netDHCP_Disable) and restart the DHCP client (netDHCP_Enable).

    In your case, Wireshark knew the history, so it found that two devices with different MAC addresses are responding to the same IP address. This is actually not true, as it is the same device that just changed its MAC address. The solution is to clear the Wireshark log. Alternatively, you can close and restart Wireshark to avoid this notification.

Children