Devices IPs in a network

Goss

New Member
Joined
May 3, 2019
Messages
13
Reaction score
11
Credits
29
Hey,

I wonder,
is there a command way, to figure out from bash terminal,
ip addresses of devices (computers, routers, personal phones/tablets),
that are connected to internal network?

thx, appreciate it
 


This is nice command, thank you atenere
even if it is showing just this

Code:
$ arp -a
gateway (192.168.0.1) at xx:xx:xx:xx:xx:79 [ether] on eth0
which is router

but there are other: computers routers devices - at least the one im writing from,
which are not included in arp -a,
 
I think you're right that arp doesn't show your IP address from the device you are using... mine isn't showing, anyway. But I do get from 7 to 9 other entries from my local home network to display. The advantage to arp is that it is already included with just about every Linux distro. A more effective tool, perhaps, is nmap.... but you will probably need to install that. After installing, try this:
Code:
nmap -sn 192.168.0.0/24

That seems to wake up devices on my home network so that arp -a will then provide more output also.

Cheers
 
Hey,
I made some research and what i found was things which somehow (but non do perfectly (yet)) works


1. arping
from many reasons interesting tool to check can be
most probably lets start from
Code:
 sudo apt install arping -y

2. ping
firstly some script, which showing devices on this router (in network there are several routers)
Code:
#!/bin/bash
for ip in 192.168.0.{1..254}; do
  ping -c 1 -W 1 $ip | grep "64 bytes" &
done

3. arp
Code:
arp -n
only shows you machines on your LAN that your machine has already talked to
Code:
arp -e
(output is more readible arp -a)


4. arp-scan
download and execute
Code:
sudo apt-get install arp-scan
sudo arp-scan --interface=eth0 --localnet
https://manpages.ubuntu.com/manpages/hardy/man1/arp-scan.1.html


5. nmap
Code:
 nmap -sn 192.168.0.255/24
-sn: Ping Scan - disable port scan; previously it was known as -sP
Code:
nmap -sn 192.168.1.1-254/24 | egrep "scan report" | awk '{print $5}'
Chapter 15. Nmap Reference Guide: https://nmap.org/book/man.html
"It's the program Trinity used in The Matrix"

6. nast
Code:
sudo apt install nast
sudo nast -m
"probes all hosts on your network using ARP protocol, so it is quite accurate and FW-aware."

7. ARPwatch
monitor devices on your network
"running it as a daemon makes possible to continuously monitor you LAN and catch IP changes, flip-flop, new devices attached and so on"




websites:
https://unix.stackexchange.com/ques...l-ips-of-devices-connected-to-the-same-router
https://superuser.com/questions/311019/display-list-of-computers-on-a-lan-in-linux
https://superuser.com/questions/261...connected-network-through-terminal-preferably
https://serverfault.com/questions/63233/best-method-and-tools-for-local-ip-scanning

more to read on:
to figure out the network address in CIDR notation
https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
 
Last edited:

Members online


Top