How do I discover the MAC address of machines in a network?
I need to discover the machines that are available just with only BIOS installed (no operating system).
And I need to find the MAC address of machines that are up.
How do I discover the MAC address of machines in a network?
I need to discover the machines that are available just with only BIOS installed (no operating system).
And I need to find the MAC address of machines that are up.
You will have to access the information available on your managed switches. If you have an unmanaged network, I don't see a way to do that.
This is assuming the target computers are capable of Wake-on-LAN (WoL). In this case, a link to the server is established (look for the flashy link LED), and the network card is listening to WoL broadcasts. AFAIK, the card does not answer to anything in this state. If there isn't any WoL, the card most probably is off (no link LED), and it won't work at all.
If the machines are not powered up, this is impossible.
If they are powered up, I would guess this is impossible as well, as you need a minimal network stack to at least answer things like ARP queries etc, which isn't working without an OS installed.
What might work (I don't know and can't test right now) is that the NIC and the switch communicate when the NIC is plugged in or powered up and the switch learns the MAC address this way. If this is the case you would need a manageable switch and query it for connected mac addresses.
You can use Nmap to do a very quick ARP scan using the following syntax.
This uses ARP ping (only ARP requests, no ICMP, UDP or TCP, no port scanning) to scan the specified IP address range and record the IP address/MAC address/Hostname responses in an XML file (nmap.xml).
I wrote a PowerShell script that munges the XML file and spits out a CSV file. This also filters out the down hosts. I find this easier to use in Excel than the XML file. Here's the script if anyone is interested.
From a Unix machine, listening to the no-OS computers on the same LAN, and if possible via a Hub (not a Switch), you can try
Also you may want to try
wireshark
(from a OS-ed machine). Again, better to use a Hub in order to catch any communications from the BIOS machines, including broadcasts.(In Cisco switches command is
show mac-address-table
).A very easy little trick you could do within 2 seconds is working with the fact that any operating system writes a table with the mac and IP address of any device it interacts with. This is known as ARP TABLE. So the question is how to force an interaction with all devices? You could simply ping the broadcast IP address. This is not perfect, since some devices or firewall could block ICMP ping request, but it works in many scenarios.
The commands are (in a ipv4 192.168.0.255 broadcast address):
In Linux use:
Wait a few seconds for devices to respond, then do:
For IPV6 ping see Giedrius Rekasius comment
Not perfect, but no tools, no research, no waste of time, works in every major operating system and is quick.
The basic problem here is that this is Layer 2 information, so only switches see it. Some switches will provide an interface that lets you peek at this info, but if they don't the only way to get it is to intercept in the physical layer, by eg installing a hub between the switch.
If you're using managed switches this information is likely available from the switch. Some end-user integrated routers/switches (such as the kind that often package ADSL modems as well) will sometimes have a DHCP client list which includes MAC addresses.
If you're using unmanaged switches, and you really want to know this info, I recommend you buy a hub, and temporarily replace the switch with it. You can then connect a computer running wireshark to the hub and capture ARP packets to record MAC addresses. Alternately you could use Echolot to do this for you - it selectively tracks ARP packets and builds a MAC address database.
Scan the network with Nmap and then check the ARP table (
arp -a
in Linux distributions).Here is a solution that worked for me:
As others have said, if you have unmanaged switches, or BootP/PXE, there's no easy way to get the MACs of machines with no OS.
If your running machines are running windows, it's easy to script (usually via WMI)
There are a bunch of examples here: http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[0].Type=SearchText&f[0].Value=MAC+address&x=0&y=0