Link to home
Start Free TrialLog in
Avatar of ndombko1
ndombko1

asked on

Adding routes via GPO or GPO script

Hi,

I have tried everything to added static routes to a few machines, but failed.  I've tried adding a script via startup GPO, the login script, and adding a registry GPO. I have no idea what could be the issue.  Can anyone help?

Thx
Avatar of arnold
arnold
Flag of United States of America image

What are you trying to add?on startup, the script needs to tun only after network is up.
Routes can be pushed by DHCP server.
You can add the routes to be persistent.

You have to use powershell or vbscript to first determine what the IP of the system is. Then adding the routes should be straight forward.
You can not add a route without the IP.
Avatar of ndombko1
ndombko1

ASKER

For some reason nothing is working so I'm emailing the clients the script and having them run it.  The problem is I need to set the batch file up so that it runs as an admin does anyone know how to do that?
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So I'm trying to add routes to several machines on my domain. The reason why I'm doing this is because they access another company that uses these routes. They cannot have admin rights, per the company that they connect to for security reasons. I have added a client to the Network Configuration group, without success.  These clients are on both win 7 and win xp. My domain is currently running Server 2008.  The GPO is successfully pushed but does not add the routes.
You can add routes using the DHCP option for routes. 129 or 121 do not recall for certain.
Alternatively you can add the route on the router.
I.e. any traffic going to X send through Y and have it controlled in a single location,
I cannot add it to the router, because it looks a the route table first.
It is not clear what your situation is.
Do the system have two network cards? If not, the routes you are adding must exit through the default route.
If this is a VPN related routed, you would need to configure the routing adjustments as part of the VPN establishment scheme I.e. either you properly configure the VPN server to push the relevant routes, or you configure the VPN client to run a script that will add routes after the VPN connection is established.

You can not add a route referencing an IP that is not on the system.

Can you provide an example of what the situationis and what it is you want.  Not sure why you can not make the adjustment on the router which will apply to all systems uniform ally given all requests from clients to apps outside the local segment end up on the router as the default gateway.

Your LAN IPs are 192.168.0.0/24

You have some IP range somewhere that is 172.16.0.0/24

Now you want to add a route for this range to the workstation.
Route add 172.16.0.0 mask 255.255.255.0 IP1
IP1 is where the issue is, do you want it to route to 192.168.0.23 which is some sort of a router

Setting up a static route or a dynamic route that is reached between the default router and this one for 172.16.0.0/24 to be sent from the man/primary router to the secondary one.
These routes that are being added are for a VPN.  However, the problem is not connecting to the VPN. The problem lies on adding the routes to the machines via GPO's.  I cannot even add the routes to my table and I have admin rights to my machine. I can run a gpresult /r and see that the GPO was applied to my machine.  However, the persistent routes were not added. If someone can help me I will give them tons of points.
What is the routing entry that you are trying to add?
Does the IP that you are usng in the route add directive exist on the system?
For VPN, the route should be pushed by the VPN server.