[Techtalk] Program to determine IPs used in a network

Daniel Pittman daniel at rimspace.net
Sun Jun 21 02:46:29 UTC 2009


Michael Fisher <desnotes at gmail.com> writes:

> I am setting up an Digi XBee wireless network for home automation use. It is
> a cool system with several sensors measuring temperature, humidity, light,
> electricity, etc. and then logs the information for presentation (i.e. web,
> database). The system, from the coordinator on down, uses Python so in
> theory, it should be OS neutral. Currently the system instructions are all
> written for Windows. I am going through all parts of the startup and looking
> to find Linux versions of Window's tools that are in use.
>
> The first Digi tool that is Windows-centric is a program that determines the
> IP address the gateway uses. What I am looking for is a package that
> analyzes a network and lets me know the who, what and where in regards to IP
> addresses on a local network. Anyone have any ideas?

First, it isn't a safe assumption that there is *A* gateway, since you can
have multiple default routes.  In fact, I presently do, one over wireless and
one over wired, with different metrics.[1]

Anyway, the easiest path is:

    ip route list match 0.0.0.0

Run that on any given machine and you are good to go: it tells you the default
route currently established, along the lines of:

    ] ip route list match 0.0.0.0
    default via 172.16.23.1 dev eth0  proto static
    # elided for simplicity on the standard one-default-route network

Regards,
        Daniel

Footnotes: 
[1]  Only one is used at a given time, of course.



More information about the Techtalk mailing list