CMAK 1.3 Route Add

G

Guest

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.
 
D

David

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
 
G

Guest

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.
 
B

Bill Stewart

Jackson said:
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.
 
G

Guest

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?
 

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