We want to do the same things as you : have a virtual IP which is assigned to both servers.
We are running on CentOS 7.
So we do this :
- Cluster01 : 10.10.10.11
- Cluster02 : 10.10.10.12
- VirtualIP : 10.10.10.10
On Cluster 01 :
iptables -I INPUT -i ens160 -d 10.10.10.10 -j CLUSTERIP --new --hashmode sourceip --clustermac 01:00:5E:00:00:20 --total-nodes 2 --local-node 1
ip addr add 10.10.10.10/24 dev ens160
On Cluster 02 :
iptables -I INPUT -d 10.66.66.10 -i ens160 -j CLUSTERIP --new --hashmode sourceip --clustermac 01:00:5E:00:00:20 --total-nodes 2 --local-node 2
ip addr add 10.10.10.10/24 dev ens160
We are able to ping the VirtualIP (but only from Cluster01 & Cluster02). We add manually the HW address on arp cache :
arp -i ens160 -s 10.10.10.10 01:00:5E:00:00:20
iptables -L -n -v
Chain INPUT (policy ACCEPT 2221 packets, 151K bytes)
pkts bytes target prot opt in out source destination
0 0 CLUSTERIP all -- ens160 * 0.0.0.0/0 10.10.10.10 CLUSTERIP hashmode=sourceip clustermac=01:00:5E:00:00:20 total_nodes=2 local_node=2 hash_init=0
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1536 packets, 1412K bytes)
pkts bytes target prot opt in out source destination
On both servers we have the file /proc/net/ipt_CLUSTERIP/10.66.66.10
From my workstation, I can access to my web page on Cluster01 & Cluster02 & VirtualIP. But the Load Balancing doesn't work...it is only the same server which answer...