08-12-2024 05:15 AM
We've a problem where a device's MAC address gets associated with an IP address. After the device is removed and another device is assigned that IP address, nothing is able to ping with the new device because the IP address is still associated with the MAC address of the old device. I have performed a clear ip arp <IP address> command, and you can see that the ARP table updates with the new MAC address.
Hardware switch: Cisco C9300
Software version: 17.6.5
Does anyone have any idea why this could be happening and how to resolve it?
08-12-2024 05:21 AM
You assign IP to new device via dhcp or manually?
MHM
08-12-2024 05:22 AM
Hello,
manually
08-12-2024 05:24 AM
Then sure you will face this,
You make two host have same IP and different Mac
That not work unless you do manually clear arp cache
MHM
08-12-2024 05:27 AM
Two devices have the same IP, but only one is connected. When the first device is unplugged and replaced by the second one with the same IP, the ping doesn't work. A clear ip arp xx is needed to resolve the issue
08-12-2024 05:39 AM - edited 08-12-2024 05:39 AM
- You don't assign IP's to mac addresses : normally people let devices with different mac addresses use a different IP address by solid network management or automated with DHCP based solutions . (corrections made)
M.
08-12-2024 05:44 AM
we don't assign IP to mac addresses
08-12-2024 05:49 AM - edited 08-12-2024 05:50 AM
@marce1000 meant you assign IPs to devices....which has a MAC address. So essentially its a 1 to 1 IP<-MAC mapping and you assign an IP address to a MC address.
08-12-2024 05:39 AM
Hello,
This is likely due to the ARP timeout of the cache of 5 minutes. The entries stays in the database for 5 minutes by default in case the device needs to reach that device again within that 5 minutes. If it does reach out to it then the 5 minute timer is reset. This is used so the device doesn't have to ARP for an IP/MAC each time it needs to reach a device as its already in its cache.
-David
08-12-2024 05:41 AM - edited 08-12-2024 05:43 AM
Hello @saiddiab1605
This issue occurs because when two devices share the same IP address, but only one is connected at a time, the ARP cache on the switch retains the MAC address of the first device even after it's disconnected. When you replace the first device with the second one, the ARP table still associates the IP address with the old device's MAC address. Since the ARP entry isn't immediately updated with the new device's MAC address, the switch continues to direct traffic to the old, now disconnected MAC address, causing connectivity issues until the ARP table is manually cleared or naturally times out. This problem is exacerbated when the new device doesn't send a Gratuitous ARP, which would normally update the ARP cache across the network, or when the ARP cache timeout is set too high, causing the switch to hold onto stale entries for too long.
You can manually clear the ARP cache whenever you switch devices with the same IP address using the clear ip arp <IP address> command. Additionally, you can reduce the ARP cache timeout on your switch to ensure that stale ARP entries are flushed more quickly, minimizing the time during which incorrect MAC-IP mappings persist. This can be particularly useful in environments where devices frequently change or are replaced. By configuring a lower ARP timeout, such as 60 seconds, the switch will refresh the ARP table more frequently, reducing the likelihood of encountering stale ARP entries.
interface <interface_name>
arp timeout 60
08-12-2024 05:51 AM
Manually need clear arp or
Ping from new device to subnet broadcast make all other device add new mac-ip
MHM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide