changing static routes on multiple windows pc's remotely.

jondanger
jondanger used Ask the Experts™
on
I have a lan with 10 windows xp machines and 4 adsl routers.  If an adsl router goes down (like they occasionally do) i have to run round to each machine and manually change the route.

quickest way i've found for this is:
start -> run -> cmd
route change 0.0.0.0 mask 0.0.0.0 192.168.1.x

I've simplified this with a VB application, but it still involves physically going to each pc.

My question is, can this be done remotely?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
How do you have the network setup?  Are all the PCs pointing to all the DSL routers? If all IP addresses are static, why do you have to change them after the router reboots?
Ciprian LozonschiOps Team Office 365/Messaging

Commented:
I think with a script (bat or vbs) putted in a share on the network you cand resolve this.

Author

Commented:
i can't have all routers on all machines as there's some software running on those machines that gets confused if their's more than one static route.

The routers aren't generally the problem, it's the copper lines the adsl runs over, that and unavoidable ISP problems.

Yes i started with a .bat file, then that evolved into the VB app.  I have no way of invoking this manually though.  How could a bat or vbs file help?
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Commented:
Are the PCs and routers interconnected using a single switch, or are the PCs connected directly to the LAN ports on the routers?  

Could you setup 1 PC to share the internet connection and then configure multiple default routes on that PC (all the other PC would point to 1 PC for web access)?
Ciprian LozonschiOps Team Office 365/Messaging

Commented:
Well my first ideea was to put users to execute a vbs script when an adsl router goes down. This could be a solution to your problem
But I remebered that exist PsExec (http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx). Try to see if this tool would help you
Keith AlabasterEnterprise Architect
Top Expert 2008

Commented:
The batch file approach is the simplest. Create a batch file for each adsl router to become the default gateway

create adsl1.bat
route change 0.0.0.0 mask 0.0.0.0 192.168.1.1

create adsl2.bat
route change 0.0.0.0 mask 0.0.0.0 192.168.1.2
etc, one for each router

Put each of the four batch files on a share that all users can see or even drop them onto each desktop. The users can then double click any of the four batch files to select an alternative default gateway.


Author

Commented:
Imagine there's only one user, ie me.

Please stick to the original question, how do i change static routes on windows xp machines remotely?
Keith AlabasterEnterprise Architect
Top Expert 2008

Commented:
Sorry, silly of me not to be psychic.

Enable each machine to accept remote desktop connections
RDP onto each box in turn

Commented:
You have to setup Remote Access on each PC so you can use the Remote Desktop feature.  You'll still have to RDP into each machine to do this remotely.  You'd also need at least 1 static public IP address.
Keith AlabasterEnterprise Architect
Top Expert 2008

Commented:
Only needs an external ip if the internet or something else is between the 'one person' and the other machines. If they are all local to each other then it would be fine. Could do the same with vnc etc as well.
Most Valuable Expert 2011
Top Expert 2011
Commented:
psexec @c:\pcnames.txt -d -u domain\USER -p PASSWORD route change 0.0.0.0 mask 0.0.0.0 192.168.1.x

Use psexec as stated above, and all you will need is a flat file of all pc names in the environment.....If you have admin rights to the machines, you wont need the -u and -p.....


-d makes it not wait for the command to finish on the target, befgore going onto the next one....

All you do is launch it once, and it will comlete the rest of the machines.....
Keith AlabasterEnterprise Architect
Top Expert 2008

Commented:
Hmmm. Neat

Author

Commented:
JohnB: thanks, exactly what i was looking for, i knew their must be a way :)

keith: sorry for being a bit short.
Most Valuable Expert 2011
Top Expert 2011

Commented:
It took me a while to realize that you could run full commands with switches, and not need the qoutes.....  

:^)
Keith AlabasterEnterprise Architect
Top Expert 2008

Commented:
No problem. We all have moments where we get a bit short. Glad its resolved.

Keith

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial