How to use nmap to list unused IP addresses

Written by jonah quant
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to use nmap to list unused IP addresses
Identify unused IP addresses in your network. (Dynamic Graphics Group/Dynamic Graphics Group/Getty Images)

Nmap is a security scanner application that probes computers connected to a network to find out their characteristics, available services and security vulnerabilities. Every Local Area Network (LAN) uses a contiguous interval of the Internet Protocol (IP) address space. Each computer in the LAN must have an IP address within that interval; however, some IP addresses within that interval may be unused (for example, not assigned to any computer) at any given time. You can use Nmap to generate a list of the unused IP addresses.

Skill level:


  1. 1

    Log in to one of the computers connected to the LAN.

  2. 2

    Identify a sample IP address within the LAN, and the network mask the LAN is using. The specific way of performing this step depends on the operating system. For example, on Linux, type the following command into a shell:


    Press "Enter." The sample IP address is at the beginning of the second line in the output, after the "inet addr:" heading. The mask is at the end of the second line, after the "Mask:" heading.

  3. 3

    Convert the network mask to binary by converting each of its four numbers to binary separately. For example, if the network mask is "" in decimal, the binary representation is "11111111.11111111.11111100.00000000"

  4. 4

    Count the number of ones in the binary representation of the mask to obtain the number of bits shared by all IP addresses in the LAN. For example, if the mask is "11111111.11111111.11111100.00000000" in binary, the number of shared bits is 22.

  5. 5

    Invoke Nmap to have it probe all IP addresses in the LAN's address interval, and filter the output to list only the unused addresses. For example, on Linux, type the following command into a shell:

    nmap -v -sP | grep down

    Replace "" by the sample LAN IP address obtained in step 2. Replace "22" by the number of shared bits obtained in step 4. Press "Enter." The command will list all unused IP addresses in the LAN.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.