1

Is there anyway to find if two different IP address in two different network actually points to the same physical device? I need it in Linux.

Edit -

I have the same server(a raspberry pi) connected via 2 intranets to my client. I don't know the IP address of the server as it is DHCP.

The crude way to do is to reach the raspberry pi from one intranet and check with ifconfig to find the ipadress of the machine in the other Intranet. I want to know if there is any other way I can do it?

I know the mac address of the machine.But I don't know how do I find the Ipadress based on the mac address.

4
  • The MAC address is often also stored, that will give you a good idea. What type of setup do you have? Jun 5, 2014 at 0:08
  • ifconfig or ipconfig usually spit out the configuration of every NIC on your machine, which should give you what you're looking for. Without being more clear about your situation, there's not much else I can say.
    – Pockets
    Jun 5, 2014 at 0:10
  • Is arp -a what you're looking for?...
    – Pockets
    Jun 5, 2014 at 0:36
  • do arp -a from the raspberry pi?? No. My raspberry pi and my PC are connected to each other via two links. Hence I can reach the raspberry pi in two ways. I need to know both the ways before I ssh on to it. I know its mac address.
    – Vivek V K
    Jun 5, 2014 at 0:42

2 Answers 2

1

Install Zenmap (used to be known as Nmap) and run a network scan on the network (as opposed to the host) address. This will actually report for every candidate ip in the network. So, you will actually be able to see if the Mac address is on the network at all. Zenmap has a package for many of the common Linux distros so just follow the install guide (http://nmap.org/book/install.html) and go from there.

An example command could look like: nmap -T4 -A -v 192.168.2.0/27

Also, please note that this tool will give you a lot of power to do a lot of things that not every network's user agreement will allow. I recommend making sure you understand what is happening before you do it.

1
  • Sounds promising. will try that.
    – Vivek V K
    Jun 5, 2014 at 0:53
1

Probably there are many ways to do this.

Since you have access to the raspberry, the following command

 ssh me@myraspberry 'ip addr show dev NIC2'

will execute the command between apices on the raspberry without opening an ssh shell. You should use it to connect via NIC1 of which you know the IP address, in order to show the IP address of the other NIC.

Or assuming you do not know the IP address of the first NIC, but you do know the MAC addresses of both NICs, you can use nmap on the command line:

 sudo nmap -sn 192.168.1.0/24

This executes a ping scan on your local network (way way faster than suggested in another answer), which prints the ip address associated to each MAC address, like this:

  # nmap -sn 192.168.1.0/24

 Starting Nmap 6.40 ( http://nmap.org ) at 2014-06-05 03:41 CEST
 Nmap scan report for mobilewifi.home (192.168.1.1)
 Host is up (0.0065s latency).
 MAC Address: 24:DB:AC:D5:B2:AC (Shenzhen Huawei Communication Technologies Co.)
 Nmap scan report for 192.168.1.100
 Host is up (0.010s latency).
 MAC Address: C4:85:08:7D:79:40 (Intel Corporate)
 Nmap scan report for 192.168.1.102
 Host is up (0.14s latency).
 MAC Address: 00:07:88:E8:6C:CF (Clipcomm)
 Nmap scan report for 192.168.1.101
 Host is up.
 Nmap done: 256 IP addresses (4 hosts up) scanned in 2.23 seconds

knowing the MAC addresses of the two NICs, now you can find their IP address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .