An authorised Nmap sweep of a /22 finds far fewer hosts than the asset register lists; how do you use --reason and the discovery options to find out why?
answer
- No reply is not no host
- Each up host carries a reason
- Probe types against what filters pass
- Scanner vantage point matters
- Control group of known-live hosts
basics
~20 s'Down' only means no probe was answered. Re-run with --reason, check known-live hosts to see which probe types get through, then add suitable probe types or scan from inside the segment before reaching for -Pn.
solid answer
~40 sFirst separate a missing host from a missed one. Take hosts you know are live and see how Nmap classed them: `--reason` prints why each host is up (`echo-reply`, `syn-ack`, `reset`, `arp-response`, `timestamp-reply`), which shows which probe types this network actually lets through. Hosts that answer none of the default four need a probe set matched to what they serve: `-PS` or `-PA` to a port you know is listening, `-PU` for a UDP service, or `-PE`, `-PP` and `-PM`. Run from the segment itself, where ARP finds hosts a routed scanner cannot. Only then consider `-Pn`, which fixes the count but not the accuracy. Record the probe set and vantage point so quarterly runs stay comparable.
code
bash · 2 lines# Authorised inventory sweep: record why each host was called up
nmap -sn --reason -PE -PS22,443 -PA80 -PP -oX sweep-q3.xml -iL scope.txt --excludefile excluded.txtgo deeper
Remember that a host reading down only means no probe was answered, and that --reason shows what answered for each up host.
Map each reason string to the probe that produced it and choose probe types to match the network's filters.
Run it as a controlled experiment: a known-live control group, a recorded probe set, an inside vantage point, and an honest list of what stays unconfirmed.
Define what 'complete' means for the quarterly inventory and which independent sources, such as DHCP and switch tables, the sweep is reconciled against.
## Down means unanswered Nmap marks a host down when none of the probes you sent drew a reply. That is evidence about the path and the probes, not about the host. A register entry that is missing from the sweep can be a powered-off machine, a stale register line, a host that filters the probe types used, or a scanner that cannot reach it. ## Reading --reason `--reason` adds the packet that decided each host's state to the output, and the XML output records it even when you do not ask: | Reason shown | What decided it | |---|---| | `echo-reply` | an ICMP echo request was answered | | `timestamp-reply` | an ICMP timestamp request was answered | | `syn-ack` | a SYN reached an open port | | `reset` | a closed port or an ACK drew a reset | | `arp-response` | the host answered ARP on the local segment | | `conn-refused` | an unprivileged connect() was refused | | `user-set` | `-Pn` was given and nothing was sent to decide | Start with a control group: a dozen hosts you know are live, from different subnets and operating systems. If they read as up with `arp-response` or `echo-reply`, you learn which probe types pass. If they read down, the probes or the vantage point are wrong. ## Why live hosts go missing - host or network firewalls drop the default ICMP and TCP probes - the scanner sits on the wrong side of a filter, so its probes never arrive - an unprivileged scan quietly replaced ICMP probes with TCP ones - the hosts only run services on ports the default probes never touch - the register is stale or the machines were off at scan time ## A method 1. Run `-sn --reason` over the range and save the XML. 2. Diff the live set against the register and the control group. 3. For hosts known to be live but read down, widen the probes: a SYN or ACK probe to a port the host really serves, `-PU` for a UDP service, or the other ICMP types. 4. Re-run from a scanner inside the segment, where ARP works. 5. Cross-check what is still missing against other evidence, such as switch address tables or DHCP leases. 6. Use `-Pn` only for hosts you have proved exist and filter every probe, and say so in the report. The probe set and output file for such a run are shown in the code example, so the next quarterly run repeats it exactly. ## Vantage point and timing The same range can read differently from two scanners. A scanner on a management VLAN may be filtered from a user VLAN, while one on the target's own segment finds hosts with ARP, which does not cross routers and so meets no router filter. Laptops and lab machines are often simply off when a sweep runs, so one run is a sample, not a census; compare several runs before declaring an asset gone. Hosts that sleep or roam will always sit in the register and miss some sweeps. ## What to record with the result - the Nmap version (7.991 here), the exact command and the account's privilege - the scanner's address and network position, and the date and time - the probe set used and the control-group outcome - the list of unconfirmed register entries, with the reason each is unconfirmed Together these let the next quarter's sweep be compared like with like. ## The opposite error A sweep can also over-report. A router doing proxy ARP answers for every address on a segment, and the reference guide offers `--disable-arp-ping` for that case. A firewall that answers with TCP resets on behalf of empty addresses makes them look up; `--discovery-ignore-rst`, available since Nmap 7.90, stops Nmap counting those resets. A count that matches the register is not proof of accuracy.
- Hosts are still missing after richer probes and an inside vantage point; what next?Stop treating the sweep as the only evidence. Check switch address tables, DHCP leases and the register itself: the host may be off, decommissioned or silent to every probe. Report the residual list as unconfirmed rather than forcing it up with -Pn.
- The sweep reports every address in a /24 as up; what do you suspect?Something is answering for the empty addresses. A router doing proxy ARP shows `arp-response` for all of them, and `--disable-arp-ping` removes that. A firewall answering for empty addresses with resets shows `reset`, and `--discovery-ignore-rst` (since 7.90) ignores them. Confirm against another source.
- Down means the address is unused or the host is off
- Adding -Pn is the right fix for hosts that read down
- ICMP reaches everything, so scanner location is irrelevant
- --reason only explains port states, not host states
- A sweep count equal to the register proves it is correct
Assumes Nmap 7.991; --discovery-ignore-rst has been available since Nmap 7.90, and the --reason strings are those 7.991 prints.