[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2004-10-07
3
Medium Priority
?
563 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 1500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Make the most of your online learning experience.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

649 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