I have set up a computer that uses multiple virtual interfaces with a total of about 10 ip's.
I have set up iptables with snat, so that each request coming from the computer is balanced across the pool of these 10 ip's.
For more information on why, I won't reiterate, see here:
Now....it works, as long as the requests don't originate from the computer on which the virtual interfaces are(server1). If I set another computer (server2) to use it (server1) as it's(server2) gateway, it works just fine. Though, the round-robin load balancing seems a bit wonky, as it does a 22.214.171.124.126.96.36.199.188.8.131.52 balance. Meaning that packets have a source address of the first address in the pool for the first three packets, THEN it's more round robin.
I'm using the command:
iptables -t nat -p all -A POSTROUTING -s 0.0.0.0/0 -j SNAT --to-source 10.13.199.1-10.13.199.3
The second problem I have, is I cannot get it to round-robin the source address for packets originating on the same machine, only for machines that use (server1) it as their gateway. I've been told I need to do some packet marking using iptables, so that the server1 originating packets are processed by iptables, but I'm not sure where to begin.
Any help at all will be much appreciated.