comparing two IP addresses and the underlying machine

Tim Chase python.list at tim.thechases.com
Tue Dec 12 09:44:16 EST 2006


 > I've been trying to figure this one out for some time but
 > with no success.  I have a machine with two network
 > interfaces, each with their own IP address and it's own
 > domain, for example:
 > - ipA on machineA.domainA
 > - ipB on machineB.domainB
 >
 > Given any pair of IPs or hostnames (or a mix of them), how
 > can I figure whether they belong to the same physical
 > machine or not? Of course, this is trivial if my python
 > program is running the given machine but what if a remote
 > machine is trying to figure this out (but that machine has
 > access to both domains/IPs).
 > Appreciate and ideas.


I have a feeling that you're trying to attempt the
impossible.  What do you mean by "the same physical
machine"?  The same case?  What happens if there are two
virtual OSes on the machine, each using its own NIC?

Unless you have a client application running on "the
physical machine" that can respond to queries on each NIC,
you're pretty much out of luck.  You could write something
like a "same_ping" program that would listen on both NICs,
and respond with a "yeah, I'm the same machine"
confirmation.  There are all sorts of ways to do this,
depending on how sure you need to be that nobody can spoof
it...ranging from simple "here's a random number on one IP
address followed by asking the other IP if it's seen that
random number before" to having the physical machine sign
one request on each port and confirm that their signatures
are the same.

-tkc







More information about the Python-list mailing list