LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Two connections -one backup - one normal ?? (https://www.linuxquestions.org/questions/linux-networking-3/two-connections-one-backup-one-normal-413005/)

ALInux 02-08-2006 09:49 AM

Two connections -one backup - one normal ??
 
Hi
Ive got two active connections...one is an always on connection "pppoe"...and the other one is a cable connection with a limited monthly download rate. Iam using the pppoe for browsing etc...but it is not very stable..so I need to use the cable connection when the pppoe connection is down. However, I do not need to balance the connection nor do I need to preserve the state from one package to another.
I was thinking about something simple...
1- cron job checking for ppp0 if it is down execute a custom script that clears the routing tables and dns and switches to cable..keep croning to check if ppp0 is up if so terminate cable connection clear dns and routing tables and use ppp0...this might be somehow naive...If there is a iptables implementation for this ...please any suggestions hints ....
In short, I just need to switch btw one connection and another with the priority to the "always on" pppoe connnection.
Thx

satinet 02-09-2006 04:16 AM

i guess the trick will be finding a reliable means of testing whether the connection is really down (as opposed to not doing anything).

if you could to that you could use a while look (while :) to keep cheching it.

then when it's failed run the fail over script. obviously your script will need to monitor when it comes back up then run a fail back script.

you would need to write a new init script and call it an an appropriate run level.

it sounds complex but i think doable - IMHO reliably determining whether a connection is really down is harder that you might imagine....

ALInux 02-09-2006 08:32 AM

I had some problems with the "always on" pppoe connection ...however when it is down eth0 is down immediatly...Ive checked that in the syslog file..and ppp0 will be down too...the problem is that ppp0 might be up but there might be no connectivity for some reaoson...I mean a very low download rate .....I will try to implement it and if it works I will post it ....

ALInux 02-09-2006 08:40 AM

So if the connection is down...eth0 or ppp0...In my croned script i.e. within the while loop I keep executing ifconfig and then I grep,sed,head :D through it to check if there is eth0...and upon the results I act...


All times are GMT -5. The time now is 04:04 AM.