Skip to contentSkip to conversation

Clusterip: What about Cluster-side ARP-requests

DISCUSSION Alex 2 participants 2 messages Jun 20, 2005 – Jun 22, 2005

Subsystems (2)
lore
Share & tools
lore

Alex

author
#0 lore raw

Hi folks,

as far as I can see from the CLUSTERIP source all ARP-Responses are manipulated so that the clients have a multicast MAC - ClusterIP mapping in their ARP-caches. But what about ARP-requests from the nodes itself? Such a request is not mangled by the module and thus contains the original non-cluster-MAC.
This changes the clients ARP entry to a non multicast-MAC.
I reproduced this case and pinged a two node cluster (kernel-2.6.10). After a while node 2
makes an arp request using the NIC's MAC and not the Cluster's MAC. From that moment the other node doesn't see any cluster traffic.
Do I have any missconception?

Signature · 2 lines
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
#1 lore raw
Quoted 7 lines · Alex

Hi folks,

as far as I can see from the CLUSTERIP source all ARP-Responses are manipulated so that the clients have a multicast MAC - ClusterIP mapping in their ARP-caches. But what about ARP-requests from the nodes itself? Such a request is not mangled by the module and thus contains the original non-cluster-MAC.

yes, you're totally correct. Seems like I forgot about the fact that arp caches learn from both (requests and replies) while writing that particular piece of code.

Quoted 1 line

Do I have any missconception?

no. It just seems like nobody really ran the code since it was merged mainline - or at least in no setup that would cause outbound arp requests on the cluster ip address.

Please try the attached patch:

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
net/ipv4/netfilter/ipt_CLUSTERIP.c +3 -2
Index: linux-2.6/net/ipv4/netfilter/ipt_CLUSTERIP.c
===================================================================
@@ -522,8 +523,9 @@
 	    || arp->ar_pln != 4 || arp->ar_hln != ETH_ALEN)
 		return NF_ACCEPT;
 
-	/* we only want to mangle arp replies */
-	if (arp->ar_op != htons(ARPOP_REPLY))
+	/* we only want to mangle arp requests and replies */
+	if (arp->ar_op != htons(ARPOP_REPLY)
+	    && arp->ar_op != htons(ARPOP_REQUEST))
 		return NF_ACCEPT;
 
 	payload = (void *)(arp+1);