PC Review


Reply
Thread Tools Rate Thread

CMAK 1.3 Route Add

 
 
=?Utf-8?B?SmFja3Nvbg==?=
Guest
Posts: n/a
 
      11th May 2006
I am trying to use CMAK to add some routes when a PPTP connection is
established. Is it possible (and how) to specify the VPN IP or interface in
the CMAK script as the gateway if I dont know beforehand what that IP will
be? I have tried using the "DEFAULT" variable as described in the help file
but this uses the client PC's default gateway and not the VPN address
recieved. I am unable to use the A/D add status route option in this
situation so I must use CMAK. Also I cannot use the "Use default gateway"
option either. Can this be done.

Example:

I want to add the following route after VPN established

10.37.102.0 mask 255.255.255.0 (VPN IP)

to force traffic to this subnet over the VPN.
 
Reply With Quote
 
 
 
 
David
Guest
Posts: n/a
 
      11th May 2006
Hi,

I think I had the same issue as you last week or so. You want internet
traffic to go from the VPN client directly to the internet, not through the
VPN first, but you also want one or more network ranges to go through the
VPN?

Add this .vbs script to the profile

'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0
'
' NAME: VPN IP - gateway 2 network
'
' AUTHOR:
' DATE : 5/05/2006
'
' COMMENT: possible trouble when you are connected to 2 or more VPN server
at the same time
' as there will be multiple adapters named "WAN (PPP/SLIP) Interface" !
'
'==========================================================================
Dim WshShell, IP
Set WshShell = Createobject("WScript.shell")

strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
& strComputer & "\root\cimv2")

Set IPConfigSet = objWMIService.ExecQuery("Select * from
Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")

For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
If ipconfig.description = "WAN (PPP/SLIP) Interface" then
IP = ipconfig.ipaddress(i)
Set oShell = CreateObject("WScript.Shell")
iRC = oShell.Run("route add 10.37.102.0 MASK 255.255.255.0 " &
IP, 0, True)
End If
Next
End If
Next

' <== End script ==>



Can you let me know if it worked?


regards,

David


"Jackson" <(E-Mail Removed)> wrote in message
news:4A8CFA0A-46D2-436B-93E3-(E-Mail Removed)...
>I am trying to use CMAK to add some routes when a PPTP connection is
> established. Is it possible (and how) to specify the VPN IP or interface
> in
> the CMAK script as the gateway if I dont know beforehand what that IP will
> be? I have tried using the "DEFAULT" variable as described in the help
> file
> but this uses the client PC's default gateway and not the VPN address
> recieved. I am unable to use the A/D add status route option in this
> situation so I must use CMAK. Also I cannot use the "Use default gateway"
> option either. Can this be done.
>
> Example:
>
> I want to add the following route after VPN established
>
> 10.37.102.0 mask 255.255.255.0 (VPN IP)
>
> to force traffic to this subnet over the VPN.



 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmFja3Nvbg==?=
Guest
Posts: n/a
 
      11th May 2006
Thanks David,

After posting I figured out what I was doing wrong. To add routes with
CMAK like we want to do it, one needs to turn on the "use gateway on remote
network" option in the profile and then use the "REMOVE_GATEWAY" option in
your route script file. Otherwise CMAK uses the original PC's gateway for
your specified routes gateway. Your solution also does what I was l was
needing. I may have to use it afterall due to some permissions issues. If I
wind up using it Ill let you know if it works for us too.

"David" wrote:

> Hi,
>
> I think I had the same issue as you last week or so. You want internet
> traffic to go from the VPN client directly to the internet, not through the
> VPN first, but you also want one or more network ranges to go through the
> VPN?
>
> Add this .vbs script to the profile
>
> '==========================================================================
> '
> ' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0
> '
> ' NAME: VPN IP - gateway 2 network
> '
> ' AUTHOR:
> ' DATE : 5/05/2006
> '
> ' COMMENT: possible trouble when you are connected to 2 or more VPN server
> at the same time
> ' as there will be multiple adapters named "WAN (PPP/SLIP) Interface" !
> '
> '==========================================================================
> Dim WshShell, IP
> Set WshShell = Createobject("WScript.shell")
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
> & strComputer & "\root\cimv2")
>
> Set IPConfigSet = objWMIService.ExecQuery("Select * from
> Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
>
> For Each IPConfig in IPConfigSet
> If Not IsNull(IPConfig.IPAddress) Then
> For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
> If ipconfig.description = "WAN (PPP/SLIP) Interface" then
> IP = ipconfig.ipaddress(i)
> Set oShell = CreateObject("WScript.Shell")
> iRC = oShell.Run("route add 10.37.102.0 MASK 255.255.255.0 " &
> IP, 0, True)
> End If
> Next
> End If
> Next
>
> ' <== End script ==>
>
>
>
> Can you let me know if it worked?
>
>
> regards,
>
> David
>
>
> "Jackson" <(E-Mail Removed)> wrote in message
> news:4A8CFA0A-46D2-436B-93E3-(E-Mail Removed)...
> >I am trying to use CMAK to add some routes when a PPTP connection is
> > established. Is it possible (and how) to specify the VPN IP or interface
> > in
> > the CMAK script as the gateway if I dont know beforehand what that IP will
> > be? I have tried using the "DEFAULT" variable as described in the help
> > file
> > but this uses the client PC's default gateway and not the VPN address
> > recieved. I am unable to use the A/D add status route option in this
> > situation so I must use CMAK. Also I cannot use the "Use default gateway"
> > option either. Can this be done.
> >
> > Example:
> >
> > I want to add the following route after VPN established
> >
> > 10.37.102.0 mask 255.255.255.0 (VPN IP)
> >
> > to force traffic to this subnet over the VPN.

>
>
>

 
Reply With Quote
 
Bill Stewart
Guest
Posts: n/a
 
      16th May 2006
Jackson wrote:

> After posting I figured out what I was doing wrong. To add routes with
> CMAK like we want to do it, one needs to turn on the "use gateway on remote
> network" option in the profile and then use the "REMOVE_GATEWAY" option in
> your route script file. Otherwise CMAK uses the original PC's gateway for
> your specified routes gateway. Your solution also does what I was l was
> needing. I may have to use it afterall due to some permissions issues. If I
> wind up using it Ill let you know if it works for us too.


Just FYI, neither the CMAK solution nor the route add command will work
if the user logging onto the client system is not a member of the local
Administrators group on the machine.

There appears to be a DHCP scope option that is supposed to hand out
options only to RRAS clients, but I haven't yet been able to get it to work.

--
Bill Stewart
 
Reply With Quote
 
=?Utf-8?B?V2lsbG93MzE2?=
Guest
Posts: n/a
 
      1st Nov 2006
could any of you guys tell me why my Proxy settings from a txt file are not
being implemented into the proxy settings on the VPN connection?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I allow non-admin user add a route to route table? =?Utf-8?B?amluc2h1YW5n?= Windows XP Security 2 27th Jul 2007 01:58 AM
how to delete duplicate file example route 2_2:1 or route 2_2:2 =?Utf-8?B?UGF1bA==?= Microsoft Excel Misc 5 8th Oct 2006 07:49 PM
When set to route, route with on open worksheet...not the hidden o =?Utf-8?B?TWlrZSBSLg==?= Microsoft Excel Programming 0 20th Dec 2004 04:13 AM
How to save Static Route via command line 'route' Jason Morrill Microsoft Windows 2000 Advanced Server 2 16th Oct 2004 10:12 PM
How to use CMAK to add route with PPTP IP Mostafa Microsoft Windows 2000 RAS Routing 0 12th May 2004 12:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:20 AM.