Monday, December 31, 2012

Force refresh of remote device's ARP cache

Background


ARP.
This is short for Address Resolution Protocol.
This is a method for finding the hardware address (MAC) when only its IP is known.

On OSI model, ARP is a Data Link Layer Protocol. (Layer 2). IP is on Network Layer (layer 3).

There are times when you need to force the remote devices, such as the routers, switches or gateways to refresh their ARP cache when you perform some network changes on servers. Some of these changes includes
  • Physical Box relocation (requiring a new network IP)
  • Logical IP relocation (especially in cluster or DR)

ARP cache will be updated usually when either of the following happens

  • Expiry of the entry in the cache
  • Host updates the router about the change in IP
  • ARP cache is manually cleared.


Without forcing through an immediate ARP cache refresh, sometimes the network will not know the changes until very much later and end result is service unaccessible, causing losses to busineseses and much headaches for the IT team.


Procedures (RHEL)


On RHEL, usually arping is available in the default installation. You need to execute the command in root.

# /sbin/arping -s -b

where

-b : keep broadcasting, don't go unicast
-s source : source ip address


Procedures (Windows XP, Vista, 7)


netsh interface IP delete arpcache