ip failover between two network interfaces

barak

Registered
Hello,

Here is a problem I'm trying to address for long time...

I'm having an OS X machine with 2 network interfaces. en0 has IP 192.168.168.1, en1 has IP 192.168.168.2. The netmask for both cards is 255.255.255.0.

For some reasons, all other machines in the LAN, should communicate with this machine via virtual IP, say 192.168.168.5. So, using ifconfig, I've aliased en0 with the virtual ip and netmask 255.255.255.255. This ip is visible from any point in the LAN. Now, to gain high availability, I need to manage a failover mechanism for this virtual ip onto the second interface en1. Link aggregation solution is not possible here, since each NIC is connected to different switch.

I'm trying to use failoverd/heartbeatd:

$ heartbeatd 192.168.168.5
$ failoverd 192.168.168.5 en1:192.168.168.5

Few miliseconds after failoverd is raised, the output of ifconfig shows that both NICs have the virtual ip! Raising failoverd in debug mode, shows that few miliseconds after it raised, it mistakely idenitify like the virtual ip went down, so failoverd load this ip on the second interface en1. dmesg show duplicate ip warnings on this ip. The ip is still available from other points in the LAN.

Am I doing something wrong? Should heartbeatd/failoverd function if the IP is virtual? Any other solution for ip failover for virtual ip for 2 NIC on the same host?

Thanks,

Barak.
 
Back
Top