Nmap Multiple Subnets

Published
Length
3 min read

Luis Felipe Dias

All posts

You can scan nmap multiple subnets by listing network ranges or reading a target file. The scanner reads each network block in order and probes all active hosts. Network teams often run these broad scans from an admin server to map open ports. When that server holds wide network permissions, any user on it can probe every subnet. Overly broad roles also let engineers run heavy scans that slow down production apps. How to set up nmap multiple subnets scanning The scanner accepts several networ

Multiple Subnets: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You can scan nmap multiple subnets by listing network ranges or reading a target file. The scanner reads each network block in order and probes all active hosts. Network teams often run these broad scans from an admin server to map open ports. When that server holds wide network permissions, any user on it can probe every subnet. Overly broad roles also let engineers run heavy scans that slow down production apps.

How to set up nmap multiple subnets scanning

The scanner accepts several network formats in a single run to cover large spaces. Engineers can type CIDR blocks separated by spaces right into the command line. Each CIDR block tells the tool which IP addresses belong to that specific group. You can also use octet ranges with dashes to target smaller slices of a network. This method works well when you have two or three subnets to check.

For larger networks, teams keep a plain text file that lists every subnet. Each line in the file holds one subnet range, IP address, or host name. You tell the scanner to read this target list instead of typing addresses by hand. You can also set up an exclusion file that lists sensitive subnets to skip. The tool compares both lists and drops any blocked addresses before sending network packets.

How host routing and permissions affect multi-subnet scans

Running a scan across many subnets requires more than a valid target list. The host machine needs network routes and firewall rules that reach every remote segment. Raw packet scans also require root or admin rights on the local Linux machine. Without local admin rights, the tool falls back to slower full TCP handshakes. Teams often grant shared sudo rights on a central utility host to fix this.

Firewall teams must also open wide network paths for the central scanning host. If a firewall drops probes, the scanner waits for timeouts and slows down the job. To avoid delays, admins often place the scanner inside a trusted management zone. That zone gets full network reach into database subnets, app tiers, and internal services. Anyone who logs in to that management host inherits that entire network reach.

Multiple Subnets: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native network setups solve and what they miss

Native target lists and OS roles help teams organize and run large discovery jobs. File inputs prevent typos and make regular network checks easy to repeat on schedule. Local sudo rules decide which engineers can start the scanner with raw socket rights. Firewall rules make sure only approved management servers can send probes across subnet borders.

Still, host roles and firewall rules only check who logs in to the server. They do not inspect the actual commands or target ranges an engineer runs in flight. A user who needs to check one web subnet can still scan restricted database subnets. Standard OS logs also struggle to capture the full output of every interactive terminal session. Teams lack a clear audit trail showing which subnets were probed and what came back.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can I mix CIDR blocks and single IP addresses in one scan?

Yes, the scanner accepts CIDR blocks, IP ranges, and single hosts in the same run. You can separate them with spaces or put each target on a new file line.

How do I stop a multi-subnet scan from hitting sensitive hosts?

You can maintain a separate text file of excluded subnets and critical IP addresses. Pass that exclusion file to the scanner so it skips those hosts during discovery.

Why does scanning multiple subnets require admin privileges on the host?

Fast half-open scans craft raw network packets, which the operating system restricts to root users. Unprivileged users can still scan subnets, but the tool must complete full TCP handshakes.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.