On 7/24/06, Stéphane Karges <[EMAIL PROTECTED]> wrote:
Any known a solution for use the outgoing loadbalancer only in case off one
connexion is down, I want use connexion WAN and if this connexion is down
redirect all on OPT and reverse.

Is it possible ?

The pfSense gods have already pronounced their judgement on this, so
I assume what I'm saying here will be entirely unsupported (and untested,
but I can't see any reason why it should not work on RC1 and later).

Here is a way you can do it:

1. setup the load balancer on WAN and OPT1 as described in the
outgoing_loadbalancing.pdf tutorial.

2. Do not do step 11. configuration of loadbalance firewall rule.  Instead
push the traffic over the default interface.  When the default gateway is
unreachable (WAN failure), a script will change default route over to OPT1.

3. The loadbalancer will output all active monitor IPs in /tmp/<pool_name>.pool
If you are using the same IP as the monitor and gateway IPs,  then you are in
luck. The coding is much simpler as you don't have to resolve gateway IP from
the monitor IP.

4. Write a shell/php script that periodically
   a. gets the current default gateway from "netstat -nr -f inet"
   b. checks if the default gateway is in /tmp/<pool_name>.pool
   c. if the default gateway is not live, then get the next available gateway
       from /tmp/<pool_name>.pool and run "route change default $new_gw"

If your monitor IP is not the same as your gateway IP, then some php
magic is required.

As I mentioned already, I don't think this would get any official support.
And I'm certain the pfSense gods are brewing a far cleaner solution to
this problem which will make my solution look like an ugly hack.  It all
depends on how desperately you want this :-)

- Raja

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to