Solved

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

Posted on 2004-10-07
3
559 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

689 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