hintco
asked on
How to List all ip addresses on ip block or subnet !?
Hello ,
i need to write small bash script to list in loop all possible ip addresses in specific subnet or ip block.
example 1 :
ip block 192.168.1.0/24 will list :
192.168.1.1 - 192.168.1.254
example2:
192.168.1.96/27
will list the following ip addresses :
192.168.1.97 - 192.168.1.126
exmple 3:
172.16.0.0 / 20
will list the following ip addresses :
172.16.0.1 - 172.16.15.254
thank you !
i need to write small bash script to list in loop all possible ip addresses in specific subnet or ip block.
example 1 :
ip block 192.168.1.0/24 will list :
192.168.1.1 - 192.168.1.254
example2:
192.168.1.96/27
will list the following ip addresses :
192.168.1.97 - 192.168.1.126
exmple 3:
172.16.0.0 / 20
will list the following ip addresses :
172.16.0.1 - 172.16.15.254
thank you !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hintco are you there?
ASKER
senseifedon
right but i need something general for any type of subnet and networks not just class C network with subnet /24
thank you !
right but i need something general for any type of subnet and networks not just class C network with subnet /24
thank you !
--
Following script lists all possible ip address in range:
Open in new window
Then save the scipt as a named bash_ping_scan.sh
Execute the script file
Open in new window
Sample output like this:
Open in new window