# Automatic failover using 2 DSL connections



## acleworth (Jan 17, 2011)

Here is the setup:


```
NETWORK PROVIDER 0            NETWORK PROVIDER 1
         \                            /
          \                          /
           \                        /
            \                      /
             \                    /
          ROUTER 0            ROUTER 1
          41.0.0.1            196.0.0.1
              \                  /
        +------\----------------/------+
        |       \              /       |
        |       em0          em1       |
        |    41.0.0.2    196.0.0.2     |
        |                              |
        |         FREEBSD BOX          |
        |                       fxp0   | 
        |                192.168.0.1---|------------- Switch
        +------------------------------+
```

Is there a way I can setup an automatic failover from one DSL to the other if one goes down?
Without using scripts?


----------



## DutchDaemon (Jan 17, 2011)

lagg(4)


----------



## acleworth (Jan 18, 2011)

How would I change my pf rules?
Would I just need to use the lagg interface in my ruleset?


----------



## DutchDaemon (Jan 18, 2011)

I seem to remember you can define something like:


```
ext_if="(lagg0)"
```

and write rules for $ext_if after that.


----------



## acleworth (Jan 19, 2011)

I'm still not sure how the lagg will work using two different gateways. If I have the defaultrouter set in rc.conf for the master interface, how does the 2nd defaultrouter get used when the master interface is down?

Isn't lagg for two NIC's connected to the same switch, and not over a WAN? Sorry for the questions, I'm fairly new to BSD.


----------



## Pie (Jan 19, 2011)

*Hijacking your thread!*

I'm BSD noob too, and it seems to me the only option is additional package(e.g. quagga).
I didn't find how to make it with basic tools.

It feels really weird to have 3(sic!) packet filters out of the box, but lack for simplest routing manager.

With quagga it's the same configuration as for cisco router floating static routes:

```
ip route 0.0.0.0/0 GW_A AD1
ip route 0.0.0.0/0 GW_B AD2
```
P.S.
Looking for some FreeBSD network guru to prove me wrong.


----------



## DutchDaemon (Jan 19, 2011)

http://serverfault.com/questions/30...ting-and-failover-with-2-wans-dynamic-routing


----------

