Detect Gateway IP address in windows
RGould8 at aol.com
RGould8 at aol.com
Mon Oct 11 13:39:40 EDT 2004
why do you need to know the gateway address ?
or, if you prefer, what do you want to use it for ?
I need to know the gateway address because I'm writing software to configure
routers for use over fiber-optic systems for an ISP. In order to do the
configuration, I take the gateway address and add some info to the end of it and
perform GETS and POSTS to that particular URL. For Mac, I use:
put shell("/usr/sbin/netstat -r -n | grep default | awk '{print $2}'")
into GatewayIP
In a message dated 10/8/04 8:53:54 PM, alex at tweedly.net writes:
> I tried not to ask - but I can't help myself .....
>
> why do you need to know the gateway address ?
> or, if you prefer, what do you want to use it for ?
>
> There have been a few suggested ways to find i tout (and there are a couple
> of others, probably even less "perfect"); knowing what you want to use it
> for would help to give you the best answer (or at least to point out the
> constraints and difficulties with each particular way).
>
> Note that in the right circumstances, it's possible to have a machine
> connected to, and able to talk to, the Internet with :
> - no gateway address
> - a gateway address which is not used to reach the internet
> - a gateway address which is not reachable from the Internet, even though
> the machine itself is able to talk to the 'net
> - a gateway address which does not represent a host (i.e. you can't
> communicate with it)
> - multiple gateways, each used for different parts of the net
>
> On principle, I'd say you should try not to need to know this info :-)
>
> -- Alex.
>
More information about the use-livecode
mailing list