Is there some easy way to find out mac address of all machines on my network rather than doing an SSH into each and
ifconfig | grep HWaddr if there are 300 machines on network I really need some easy solution.
You can use nmap to run a ping scan.
A sed script to filter the output to IP -> MAC - put this in a file.
and use it like this
Use nmap. Important to run it as root so you get the MAC addresses. Example:
Will scan 192.168.1.1 - 192.168.1.255. Look up CIDR notation on wiki if you're not familiar with this subnet notation.
You should be able to get nmap from the repos of any recentish Linux distro, e.g.
A sample output from my network:
As long as you run this command from a host in the same network segment,
For the MAC addresses I need to be root on my Ubuntu box. Also a simple method for a single host is just to ping it and look at the arp table with
Depending on your LAN topology, your best shot may be to display the MAC address table on your switches.
So for example, if your switch infrastructure is Cisco, you may try a
on every switch.
If you have many switches, you may automate this task through the use of SNMP.
Another option and (again) depending on your topology and your type of networking equipment, you may also try to get the mac addresses of your devices displaying the arp table on your routers.
With either of this two methods you will also obtain the list of mac addresses of any devices that are connected to your network infraestructure: PCs, printers, access points, etc. In the first case, even of devices without an IP address. This may or may not be want you want, but it may worth a try.
You can use a program called SIW, it's free and scans the network requiring no permissions, or args.
Available in .exe, or full installation.