Page 1 of 1 1
Topic Options
#34623 - 2002-12-26 11:34 AM Ip Address
Anonymous
Unregistered


Hi,
Is there option check if the client is on out LAN network address. (10.33.16.0).
Thank you.
Eran.

Top
#34624 - 2002-12-26 02:01 PM Re: Ip Address
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Hi Eranguri,

have you looked at the UDF section?

It has several UDFs for determining of a workstation is in a specific IP range...

All UDF can also be found here: http://www.gwspikval.com/jooel/scripts/UDF_Collection/
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#34625 - 2002-12-26 05:06 PM Re: Ip Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Start in the FAQ forum. Jens has posted several tutorials there that will get you on your way.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34626 - 2002-12-31 12:58 AM Re: Ip Address
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please read the tCP/IP primer in the FAQ Forum under TCP/IP Primer, Part I - IP Addresses
_________________________
There are two types of vessels, submarines and targets.

Top
#34627 - 2002-12-31 08:35 PM Re: Ip Address
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

A script without UDF is
code:
IF (@ipaddress0 = ' 10. 33. 16.  0')
? "user is on LAN 10.33.16.0"
ELSE
? "user has another ip address"
ENDIF

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#34628 - 2003-01-01 08:13 AM Re: Ip Address
Anonymous
Unregistered


Thank you,
Much easy then the UDF.
Eran.

Top
#34629 - 2003-01-01 05:07 PM Re: Ip Address
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Actually, the UDFs are the preferred way. MCA's code just checks whether the IP address is equal to ' 10. 33. 16. 0'. However, this would compare an IP address with a network ID and thus not work.

In order to check whether an IP address is part of a LAN/subnet you MUST compare the IP address to both the network ID AND the subnet mask/bits. This is all explained in detail int he TCP/IP primers referenced above.

MCA's code would work if you would compare the computers IP address to a specific IP.
_________________________
There are two types of vessels, submarines and targets.

Top
#34630 - 2003-01-01 06:36 PM Re: Ip Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
With MCA's code you would need a thousand IF constructs for as many computers.

Don't confuse easy with simple. If you cannot grasp the principles of subnetting you are in the wrong business.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34631 - 2003-01-01 11:12 PM Re: Ip Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Actually, looking at MCA's code further, it can't work. The IP address in the example is the subnet and not the machine IP. @IPAddress0 returns the machine's IP. If wanting to enumerate if a machine is within a class 'C' boundary, the following code could be used.
code:
Break on
IF Left(@ipaddress0,12) = ' 10. 33. 16.'
'User is on LAN segment 10.33.16.0' ?
ELSE
'User has another ip address' ?
ENDIF
get $_

Of course this would only work for a mask of '255.255.255.0' and if one needed to enumerate subnets on other boundaries, then Jen's UDFs would be the logical choice.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34632 - 2003-01-02 12:58 AM Re: Ip Address
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
the main point of a UDF, is that it is precanned...

It isn't too complex, once the UDF is pasted in, it merely acts as any of the other commands that exists in Kixtart.
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#34633 - 2003-01-02 01:02 AM Re: Ip Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Unfortunately there is the fear of the unknown. Newbies take just a peek at it, don't understand it and cry 'sour grapes'.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34634 - 2003-01-02 02:39 AM Re: Ip Address
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Despite the fact that we have a plethora of posts dealing with exactly that, namely making it easy for everybody to use UDFs.

The UDFs are documented the same way as the build-in KiXtart functions are and ample support for UDFs is provided, too.
_________________________
There are two types of vessels, submarines and targets.

Top
#34635 - 2003-01-02 02:52 AM Re: Ip Address
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, just as the built-in functions are documented... there is still an inundation of questions that would not need to be posted if the documentation were read.

I think what it is... aside from the FUD factor, is that people have pre-conceived ideas of what the answer should be. Also, they are likely looking for a one-liner answer and when they see the UDF, it looks too much like work.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34636 - 2003-01-03 05:27 PM Re: Ip Address
Anonymous
Unregistered


Hi guys,
thank you all for the help here.
I just was looking for a easy way to find client IP.
thank you all again,
Eran.

Top
#34637 - 2003-01-06 10:35 AM Re: Ip Address
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

For more addresses we don't need more IF statements.
Another example
code:
IF (Instr("-"+@ipaddress0+"-","- 10. 22. 16.  0- 10. 22. 16. 5- 27. 34.129.  1-") <> 0)
? "found ip-address"
ELSE
? "no member of specified ip-address"
ENDIF

Of course everybody understand that you should search for a shorter version, when
you want to manage a lot of computers. Mostly the way of managing those values is
more complex.
Of course the UDF forum contains hardly any UDF to get any part of your network
configurations. It is a good idea for looking "how other persons has solved some
specific situations".
Of course "10.22.16.0" isn't an ip-address in normal situations. For us it is only
an example. Eran was also talking about ip-address.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


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

Who's Online
0 registered and 823 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.077 seconds in which 0.038 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