By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,713 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,713 IT Pros & Developers. It's quick & easy.

Mac address with arp -a

100+
P: 123
Hi all,
I am using freeBSD .
I have written a PHP script that can give me IP , hostname as well as MAc address of the work station.
I have used
Expand|Select|Wrap|Line Numbers
  1. shell_exec("arp -a");
  2.  
And than used the perg_match(PHP function ) to get MAC address.
That works fine on my PC. But when i run that script on other PCS , It gives me correct IP and hostname , but the arp -a gives me all the data of my Pc , rather than giving me the result of the PC on which I am running the script..

are there any other option , by which i can get MAC address ....
Thanks,
Jul 8 '08 #1
Share this Question
Share on Google+
3 Replies

micmast
100+
P: 144
if you run ifconfig <network device>, you can also retrieve the mac-address (HWaddr)

Hope this works
Jul 10 '08 #2

100+
P: 123
if you run ifconfig <network device>, you can also retrieve the mac-address (HWaddr)

Hope this works
Hey micmast,
Thanks for the help..
I tried doing ifconfig also , but it dint give me HWaddr .
Actually my script work well on my PC and give me hostname , ip and MAC correct
But when i run that on other PC in the work group , it shows correct IP and host of their PC and gives me results of "arp -a " of my PC( my detail rather than their)
DO you have any idea ?
Thanks,
Jul 10 '08 #3

micmast
100+
P: 144
arp -a doens't return my mac either, it returns the mac of my default router. what info do you get from ifconfig <interface> ?

offcourse I'm testing this on a linux system, not bsd, but it shouldn't look all that different
Jul 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.