|
Title: Automatically gathering a MAC address Post by: baghtal on October 02, 2007, 02:00:53 PM I work with a large network that spans several subnets. I am trying to find a way to automatically include the MAC address when my users visit a tracking web page to report problems they are having. Most of my users I don't expect to know how to find their MAC on their own so pulling automatically would be best.
IP addresses are assigned by DHCP and I would like to track issues that are machine specific, which is why i need MAC tracing instead of IP. Has anyone got any idea how to do this without ActiveX controls or a local client on the users machine? Thanks! Title: Re: Automatically gathering a MAC address Post by: Negrita on October 02, 2007, 06:07:01 PM The first thing that pops into mind is snmpwalk on the ARP tables, though there is probably an easier solution.
Title: Re: Automatically gathering a MAC address Post by: dannioni on October 03, 2007, 12:50:11 PM You could send a arp request:
Who has 192.168.1.14? Ans: 192.168.1.14 is on 00:72:B5:F8:83:CA:B4:44 That is if your network structure allows it (don't know anything about networks that big). Title: Re: Automatically gathering a MAC address Post by: dean on October 03, 2007, 02:21:17 PM if you are directing your users to an internal help desk web page you can use a tool like nbtscan and a little bit of perl cgi to do this for you.
Something like this should work and output what you need to a file. Code: $ip = $ENV{'REMOTE_ADDR'}; $command = "/path/to/tool/nbtscan -v -h -q -s "$ip""; open(FH, ">>filename") or die "error creating or opening file: $!\n"; # Print outtput to file. $tm = localtime; print FH "Record added : $tm\n\n"; open (S, "$command |") || die "Cannot run $command! : $!\n"; while (<S>){ print FH $_; } close(FH); The environment variable REMOTE_ADDR will get the user's IP address for you. feed that to the tool and it should give you the data that you need. This might be limited by your routing topology as the server will need to directly connect to the machines using the tool. Not sure what DHCP server you're using but that should hold MAC to IP mappings too.
Powered by SMF 1.1.18 |
SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com |