Copy a persistant route table between two servers

Hi Guys,

We are currently moving to a new monitoring system - and seeing as we have environments all over the world to monitor, we use many servers for this task - unfortunately, the servers that are running the current system can't work with the new one becuase of many reasons but there's one piece of very valuable information on each of them that copying by hand would take ages!

Many of the enviroments we monitor are connected via IPSEC tunnels and as such we need to instruct the server to send the ICMP / SNMP packets through the correct gateway to reach it's destination.

The question is, assuming I have two servers with the following configuration:Server A (Source): Windows Server 2003 R2
Server B: (Destination): Windows Server 2008 (NOT R2)

can I somehow copy all the persistant routes from the source server to the destination server in an auomated / scripted process?



If it is only one route then it is a very easy job. What you need to do is the following:
1. Create AD group and add computers to which you want to add the routes to
2. Create a computer logon GPO to add the route via a batch file
3. Apply the GPO to you domain level and apply it only to the group created in step one

The script file will look something like this:
route add -p x.x.x.x mask a.a.a.a y.y.y.y

x.x.x.x is the target, a.a.a.a is the subnet and y.y.y.y is the gateway



If it is only one route then it is a very easy job. What you need to do is the following:
1. Create AD group and add computers to which you want to add the routes to
2. Create a computer logon GPO to add the route via a batch file
3. Apply the GPO to you domain level and apply it only to the group created in step one

The script file will look something like this:
route add -p x.x.x.x mask a.a.a.a y.y.y.y

x.x.x.x is the target, a.a.a.a is the subnet and y.y.y.y is the gateway



A simple method is to use PowerShell to generate and execute the route.exe commands, e.g. on the new server:



Thanks, I'll try it when I'm back at office and let you know.
One thing though... the computers are not in a domain - neither of them - so I can't really use "-ComputerName Win2003-PC" will it accept an IP address instead?



Yes, and you will have to use-Credentials and supply account info if different.



Share this

Related Posts

There was an error in this gadget