Load Balancing Outgoing, its possible ?

Łukasz Dudek mocart at pinco.pl
Fri Oct 28 07:15:40 PDT 2005


Dnia Fri, Oct 28, 2005 at 08:33:34AM -0200, Daniel Dias Gonçalves napisał(a):
> 
> It is possible to make this balancing with the PF ? Exists some software 
> that I make this ? Zebra can help me?
> This type of balancing gives to problems with the navigation of the user 
> of NAT or IP valid ?
> If it is possible, wanted to see examples with rules.
> 

it is possible.


#BALANCING TWO INTERNET CONNECTIONS
#
#People who have multiple net connections and are unable to use a proper
#multipath routing solution (ie. BGP4) can use this to balance *outgoing*
#traffic across the two connections, with something like this:
#
#
nat on $ext_if1 from $int_subnet to any -> ($ext_if1)
nat on $ext_if2 from $int_subnet to any -> ($ext_if2)
#
## routing for internal subnets
pass in on $int_if \
#	route-to { ( $ext_if1 $gateway1), ( $ext_if2 $gateway2 ) } round-robin \
#	from $int_subnet to any keep state
#
## need the next rules to properly pass traffic to/from the external IPs
pass out on $ext_if2 route-to ($ext_if1 $gateway1) from $ext_if1 to any 
pass out on $ext_if1 route-to ($ext_if2 $gateway2) from $ext_if2 to any 
#
#
#Please note that this is only the skeleton of a ruleset that would work
#in such a situation; care must be taken to ensure that the correct
route-to options are put on each rule which needs to be balanced

pozdr
mocart


More information about the freebsd-net mailing list