The Nmap (Network mapper) tool is a fast and reliable way to find active hosts on a subnet. The -sn
option performs a ping scan to help identify connected devices without scanning ports.
The subnet 192.168.1.0/24 is a private IP range typical for a small LAN, such as a home or small office. The nmap command checks all 256 addresses in that subnet and discovers all active devices in your local network.
This guide explains how to scan with nmap -sn 192.168.1.0/24 and how to exclude specific IP addresses from the scan.

Prerequisites
- Nmap installed (see how to install Nmap on Linux).
- Access to the command line/terminal.
How to Scan with nmap 192.168.1.0/24
To scan the 192.168.1.0/24 subnet with Nmap, follow these steps:
1. Open the terminal.
2. Run the nmap -sn 192.168.1.0/24
command to scan all hosts in the subnet:
nmap -sn 192.168.1.0/24
The -sn
option pings each host and skips the port scan, which is faster than performing a full scan.
3. Review the output. It lists all reachable hosts on the subnet that responded to the ping or ARP request. The example output shows only one host.
When multiple hosts are connected, the command shows the IP address of the active device, how fast the response was (latency), and the device's MAC address (sometimes the vendor name, as well).
How to Exclude an IP with 192.168.1.0/24
To scan the subnet, but exclude one or more IPs:
1. Open the terminal app.
2. Use the --exclude
option to exclude a single host. For example:
nmap -sn 192.168.1.0/24 --exclude 192.168.1.2
The command scans the subnet, excluding 192.168.1.2. The output shows it scanned one address less (255 total instead of 256).
3. To exclude multiple hosts, separate each host with a comma:
nmap -sn 192.168.1.0/24 --exclude 192.168.1.2,192.168.1.3
Use this method to exclude just a few addresses.
4. Alternatively, use dash-separated ranges to exclude an address range:
nmap -sn 192.168.1.0/24 --exclude 192.168.1.20-30
The range is inclusive and excludes 11 addresses from the scan.
Conclusion
This guide explained how to scan the 192.168.1.0/24 subnet using nmap -sn
. The command provides a quick overview of active hosts without performing a full scan. We also showed how to exclude IPs to only focus on relevant devices.
For more networking commands, see our list of Linux network commands.