1 Allows you to deploy gateway and back-end load-sharing clusters without the
2 need of load-balancers.
4 This match requires that all the nodes see the same packets. Thus, the cluster
5 match decides if this node has to handle a packet given the following options:
7 \fB\-\-cluster\-total\-nodes\fP \fInum\fP
8 Set number of total nodes in cluster.
10 [\fB!\fP] \fB\-\-cluster\-local\-node\fP \fInum\fP
11 Set the local node number ID.
13 [\fB!\fP] \fB\-\-cluster\-local\-nodemask\fP \fImask\fP
14 Set the local node number ID mask. You can use this option instead
15 of \fB\-\-cluster\-local\-node\fP.
17 \fB\-\-cluster\-hash\-seed\fP \fIvalue\fP
18 Set seed value of the Jenkins hash.
22 iptables \-A PREROUTING \-t mangle \-i eth1 \-m cluster
23 \-\-cluster\-total\-nodes 2 \-\-cluster\-local\-node 1
24 \-\-cluster\-hash\-seed 0xdeadbeef
25 \-j MARK \-\-set-mark 0xffff
27 iptables \-A PREROUTING \-t mangle \-i eth2 \-m cluster
28 \-\-cluster\-total\-nodes 2 \-\-cluster\-local\-node 1
29 \-\-cluster\-hash\-seed 0xdeadbeef
30 \-j MARK -\-set\-mark 0xffff
32 iptables \-A PREROUTING \-t mangle \-i eth1
33 \-m mark ! \-\-mark 0xffff \-j DROP
35 iptables \-A PREROUTING \-t mangle \-i eth2
36 \-m mark ! \-\-mark 0xffff \-j DROP
38 And the following commands to make all nodes see the same packets:
40 ip maddr add 01:00:5e:00:01:01 dev eth1
42 ip maddr add 01:00:5e:00:01:02 dev eth2
44 arptables \-A OUTPUT \-o eth1 \-\-h\-length 6
45 \-j mangle \-\-mangle-mac-s 01:00:5e:00:01:01
47 arptables \-A INPUT \-i eth1 \-\-h-length 6
48 \-\-destination-mac 01:00:5e:00:01:01
49 \-j mangle \-\-mangle\-mac\-d 00:zz:yy:xx:5a:27
51 arptables \-A OUTPUT \-o eth2 \-\-h\-length 6
52 \-j mangle \-\-mangle\-mac\-s 01:00:5e:00:01:02
54 arptables \-A INPUT \-i eth2 \-\-h\-length 6
55 \-\-destination\-mac 01:00:5e:00:01:02
56 \-j mangle \-\-mangle\-mac\-d 00:zz:yy:xx:5a:27
58 In the case of TCP connections, pickup facility has to be disabled
59 to avoid marking TCP ACK packets coming in the reply direction as
62 echo 0 > /proc/sys/net/netfilter/nf_conntrack_tcp_loose