VPN and XP SP2 woes

D

Dave Wisel

Try this. Create a "NEW" VPN connection and call it "Work". Make
sure that the connection type is set to "PPTP VPN" on the Networking
tab and then uncheck the "Use Default Gateway on Remote Network" box.
Save this script as a batch file:

Rem ------Begin--------
@echo off

rasdial Work
ping 1.1.1.1 -n 10 -w 1000 > NUL
route delete 10.0.0.0
for /f "tokens=15" %%a in ('ipconfig ^| find "IP Add" ^| find
"10.1.29"') do route ADD 10.0.0.0 MASK 255.0.0.0 %%a
Rem -------End----------

This script will dial the RAS connection, wait a couple seconds and
then run an ipconfig and find your RRAS assigned IP address then add
the appropriate route.

BTW, I have found that using a PPTP connection that was created before
SP2 was installed gives sporatic behavior. It's best to delete any
old PPTP connections and start fresh.

Hope this works for you.
 
J

Jonathan Duke

Sue, did you try:
route add 10.0.0.0 mask 255.0.0.0 10.1.your.ip

The way I found the correct route for mine was that since
the route changes after about 10 seconds, I just ran a
route print immediately after connecting and then another
route print 30 seconds later and looked at what line was
different. Note that all of this is with the "use
default gateway" box UNchecked on the VPN properties.
 
J

Jonathan Duke

Thanks Dave. After a little modification to match my IP
settings, it worked fine for me. I was going to make a
separate script using JScript to parse the IP out with a
regular expression, but that "for" command is a lot
simpler!
 
S

Sue Morton

Hello Dave,

Thanks for this script! I did have to change it to have 3 'for' loops, as
our VPN IP's can be 10.1.29.x, 10.1.31.x and 10.1.33.x. (Is there a better
way than 3 'for' loops?)

My ignorance is obvious, so I hope you won't mind a dumb question: After
using this script, when I use OE and ask it to synchronize all my accounts
(one IMAP email account and three newsgroup accounts), OE consistently uses
my local area connection for each of the newsgroup accounts, but uses the
VPN connection for the IMAP account.

Any idea why that would be? It just happens that I can do both IMAP and
newsgroup connections on my employer's network, so even if both went over
VPN it wouldn't matter to me, but I am curious why OE consistently chooses
one of each, and whether I can cause OE to choose local area connection for
IMAP too (besides hard-coding OE in Tools -> Options ->Connection).

If it is easy to 'splain to a newbie I'm very interested. :) Thanks again
for all your time.
 
S

Sue Morton

No I didn't until Dave's script. I am testing now and it does seem to be
working better than what I had chosen.

My route print doesn't change like yours does, after I'm connected... I
wonder why that is? (Yours changing or mine not.)

Thanks very much for your help.
 
S

Shaun McCarthy

Regarding adding your own route entry - this doesn't work if your
local network has a similar network as your remote network (such as
local network being 10.x.x.x and remote network being 10.10.x.x). You
typically end up with an error like:

C:\>route add 10.10.10.0 MASK 255.255.255.0 10.10.1.128
The route addition failed: The parameter is incorrect.

Fortunately, the route command allows you to specify the appropriate
interface (in a non trivial way):

If you go ROUTE PRINT it will return your current routing table. By
looking at the interface list, you should see an entry along the
lines:

0x220004 ...00 53 45 00 00 00 ...... WAN (PPP/SLIP) Interface

If you take that number to the left (0x220004) and convert into
decimal from hex (use the windows calculator :) ) you get your
interface number (in this case it's 2228228). You can then add the
route with the following command:

route add 10.10.10.0 MASK 255.255.255.0 10.10.1.128 IF 2228228

Hope this helps anyone who was stuck :)

Shaun McCarthy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top