ARP

28 Mar

If you change IP's on a machine to an IP that used to be on the same switch (or was an active IP – e.g. a heartbeat failover) the arp tables in Linux might be messed up. Check them with: /sbin/arp -a

 Flush the arp table:

/sbin/arp -d -a 

Advertisements

One Response to “ARP”

  1. jtsoong March 31, 2006 at 9:58 am #

    That will certainly work, the drawback is that you’d have to flush the
    ARP cache on each and every target or remote machine.

    One trick you can do is to reverse the where you clear the ARP cache :

    (a) clear the ARP cache on the machine that has just changed its IP
    address

    (b) ping one of the remote hosts that you want to update. The ping will
    cause the local machine to issue an ARP Request for the ping
    destination. As an optimisation in ARP, when a host receives an ARP
    Request, it not only responds with an ARP Reply, but it also remembers
    or updates any local ARP entries for the source for the ARP Request.
    This is on the assumption that if a remote device is issuing an ARP
    Request it is likely that the ARP-Request receiving host will need to
    communicate with the ARP-Requesting host, so rather than having to issue
    it’s own ARP-Request in a moment, it may as well store an ARP entry for
    the original ARP-Requesting host (got that ? 🙂 i.e. A ARP-Requests for
    B, B responds with an ARP-Reply, B will probably have to ARP-Request for
    A in a moment, so B may as well remember A’s MAC and IP address instead,
    that is supplied in A’s ARP-Request).

    Further to (b), if you make the destination address of the ping either
    the link local broadcast (255.255.255.255, specifying an outgoing
    interface), or the subnet broadcast address (e.g. 192.168.0.255 for
    192.168.0/24), then it is likely that all the ARP caches on the remote
    machines will be updated with A’s new MAC address.

    >From what I remember, hosts supporting sending or receiving and
    responding to broadcast pings is a bit of a grey area in the RFCs, so
    using broadcast pings to do this ARP update trick may not work in some
    cases. I’d assume it by default, if it didn’t work then that is what I’d
    suspect. Up until recently all hosts I’d worked with did respond to
    broadcast pings by default, until I encountered XP. Of course I rebooted
    the switch and router after that happened, because I got not responses
    from any devices at all to the broadcast ping, so it looked like a layer
    2 fault (and it was cheap switch). Very annoying when I realised what
    had happened. I don’t like booting switches or routers to try to fix a
    fault, they’re supposed to be working 24×7, I think rebooting to try to
    fix a problem should be the absolute last resort.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: