# Link failover



## schmurfy (Apr 4, 2010)

Hi everyone,

I have done some research but cannot find a real answer to my question so here I am 
My current configuration is a freebsd box connected to a freebsd server using two links (they are DSL links but we have control over both sides), my problem is how to implement failover on these links ?

We are using the links for data and voip, both services have a main link and consider the other as a backup link (each service operate on a different logical networks), I first looked toward existing routing protocols but it looks like none can do what we want which is switching default route to backup link if:
- the main link is above x% packets lost
- the main link is down
- the main link's latency is above x ms

The tricky part is that other conditions should apply to the reverse switch (from backup to main) to prevent flapping between the two links, ideal conditions should be that the first link does not match conditions above for at least x seconds.

Our current solution is to use a small daemon we made to simply switch routes when needed but I am not quite happy with that and I feel like there should be a better way, any idea ?


----------



## SirDice (Apr 5, 2010)

Have a look at CARP, lagg, or more trickier OSPF.


----------



## schmurfy (Apr 5, 2010)

Thanks for the pointers.
I have already gave up on ospf (only use link bandwidth as metric), I will have a look at carp and lagg to see if they can help me on this.


----------



## frankpeng (Mar 30, 2012)

Looks it needs a reboot to reconfigure the FreeBSD server make it change. I can keep checking the Internet connection, when it has no connection, I can change the configuration files such as /etc/rc.conf and issue a command "*reboot*". This is ugly, but I did not find a good solution. CARP needs two computers. Not a solution here. LAGG is about the server's client. Not the server.


----------

