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

programming a loadbalancing n connection

I have 2 ADSL ad1 and ad2 , one PC for my firewall and some deamon on it with 3 ethernet : eth0 connect to my LAN ( ) and 2 other connect to ad1 and ad2


                                                                                 |eth1 ( ( ADSL 1 )


My LAN( |---------eth0(à PC


                                                                                 |eth2 ( (ADSL 2 )


All computer   in LAN has default router = ( eth0 of PC )


In the /etc/network/option I enable the forwardable = 1


I use iptable to NAT the outgoing of eth1 and eth2


Iptables –t nat –A POSTROUTING –s –o eth1 –j SNAT –to


Iptables –t nat –A POSTROUTING –s –o eth2 –j SNAT –to


So now computers in LAN could be SNAT to one of two IP, to go out , but how to control what SNAT to chose .


The ideal of mine is  writing a programe loadbalancing for n line ADSL contact to one PC as gateway , and my start is control what SNAT to use . If you have some idea or experience of if , help me please

Reply to: