On Thu, 2006-03-30 at 22:10 -0800, jay shi wrote:
>  
>      here i want to use user my  first internet
> connetion ( gateway 192.168.0.1) as a primary net .
>      The simple script for this which i written is as
> follows
> 
> wget -t 1 --timeout=4  --bind-address 192.168.0.80
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^     
Do you have mutiple NICs on your Linux box?

> http://< some ip >
> 
> if
>  [ -s /root/index.html  ]
> then
>     echo " Net is working"
>     route del default
>     route add default gw 192.168.0.1
> else
>      echo " Net is down but it is up with anothe gw "
>      route del default
>      route add default gw 192.168.0.50
>                                                       
>                                           fi
> rm -f  /root/index.html
>     
>        here 192.168.0.80 is my server ip.My problem is
> by this script, when net started through primary
> gatway  then   i am not able  to switch to my primary
> gateway ( 192.168.0.1). 

When asking for such kind of help it is worthwhile to give a topology of
your network.  An ASCII line art depiction would suffice.

Appears you have the router/modems to isp_pri and isp_sec on the same
subnet 192.168.0.x.

isp_pri_wan_peer is the ip on the ISP side of the link of isp_pri or
find out the ip of the "default" gw used by your router/modem on the WAN
port.

Define a route to isp_pri_wan_peer reachable through "host" 192.168.0.1
(your pri router/modem) - see man page for route).  Now when you ping
isp_pri_wan_peer it will route thru your pri router 192.168.0.1.  If the
ping response is success then you do nothing o/w switch to sec ISP.  You
can poll this at whatever interval you decide.

HTH
-- 
Arun Khan
Linux is like a wigwam - no gates, no windows, apache inside



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-india-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to