Linux – Newbie questions on MAC and high availability failovers

clusterfailoverclusterlinuxmac addressnetworking

I am reading about High Availability and I can not understand the following I read:
On failover the primary IP migrates to the backup server BUT so must the MAC address.

Specifically I read that every machine has a unique address MAC that can be used by all interfaces in the machine. I don't get this part. Doesn't the MAC belong to the NIC? What is meant by interfaces in this sentence?

Also on failover the clients must update their IP/MAC mapping and found 3 ways for this one of which is by using a custom MAC and move it from primary to backup along with the public IP.
How is this possible? Do high availability software e.g. Pacemaker do this? How?

Best Answer

The book is correct, however there are pieces it left out.

  • MAC addresses are not as fixed as you would think, most higher end NICs have the ability to change the MAC address to something specific. Either in the NIC's BIOS or in the driver itself.
  • There are specific ranges of MAC address set aside for 'virtual' systems (see What range of MAC addresses can I safely use for my virtual machines?)
  • Clustering software may use MAC addresses from these set-aside ranges to present the cluster IP services.
  • The linux network stack has the ability to create virtual NICs with specific MAC addresses.

The procedure followed by clustering software to create a service based on a virtual MAC address is pretty straight forward. When the service comes up, it offers a Gratuitous Arp packet saying that the specific IP address can be found on the virtual MAC address. When failover happens, the 'down' node removes its local IP/MAC binding and the new node starts listening to that virtual MAC address and IP combination. No muss no fuss.

The other method used by clustering software is to not bother with virtual MACs at all and rely on Gratuitous ARP the whole way. The startup/failover sequence for such a system would look like:

  1. cluster software binds IP to Node A.
  2. Node A G-ARPs "192.168.244.60 is on 02-00-ab-cd-ef-01"
  3. All devices on the subnet update their ARP tables.
  4. Time passes.
  5. Node A crashes.
  6. Cluster software binds IP to Node B.
  7. Node B G-ARPs "192.168.244.60 is on 02-00-ab-cd-41-ba"
  8. All devices on the subnet update their ARP tables.

In my experience the second method, pure G-ARP, is the one used by most linux clustering these days. However, both methods are valid and have been used. The benefit of the G-ARP method is that you don't have to muck about assigning virtual MAC addresses. The benefit for the pure virtual-MAC method is that it doesn't rely on G-ARP working on a given subnet.

Related Topic