Project

ipscanner

0.0
No commit activity in last 3 years
No release in over 3 years
Ping every address on a IPV4 Subnet e.g. 192.168.1.x
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Discovering recently added IP addresses on the LAN using the IPScanner gem

require 'ipscanner'

IPScanner.detect_new '192.168.4.'

output:

scanning the network (192.168.4.x)
found 15 IP addresses
scan to detect new IP addresses? (y/n) y
found : ["192.168.4.123", "192.168.4.191"]
scan to detect new IP addresses? (y/n) y
found 17 IP addresses
scan to detect new IP addresses? (y/n) y
enter y or n
found : ["192.168.4.176"]
scan to detect new IP addresses? (y/n) y
found : ["192.168.4.191"]
scan to detect new IP addresses? (y/n) y
found 16 IP addresses
scan to detect new IP addresses? (y/n) y
no new IP addresses found
scan to detect new IP addresses? (y/n) n

Note: The IP scanner isn't 100% fool-proof, as it depends upon finding IP addresses within a given time. IP addresses not found within the given time are excluded from the results. However, those IP addresses with a higher latency typically show up again on subsequent scan results as is shown above.

Resources

Pinging a range of ip addresses with ipscanner

require 'ipscanner'

# scan all ip addresses ranging from 192.168.1.1 - 192.168.1.254
a = IPScanner.scan

# scan ip addresses 192.168.1.1 - 192.168.1.100 with a timeout of 1 second
a = IPScanner.scan('192.168.1.', 1..100,1)

# scan ip addresses 192.168.1.1, 192.168.1.104, and 192.168.1.112
#   with a timeout of 2 seconds
a = IPScanner.scan('192.168.1.', [1,104,112],2) 

ipaddress gem ping