Adding routes to a Windows PPTP VPN

Lifted

Diamond Member
Nov 30, 2004
5,748
2
0
I have several PPTP VPN's and would like to have routes given to the clients when they dial in. I am currently, for myself, adding the routes by hand whenever I dail in.

The only way I have come up with to do this is to write a batch file that looks for the interface name, since it changes every time a user connects, and then adds the routes to that interface. I'd like to manage this from the RRAS server for obvious reasons, but have not been able to find a solution.

The network looks like this:

The RRAS server is on 192.168.30.0 network. It is connected to the 192.168.31.0 network via a router. When clients dial in, they are given an IP in the 30.0 network, and I want them to receive routes to the 31.0 network. I am currently adding the route

route add 192.168.31.0 MASK 255.255.255.0 192.168.30.25 metric 1

192.168.30.25 is the address given to me via DHCP (it's always different) on the RRAS server, and is what I set as the gateway on my local computer for that route. I could also use the interface name, but that changes each time as well.

Any help would be GREATLY appreciated.
 

EatSpam

Diamond Member
May 1, 2005
6,423
0
0
On the router for the 192.168.30.0 network, add a route to the 192.168.31.0 network. This way when your PPTP client sends a packet for the 31 network, it'll be sent to the 30 router and then routed to 192.168.30.25 and onto the 192.168.31.0 network. You probably will have to add a return route on the router for the 31 network.

Don't use DHCP and wierd config files to do a routers job.
 

Lifted

Diamond Member
Nov 30, 2004
5,748
2
0
Hi EatSpam,

30.0 and 31.0 have routes for eachother. The problem I'm having is getting the 31.0 route on the dial-in computer. If I add the route to the dial-in computer myself, everything works fine. But by default when I connect, I only receive routes for 30.0 so my computer sends the 31.0 request to the default gateway, which is the internet connection, and obviously there are no 192.168 computers out there. :)

I think I might have made that first post too confusing trying to explain everything.

 

EatSpam

Diamond Member
May 1, 2005
6,423
0
0
Your computers/VPN clients/whoever should only need a default gateway.

Your internet router should have a route on it to the 31 network. I think that's the missing link.
 

Lifted

Diamond Member
Nov 30, 2004
5,748
2
0
I am dialing in from a home computer, as are the other users, so it's not that easy/practical to modify routes using everyones routers. It's much easier to set the routes on the users windows XP boxes using the "route add" command, but I would like to make it even easier by having the routes placed on their computer, the same way the 30.0 route is, when they dial in. When I create the dial up connection using windows, there is no way to specify other routes to be added once connected, so I was thinking I could have the routes added to the dial-in clients by the RRAS server.
 

EatSpam

Diamond Member
May 1, 2005
6,423
0
0
Oh, ok, I think I understand at little better. When I say to add routes, I'm talking about at the location where the RRAS server is.

Is there a default route for the 192.168.30.0 network? What does the RRAS server use?
 

Lifted

Diamond Member
Nov 30, 2004
5,748
2
0
When I dial up, I am given routes on my computer for the 192.168.30.0 network.

This is from a route print on my PC:

192.168.30.0 255.255.255.0 192.168.30.12 192.168.30.12 1
192.168.30.12 255.255.255.255 127.0.0.1 127.0.0.1 50
192.168.30.255 255.255.255.255 192.168.30.12 192.168.30.12 50

I tried adding 192.168.31.0 to the static routes section of RRAS, but it does not add the routes on my computer when I connect. I don't know where the option exisits (or if it exists), on the RRAS server, to have more route added onto my computer after the connection is made.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
is there a script option? You could also just make the users run a batch file, if you add -p to the route add statement its persistant across reboots.

 

Lifted

Diamond Member
Nov 30, 2004
5,748
2
0
Originally posted by: nweaver
is there a script option? You could also just make the users run a batch file, if you add -p to the route add statement its persistant across reboots.

I'm back to the problem of creating a batch file which looks up the interface first, as the interface name and the ip address are different each time a user dials in. Writing that batch file is not going to be easy.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
check your DHCP server again, usually there is an option for routes, and you could also try the router option. Can't remember, been a while...
 

Lifted

Diamond Member
Nov 30, 2004
5,748
2
0
Originally posted by: nweaver
check your DHCP server again, usually there is an option for routes, and you could also try the router option. Can't remember, been a while...

didn't think of that. thanks.