Need network failover script

I need a script to change the network connection during network down. This is my configuration.
Having three NIC, eth0 connected to local network and eth1 & eth2 are connected to internet using two seprate DSL connection.

This is my requirement:

If one DSL connection is down means automatically script to change the internet connection to another working DSL.

Any script is there for my requirement?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Writing a script should be straightforward bud,all you should need is an "ifdown ethx", "ifup ethy" as long as the IPs etc have been assigned already.

The issue will be how to efficiently monitor the network connection to trigger the switch.

Perhaps a cron to access some form of net resource, ie web site, FTP etc, and if the access fails, trigger the network switch.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Is keepalived not just related to the LVS project and removing LVS systems?

Pardon my ignorance here, just to understand a wee bit.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Afaik, you can use it for pretty much any IP service. I previously used keepalived to have a single entry point for a couple of vpn's to a partner, worked like a charm, admittedly this was a few years back before we got vpn concentrators, but hey it worked, and its free.
Ahh, I see now.

Looks quite neat.

Thanks for clarifying.
rajasekarramasamyAuthor Commented:
Any shell script is there for my requirement.
I thought that Rowley answered the question quite well with keepalived.

Not sure what ele he is looking fo rhere.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.