Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hardware address client

Posted on 2010-09-03
4
Medium Priority
?
446 Views
Last Modified: 2013-11-23
If we all are in the same network then why cannot we get the MAC address of the client ?. NetworkInterface.getHardwareAddress gives the machine hardware address not the client which connects to the server. Anyone with any suggestions ?
0
Comment
Question by:Micheal_Male
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:geowrian
ID: 33602120
Even if you are on the same physical network, network policies and/or routing across subnets can make this (practically) impossible. As far as I'm aware, there is no "reliable" way to retrieve the MAC address of a remote network device short of having a way to send a command to a process running on the remote PC, or implementing discovery calls to the switch (i.e. via CDP for Cisco switches).

If within the same subnet and barring any network policies or configuration preventing it, you may be able to lookup the IP of the remote PC in the ARP table, then grab the MAC address from that. However, this is not guaranteed to work, and may actually give wrong information (i.e. if switching or routing is performed it may return the MAC of the switch/router).

http://my-addr.com/i/determine_mac_address_from_ip/lookup-ping-search/howto_find_remote_mac_address.php
0
 

Author Comment

by:Micheal_Male
ID: 33602136
Good article. That gives me an idea that it is impossible to get the MAC address of the client in java even it is connected on the same network. The only way is to run the Process Runtime.exec() command and give arp as a parameter and then compare the client ip with the ip we got from running the arp command in java and then parse the mac address.
0
 
LVL 2

Accepted Solution

by:
chataros earned 750 total points
ID: 33609477
also if you're running on windows you can run the "nbtstat -A/a server name/IP " command and parse the output

EX:
nbtstat -a NAME
nbtstat -A IP

0
 

Author Closing Comment

by:Micheal_Male
ID: 33610341
Thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question