I am in a LAN and there are 3 Ubuntu, 2 Kubuntu, 2 Windows XP and 2 Windows 7. What commands or tools are available to see what PCs are connected to the LAN that it shows the name of the PC and the IP. Similar to tools like Angry IP that show all PCs in a LAN.
Note that I do not know the IPs or names of the computers connected to the LAN. So the tool or command should look for them to.
Arp-scan works great for me too...
If using Wi-Fi:
-or if using ethernet:
(this last is practically identical to what Rajesh Rajendran posted; the -l standing for --localnet)
If you don't have arp-scan (it doesn't come with Ubuntu by default), just pull up a terminal and type:
Taken from Finding All Hosts On the LAN From Linux/Windows Workstation
But for a great tool, Nmap. Great for mapping networks.
The simplest thing is
I always use nmap. To scan for all devices in your network, use:
nmap -sP 192.168.0.1/24
More here: https://www.cyberciti.biz/networking/nmap-command-examples-tutorials/
It is a great tool to know about. You may want to install
nmap
using:sudo apt-get install nmap
if you are using Debian orsudo pacman -S nmap
if you are using Arch.As a possible GUI option, the best one I have seen is Angry IP as found in http://angryip.org/download/#linux
Simply download the latest DEB package and install. Then run ipscan from Dash. Here is a screenshot:
arp
ip neigh
ip neigh
andhosts
. NO nmap / sudo required.Building on this, you can build a Python script:
Download via
If broadcast isn't disabled on your router...
You can ping the broadcast address.
Will broadcast the ping command to every host within the 192.168.0/24 subnet.
Note: It's probably a good idea to keep broadcasting turned off though as that's how hackers can exploit a network using a DDOS Smurf attack. Basically, ping the broadcast address with a packet that has a spoofed destination address (ie the ip address of the victim). There's a little more to it than that but that's what Google is for.
Note: The same also works on Windows but you ping the actual broadcast address (not the subnet).
Nmap is your friend
nmap -sP 192.168.0.1/24
If you have any question,
nmap help
is full of information.Script to send email in Shell and Powershell where it is asked to user credentials when you run the script.
Script to check online devices in the network for both Linux and Windows Clients.
Script to check disk space of devices detected by previous script for both Windows and Linux.