The last few days I was very busy and had no time to hang out or write a blog post. Nothing changed, I am still busy, but here are a few tips on how you could list all responding IP addresses within your network.
Today I had to figure out which IP address the DHCP server assigned to the weather station I connected to the internal network, so I could connect to it using the web interface of the station. Therefore I wrote a small bash script which receives a net address with the last number replaced with an asterisk:
Save this script to listHosts.sh. If you would like to list all hosts of the internal network 192.168.1.*, just enter the following line within your terminal:
However, this will take some time and will either return a list of available host or prompt “No hosts in this net.”. A much faster way to do this is using the arp command:
This will display all reachable hosts with the prefix of your net in the alternative (BSD) style.
Hope this will help someone. Until next time - Happy scripting!