Link to home
Start Free TrialLog in
Avatar of rajasekarramasamy
rajasekarramasamyFlag for India

asked on

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?
Avatar of deimark
deimark
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
ASKER CERTIFIED SOLUTION
Avatar of Rowley
Rowley
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start 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.
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.

http://www.linux.com/feature/114005
Ahh, I see now.

Looks quite neat.

Thanks for clarifying.
Avatar of rajasekarramasamy

ASKER

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.