in reply to verify presence in a given network

The internal IP address of the main router (Gateway to the Internet) is usually very stable, and always available.

Inside a campus/building, the number of routing hops to that router is usually very small .. typically less than 3.

You could send a "ping" to that address and check if it is found in 2 hops or less, to verify internal reachability.

? Of course, this can be spoofed, if the user knows what the code is looking for.

A more secure way would be to establish a server on the network, and require login , or canned credentials to be retrieved from the server before processing.

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

Replies are listed 'Best First'.
Re^2: verify presence in a given network
by RichardK (Parson) on Apr 09, 2014 at 15:23 UTC

    The gateway IP address might be stable, but it's _nowhere_ near unique, just think about home routers -- all instances of any model default to the same IP address and are installed in thousands of locations.

    There's just no reliable way to do this at the network level, it wasn't designed to do that, you need some sort of licence server. (yuk!).