How do I determine what ip range a device is using?
<p>This is kind of a weird problem, basically I have a computer connected to a machine via ethernet cable. There is no other network or internet access. The machine sets up a network which allows you to telnet into it. </p>

<p>I need the simplest way possible to determine the ip range the device is using. This would be turned into a python script. It is not just the obvious 192.168.x.x</p>

<p>I'm looking at the 'arp' command, but also a library called 'netifaces'. I'm not sure if there's something simpler I could use. It has to work for Linux, OSX and Windows. The machine is running an android OS</p>

<p>Basically, I just need to be able to determine what ip ranges the device is currently using in the simplest possible way. </p>

<p>The command 'arp -a' seems to be the most promising right now. </p>

<p>The IPv4 Link-Local range of <code>169.254.0.0/16</code> is used by APIPA for hosts to assign IP addresses when an interface has no other way to obtain an address. There are some rules about this range, e.g. you cannot subnet the range, it can't be routed, etc. See <a href="https://tools.ietf.org/html/rfc3927" rel="nofollow">RFC 3927, Dynamic Configuration of IPv4 Link-Local Addresses</a> for more information.</p>

<p>You really need to determine if the equipment on the other end of your link is using this range. If it is a specialized device, it probably does not, and it will have a fixed address which was manually assigned. If this is the case, you will not be able contact it with your Link-Local address.</p>

python networking