iptables based load balancing doesn't work on lo interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

  I have made iptables rules for load balancing traffic over a set of
ports. When packets coming through eth0, this load balancing works
perfect. But when packets are coming through loopback interface 'lo' (
another process in the same machine writes to
<ipaddress>:<destinationport>, load balancing rules are not getting
into effect. Is this expected behaviour or do I need to do some
settings to get it worked.

My server is debian based linux.

Below are my rules

-A TURN_TCP -p tcp -i lo --dport 3477 -m statistic --mode nth --every
4 --packet 0 -j REDIRECT --to-port 3477
-A TURN_TCP -p tcp -i lo --dport 3477 -m statistic --mode nth --every
3 --packet 0 -j REDIRECT --to-port 3478
-A TURN_TCP -p tcp -i lo --dport 3477 -m statistic --mode nth --every
2 --packet 0 -j REDIRECT --to-port 3479
-A TURN_TCP -p tcp -i lo --dport 3477 -j REDIRECT --to-port 3480
-A PREROUTING -i lo -m multiport -p tcp  --dports 3477:3480 -j TURN_TCP

-A TURN_TCP -p tcp -i eth0 --dport 3477 -m statistic --mode nth
--every 4 --packet 0 -j REDIRECT --to-port 3477
-A TURN_TCP -p tcp -i eth0 --dport 3477 -m statistic --mode nth
--every 3 --packet 0 -j REDIRECT --to-port 3478
-A TURN_TCP -p tcp -i eth0 --dport 3477 -m statistic --mode nth
--every 2 --packet 0 -j REDIRECT --to-port 3479
-A TURN_TCP -p tcp -i eth0 --dport 3477 -j REDIRECT --to-port 3480
-A PREROUTING -i eth0 -m multiport -p tcp  --dports 3477:3480 -j TURN_TCP


Thanks and regards
~S
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux