On Fri, 7 Dec 2001, Lars Eggert wrote:

> rick norman wrote:
> 
> > What would be nice would be to load balance on a per connection
> > basis, not a per packet basis, between the two modems.
> > Any ideas how to do this ?
> 
> 
> Not with the current mechanisms in FreeBSD. You'd need a simple policy
> routing engine (actually, policy forwarding). A prototype based on tun
> devices shouldn't be too hard to put together. Basically, you'd want
> to pick one of your links based on destination address and optionally
> the port pair.


        An idea on how you would do pseudo load-balancing, would be:

ipfw add 500 divert natd1 ip from $NET to 0.0.0.0/1 out via $DSL_INT#1
ipfw add 500 divert natd1 ip from 0.0.0.0/1 to any in via $DSL_INT#1
ipfw add 250 fwd $DSL-2 ip from $NET to 128.0.0.0/1 out via $DSL_INT#1
ipfw add 550 divert natd2 ip from any to any via $DSL_INT#2

        Where:
        - $DSL_INT#1 is the default gateway interface.
        - $DSL_INT#2 is the interface of the second dsl Service
        - $DSL-2 is the IP of the gateway to the second dsl Service
        - $NET is your local network IP subnet.

        What the above is doing is sending anything from 1-127.X.X.X out
        dsl service 1 and sending 128-256.X.X.X out dsl service 2.

        It's not the best way to do it because more traffic may be going
        to the lower or upper X.X.X.X in which case it would not be
        symmetrical load balancing.  I would be interested to see some
        measurements to see how this works for people.

        PS.  I don't know if the above will work, but the firewall rules
        seem to imply it would....haven't tested it though.


Nick Rogness <[EMAIL PROTECTED]>
 - Keep on Routing in a Free World...
  "FreeBSD: The Power to Serve!"





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to