Hi,
a file called ip_table:
# Client (SRC_IP) # Server (DST_IP)
10.1.1.1 10.1.5.7
10.1.1.2 10.1.5.12
10.1.1.3 10.1.5.7
10.10.0.2 10.1.5.7
the LB does something like this:
if (SRC_IP = 10.1.1.1)
GO TO SERVER (DST_IP = 10.1.5.7)
if (SRC_IP = 10.1.1.2)
GO TO SERVER (DST_IP = 10.1.5.12)
maybe you can call this method a static source scheduling
Is there a existent scheduler method, which i can used or is there some work
todo?
No, but fwmark is made for this. With your example:
iptables -t mangle -A PREROUTING -s 10.1.1.1/32 -m mark --mark 1
iptables -t mangle -A PREROUTING -s 10.1.1.3/32 -m mark --mark 1
iptables -t mangle -A PREROUTING -s 10.10.0.2/32 -m mark --mark 1
iptables -t mangle -A PREROUTING -s 10.1.1.2/32 -m mark --mark 2
ipvsadm -A -f 1
ipvsadm -A -f 2
ipvsadm -a -f 1 -r 10.1.5.7
ipvsadm -a -f 2 -r 10.1.5.12
It will then look as follows:
milk-net_tfxdev:~# iptables -t mangle -n -L PREROUTING
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
all -- 10.1.1.1 0.0.0.0/0 MARK match 0x1
all -- 10.1.1.3 0.0.0.0/0 MARK match 0x1
all -- 10.10.0.2 0.0.0.0/0 MARK match 0x1
all -- 10.1.1.2 0.0.0.0/0 MARK match 0x2
milk-net_tfxdev:~# ipvsadm -L -n
IP Virtual Server version 1.0.6 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
FWM 1 wlc
-> 10.1.5.7:0 Route 1 0 0
FWM 2 wlc
-> 10.1.5.12:0 Route 1 0 0
milk-net_tfxdev:~#
Does this do the trick for you? Be warned however, that this setup could have
severe impact on the functionality of a healthcheck when you don't design it in
an intelligent way.
Cheers,
Roberto Nibali, ratz
--
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
|