When I use this command which IP addresed are scanned
# nmap -sP 192.168.0.120/25
CAn you please help me how to get the IP range when I have the addres and subnet. Because I am trying to understand this, but no result till now..Thanks in advance
The network in your command is in CIDR notation. The first part (before the
/
) defines which network, and the second part defines how many bits of netmask are set. An IPv4 address is 4 bytes, or 32 bits of information./25
means that 25 bits of this address are used to denote the network, and32 - 25 = 7
bits are left to address hosts on the network. A/25
network can hold2^7 = 128
hosts, less the network and broadcast addresses. To get the network address (the start of your block of addresses), you take the address given and bitwise-and it with2^32 - 2^7
. In this case (using Python):So the network address is
192.168.0.0
, and you have 128 addresses, so your target range is 192.168.0.0 - 192.168.0.127.