Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 8th, 2008, 07:21 PM
Member
 
Join Date: Apr 2008
Location: United states / India
Posts: 104
Default Mac address with arp -a

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
Code:
shell_exec("arp -a");
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,
Reply
  #2  
Old July 10th, 2008, 07:54 AM
micmast's Avatar
Member
 
Join Date: Mar 2008
Posts: 74
Default

if you run ifconfig <network device>, you can also retrieve the mac-address (HWaddr)

Hope this works
Reply
  #3  
Old July 10th, 2008, 05:16 PM
Member
 
Join Date: Apr 2008
Location: United states / India
Posts: 104
Default

Quote:
Originally Posted by micmast
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,
Reply
  #4  
Old July 11th, 2008, 11:56 AM
micmast's Avatar
Member
 
Join Date: Mar 2008
Posts: 74
Default

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
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles