On 4/22/07, shimi <[EMAIL PROTECTED]> wrote:
On Sunday 22 April 2007 20:11, Maxim Veksler wrote:
> Hi,
>
> I have X default getaways on my machine, I would like to test for
> reachability from my machine outside using gw X1. All gateways exist
> on the Internet.
>
> The way I'm thinking to solve this is by configuring a specific route
> via gw X1 IP address to some host on the Internet (say 194.90.1.5)
> then doing continues ping to it (with 60s interval). I can see on the
> output of ifconfig ppp1 if the number of RX packets increased.
>
> I'm trying to solve a ppp going down problem by rerunning wvdial on it
> by requirement.
>
> Any ideas on a "proper" solution?

I am assuming every DGW is on a different pppX ? If so, you can simply use
ping -I <iface> (where iface is other IP of the interface or device name).

If not, and they all go through the same interface, I guess routing by
destination like you said is the right solution...

        -- Shimi


Good tip, thank you.
Here's something I've scratched, I will be calling this via cron on a
per minute interval.

"""
#!/bin/bash

## ppp1 is the interface of Motorola V3 handheld

###
# ping
#
# -I interface address or device name
# -c count
# -i interval
#

(

ping -I ppp1 -c 3 -i 0 194.90.1.5
if [ $? != 0 ]; then {
       PID_OF_WVDIAL_PELE=`cat /var/run/ppp1.pid`
       kill $PID_OF_WVDIAL_PELE

       ps -e -o pid |grep -E "$PID_OF_WVDIAL_PELE$"

       if [ $? != 0 ]; then {
               sleep 10
               kill -9 $PID_OF_WVDIAL_PELE
       } fi #//ps|grep $?

       echo "$(date): Restarted MotoV3 ppp1 connection" >> /tmp/ppp1.log
       wvdial &
} fi #//ping $?

) > /dev/null 2>&1
"""

Public Domain ;).

--
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to