Solved

advanced batch file, write or append ping result to file >.txt, load balancing, persistent routes, metrics.

Posted on 2004-10-07
3
522 Views
Last Modified: 2012-06-21
Further to this, i'm trying to find a way to run diagnostics on the whole set up.

What i've come up with so far, is another batch file as follows:

route delete 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.1   -p
ping www.google.com >c:\ADSL\router1.txt
route delete 0.0.0.0

route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.2   -p
ping www.google.com >c:\ADSL\router2.txt

route delete 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.3   -p
ping www.google.com >c:\ADSL\router3.txt

route delete 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.4  -p
ping www.google.com >c:\ADSL\router4.txt

Is there a way of using dos commands to append to a batch file the ping results from each router?

Anyone got any better ideas?

I need a free window's proxy that's free, stable, load balancing, auto switching, (is bonding possible with ADSL when you use different isps??) that will do basically what the firebrick does.  www.firebrick.co.uk <- maybe time to plug aaisp.net, thanks for the £1000+ quote!

Jasef, still only got 5 comps on, will add 5 more tomorrow, maybe another router too.
0
Comment
Question by:jondanger
3 Comments
 
LVL 13

Accepted Solution

by:
masterbaker earned 500 total points
ID: 12253011
Yes, just use ">>" instead of ">" in your batch file.  Like this:

ping www.google.com >> c:\adsl\router.txt
ping www.microsoft.com >> c:\adsl\router.txt
echo Howdy >> c:\adsl\router.txt

That should do it.

Jeff
0
 
LVL 3

Expert Comment

by:jasef
ID: 12295901
Bugger... Too Busy. Hope you catch this anyway... I know you said Windows Proxy, but Smoothwall is very nice, stable and easy peasy to setup as a basic config.  You need a dedicated box. For load balancing try here...
http://community.smoothwall.org/forum/viewtopic.php?t=3365
The implementation is slightly different, but is probably 'portable' (for want of a better word).  I'd try posting a q or two here or at some Smoothwall support forums before doing much though as I may be giving you a bum steer.  But theoretically, you just want to add further alternative routes through the same red interface and have the script sort out the trickys.

PS. Don't worry about the points.
0
 

Author Comment

by:jondanger
ID: 12295940
Jasef,

I'm sticking with the windows solution, it's working really well at the moment.

ADSL.bat
route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.1 METRIC 1 -p
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.2 METRIC 2 -p
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.3 METRIC 3 -p
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.4 METRIC 4 -p
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.5 METRIC 5 -p
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.6 METRIC 6 -p
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.7 METRIC 7 -p
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.8 METRIC 8 -p
netsh interface ip DELETE dns LOCAL ALL
netsh interface ip ADD dns LOCAL 192.168.0.1 index=1
netsh interface ip ADD dns LOCAL 192.168.0.2 index=2
netsh interface ip ADD dns LOCAL 192.168.0.3 index=3
netsh interface ip ADD dns LOCAL 192.168.0.4 index=4
netsh interface ip ADD dns LOCAL 192.168.0.5 index=5
netsh interface ip ADD dns LOCAL 192.168.0.6 index=6
netsh interface ip ADD dns LOCAL 192.168.0.7 index=7
netsh interface ip ADD dns LOCAL 192.168.0.8 index=8
ipconfig /flushdns

and the test script looks like this:

ADSLTEST.bat
del c:\ADSL\jon.txt
ECHO ******************************************************************* >> c:\ADSL\jon.txt
ECHO ******************************************************************* >> c:\ADSL\jon.txt
ECHO [                                                                 ] >> c:\ADSL\jon.txt
ECHO [               Super Network MULTI-ADSL Tester                   ] >> c:\ADSL\jon.txt
ECHO [                        (by Shoulders)                           ] >> c:\ADSL\jon.txt
ECHO [                                                                 ] >> c:\ADSL\jon.txt
ECHO ******************************************************************* >> c:\ADSL\jon.txt
ECHO ******************************************************************* >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt




ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router1 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.1 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt





ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router2 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.2 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt



ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router3 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.3 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt




ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router4 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.4 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt




ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router5 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.5 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt


ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router6 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.6 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt




ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router7 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.7 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt




ECHO  _____________________ >> c:\ADSL\jon.txt
ECHO [   Router8 Status    ] >> c:\ADSL\jon.txt
ECHO  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ >> c:\ADSL\jon.txt

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.8 METRIC 1 -p
PING www.google.com -n 1 >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO ------------------------------------------------------------------------ >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
ECHO. >> c:\ADSL\jon.txt
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

Suggested Solutions

I was recently sitting at a desk at work with one of my colleagues and needed some information on my home computer. He watched as I turned on my home computer, established a remote session into it, got the information I needed and then shut it down …
What is IRC? IRC (Internet Relay Chat) is a form of communication between multiple users. It is available freely to anyone with inernet access. IRC is a great way to communicate with others e.g. There is an IRC channel for Ubuntu Linux, which is fo…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now