简体   繁体   中英

Can anyone tell how to get MAC address of all system in LAN

i am doing my 8th Sem project, one of the module of the project is to find all MAC address of System which are connected in the LAN & store them in a file...

please let me know whether i can do it or not....

i want a JAVA Code to do the this thing, or anyone can give me some hints to do this

all are welcome to comment on this & support me....

Thank you.

With pure Java it is impossible. You could execute " arp " thru Runtime.execute() and parse the output.

  1. ping/connect all machines in subnet (like nmap -sP )
  2. read the system arp table (arp -n)
  3. store them in the file

Use Nmap and Nmap4j and you should be good to go.

nmap4j.sourceforge.net is a Java API that wraps Nmap. Nmap is a port scanner that would be able to give you MAC address and OS information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM