How do I do IP Failover for my Public IP address with Linux HA

Solution 1:

So you need a method to survive some kind of failure. Failure of what?

Failure of your router

You need:

  • a cluster of two routers; pick ones that support clustering (passive-active is enough)
  • two physical links from your ISP
  • all servers should connect independently to both routers

Failure of either your router or ISP (done with DNS)

You need:

  • two ISPs
  • two "public" IPs (that is, Internet IPs)
  • a DNS server with
    • round-robin,
    • and a very small TTL
    • and capable of automatic deletion of IP record when that IP becomes unavailable

Failure of either your router or ISP (done with BGP)

You need:

  • two ISPs
    • each ISP to support BGP protocol - usually the cost is prohibitive
  • two "public" IPs
  • two routers with BGP support

With BGP you have much faster failover of incoming traffic than with DNS.

Solution 2:

Is your goal to stay online in case of modem/router failure? If yes, this gets very complicated in that the IP address assigned to you is assigned to that particular modem.

If you have a domain name that you are using for this purpose you could get redundant internet service, and a router that can handle multiple WAN ports with failover. Multitec makes a line of routers for this purpose. You can then set up Round-Robin service on the domain with your provider.

If you do not already have a domain, you could get one from a dynamic dns site like http://no-ip.com or dyn.com. Most of these routers have options in their firmware for keeping a site like this updated.