0

I want to develop a software, my proper way is JAVA, It sounds simple, but has its own problems. I have a Network in which there are some devices ( about 400 radios or more) I do not know their IP. I just know the first and second part of their MAC addresses. I want to find out their IP and the whole Mac address of all. They are in my network, and i have forgotten their IP, and also MAC. I found this Link useful, but in this solution it is about remote connection to nmap and also you should known the range of IP. Note that this not about HACKING Or better to say is not about CRACKING or something like this, I have thousands of Radio's and they have been reset and need to be re-config. Actually i need their MAC to config more than IP. There are other questions on the net, but they are about having subnet, I do not have subnet of the LAN Network.

Now i am looking for any solution with java or other programming languages, with ARP or dd-wrt something like that, any suggestion? or any solutions? Any sample? I appreciate this. Thx all.

Community
  • 1
  • 1
Alireza
  • 89
  • 2
  • 15
  • Possible duplicate of [How to get a list of IP connected in same network (subnet) using Java](http://stackoverflow.com/questions/3345857/how-to-get-a-list-of-ip-connected-in-same-network-subnet-using-java), [Find all IP addresses in local network](http://stackoverflow.com/q/32500182), [Get All IP and Mac Address in LAN](http://stackoverflow.com/q/35718748) – jww Jan 28 '17 at 14:03
  • If i had sub net or IP, of course i could do that sir. It is not duplicated, I could not find any solution on the net. – Alireza Jan 28 '17 at 14:25
  • And also one of your link is in my question. – Alireza Jan 28 '17 at 14:27
  • You should always know your IP and the IP range because your machine knows its IP address and network mask. If you want to discover devices on another LAN, then you will have to provide the other network. How do you expect a program to guess what network you want to discover? If you visit the cited dups, you will likely find your answer (and learn none of them are this question). – jww Jan 28 '17 at 14:57

1 Answers1

0

If this is your network, inspect ARP tables form network devices. You get all MAC addresses and corresponding IPs. Use SNMP protocol and corresponding libs to get this data form your Java code.

To test this approach use snmpwalk utility.

Dmitry Shilyaev
  • 713
  • 4
  • 10
  • Thx sir, Do you have any link? or any sample? Thx srir – Alireza Jan 29 '17 at 05:58
  • From connected device, run "route -n" and look for Gateway IP. To look what is inside SNMP use Windows tool: https://www.sysaid.com/Sysforums/posts/list/2287.page OR Linux tool: https://linux.die.net/man/1/snmpwalk. After you see necessary data from SNMP, you can use libs like this http://www.snmp4j.org to process it in code. – Dmitry Shilyaev Jan 29 '17 at 07:43