Page 1 of 1 1
Topic Options
#57902 - 2001-08-03 12:13 AM VPn
Anonymous
Unregistered


Hi,
How I can do to detect a VPN connection by KIX?? Do you have any idea?? Regards and thanks in advance

Top
#57903 - 2001-08-03 05:07 PM Re: VPn
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
hi Matias!

One way that I can think of is running an "ipconfig /all", and piping it into a textfile (and from the script open it, and search), or alternatively pipe it to a "find" command and look for the presence of "NdisWan Adapter", which is the virtual VPN adapter. Example:

code:
SHELL '%COMSPEC% /C ipconfig /all |find /i "NdisWan" >nul' 

the KiX @ERROR level will then tell you if the string was found or not.

Another is to check for IP addresses with the help of the macro @IPADDRESSx, where "x" is the number of the card or virtual adapter, check the KiXtart documentation for more help on this. In most cases, VPN users will be assigned specific IP addresses. To check the different octets, you can use this code:

code:
 $TCPIP = @IPADDRESS1
$1octet = VAL(SUBSTR($TCPIP,1,3))
$2octet = VAL(SUBSTR($TCPIP,5,3))
$3octet = VAL(SUBSTR($TCPIP,9,3))
$4octet = VAL(SUBSTR($TCPIP,13,3))

As you can see, i've chosen adapter 2 here (adapter 0 is normally your NIC).

Also, do a search on the forum, I bet you'll find alot of useful things.

[ 03 August 2001: Message edited by: masken ]

_________________________
The tart is out there

Top
#57904 - 2001-08-03 05:20 PM Re: VPn
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
masken,

I wonder if a simple :

code:

if @ras
"Ok, Lady, Gentleman or Thing : You're connected via VPN !"
endif

would do also

hth

Jochen

[Sorry for that screen output , today I'm in a 'je ne sais quoi' - mood ]

[ 03 August 2001: Message edited by: jpols ]

_________________________



Top
#57905 - 2001-08-03 05:31 PM Re: VPn
Anonymous
Unregistered


If you are connecting to a PPTP server is the same to be connecting a RAS server? Doesn't Kix differ between a connection and another? Thanks
Top
#57906 - 2001-08-03 05:47 PM Re: VPn
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Matias,

think that's something you should test ...
(I really dunno !)

Luck !

Jochen


btw.: let the board know what the results are ... this is really a FAQ and it's time for a reference topic

[ 03 August 2001: Message edited by: jpols ]

_________________________



Top
#57907 - 2001-08-03 06:15 PM Re: VPn
Anonymous
Unregistered


this is big chalenges, I will
Top
#57908 - 2001-08-06 09:47 AM Re: VPn
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
jpols, as Matias also mentions, I am myself unsure of what @RAS does exactly... therefore I chose another path
_________________________
The tart is out there

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.062 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org