Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I distinguish if two IPs belong to the same computer?

We have a master program and agents (both) on the customer side on different computers. The network configuration can be any type (we don't know). The agents connect to the master program and currently we only can get the IP and computer name as information. How do I distinguish if two IPs belong to the same computer?

Computers may have more than one ethernet cards.

Thanks.

like image 956
Charlie Brown Avatar asked Aug 31 '25 20:08

Charlie Brown


2 Answers

There is no way to tell just by looking at the IP addresses.

Some computers have unique identifiers, but you would need JNI to access them and your code would be very platform-specific. It might be a better idea to generate a GUID and write it to a file in a temp folder on the machine. Then, all instances of the software that run on that machine would read the same GUID and can provide this data to the server when a connection is made.

like image 73
Erick Robertson Avatar answered Sep 03 '25 11:09

Erick Robertson


You can modify the agents to send the MAC(s) of the machines in question. Beyond that, you can't really determine if they are the same.

like image 43
sarumont Avatar answered Sep 03 '25 11:09

sarumont