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

Load balancing DHCP (dsl and cable)



Hi guys...
I tried to use the example in PF's FAQ for load balacning between two
DHCP connections in my apartment.  From the results of my efforts i
can only assume the second connection just isnt being used at all.  I
also think im having problems with my default gateway becuase traffic
is not as quick when I envoke the following (more later).    Since you
guys can pinpoint whats going on a lot better ill hand over my
results.  I have searched the internet for days but found no
documentation or examples utilizing this or how it works and how it
will act for different connection types.
My main motivation is to load balance bandwidth intensive connections
between users on my network (my two roomates).  Our main applications
used are gaming and bittorrent along with the usual VPN into my school
for work, etc)  soooo.....
A.  Is there ANY better way to help load balance connections between
users?  Im not looking for aggrigate bandwidth just the ability to
utilize two connections to their fullest for mostly downstream
bandwidth usage of internal clients.
B.  Can I staticly route any ports/protocols over a certain interface
from NAT?
C.  Does gasp *linux* or any other open-source packet filter have
better more powerfull options for this type of situation?
D.  This is broken why?  :-(
here is what i did...
---- PF.CONF -----
lan_net = "10.0.0.0/24"
int_if  = "bge0"
ext_if1 = "re0"
ext_if2 = "bge0"
ext_gw1 = "24.148.37.1"  # defai;t route on last dhcp renewal.  
ext_gw2 = "192.168.0.1"  # defualt route for this connection is my dsl
modem which has ip addr of 192.168.0.1
#  nat outgoing connections on each internet interface
nat on $ext_if1 from $lan_net to any -> ($ext_if1)
nat on $ext_if2 from $lan_net to any -> ($ext_if2)
#  default deny
block in  from any to any
block out from any to any
#  pass all outgoing packets on internal interface
pass out on $int_if from any to $lan_net
#  pass in quick any packets destined for the gateway itself
pass in quick on $int_if from $lan_net to $int_if
#  load balance outgoing tcp traffic from internal network. 
pass in on $int_if route-to \
    { ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin \
    proto tcp from $lan_net to any flags S/SA modulate state
#  load balance outgoing udp and icmp traffic from internal network
pass in on $int_if route-to \
    { ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin \
    proto { udp, icmp } from $lan_net to any keep state
#  general "pass out" rules for external interfaces
pass out on $ext_if1 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if1 proto { udp, icmp } from any to any keep state
pass out on $ext_if2 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if2 proto { udp, icmp } from any to any keep state
#  route packets from any IPs on $ext_if1 to $ext_gw1 and the same for
#  $ext_if2 and $ext_gw2
pass out on $ext_if1 route-to ($ext_if2 $ext_gw2) from $ext_if2 to any 
pass out on $ext_if2 route-to ($ext_if1 $ext_gw1) from $ext_if1 to any 
--
Matt Sellers
indigoblu (at) gmail.com