VMware ESXi and vSphere Cluster Management
Using Nmap's --reason Flag to Explain Host and Port States
Learn how Nmap's --reason option reveals the replies or missing replies behind host, open, closed, and filtered port classifications.
Nmap normally reports whether a host is up and whether its ports are open, closed, or filtered. The --reason option adds the observation that led Nmap to make each classification, such as a received SYN-ACK, a TCP reset, or no response.
This extra context helps you validate scan findings, distinguish a reachable host with closed ports from a host whose traffic is being silently filtered, and investigate results that change between scans.
Prerequisites and key terms
You should understand basic command-line use, IP addresses, TCP ports, network services, basic TCP connection establishment, and the permission requirements for network scanning.
- Host state: Nmap's assessment of whether a target system is reachable, commonly shown as up or down.
- Port state: Nmap's classification of a port, such as open, closed, or filtered.
- Open: Nmap received evidence that an application is accepting connections or packets on the port.
- Closed: The target is reachable, but no service is accepting connections on that port.
- Filtered: Nmap cannot determine whether the port is open or closed because filtering or another condition prevents a conclusive response.
- SYN: The TCP packet used to begin a connection.
- SYN-ACK: A TCP response that acknowledges a SYN and indicates that the connection can continue.
- RST: A TCP reset packet that can reject a connection attempt.
- TTL: Time To Live, an IP header value decremented by routers. It provides path-related context, not definitive operating-system identification.
- No-response: No reply was observed during the relevant scan waiting period.
What the --reason flag does
--reason is an Nmap command-line option. It displays the response evidence, or lack of response, used to determine host and port states. Without it, ordinary output can tell you the resulting state while leaving out the packet-level clue behind that state.
For example, a port reported as closed may have produced a TCP reset. A port reported as filtered may have produced no usable reply. Those observations have different diagnostic value, even though both ports are not available for a normal connection from the scanner.
The reason is evidence for Nmap's classification, not an absolute description of every device on the path. Firewalls, packet loss, rate limiting, routing problems, and scan timing can affect what Nmap observes.
Basic command usage
Run a scan against an authorized IP address or hostname by adding --reason to the command:
nmap --reason 192.0.2.10
The option can be combined with port selection, host-discovery, scan-type, and timing options. For example, to focus on common administration and web ports:
nmap -p 22,80,443,3389 --reason 192.0.2.10
A hostname can be used in the same position:
nmap --reason lab-host.example
Use a timing template when appropriate for the authorized environment:
nmap -T4 --reason 192.0.2.10
-T4 is an Nmap timing template. It does not change what --reason displays, but faster probing can be less reliable on congested, rate-limited, or heavily protected networks.
Reading host-state reasons
A host status line describes reachability of the system as a whole. It is separate from the state of any individual port. A host can be up even when every selected port is closed or filtered.
When Nmap reports a host as up with a reason, the reason identifies the response that established reachability. A reset response is one possible example: a reachable TCP stack may send an RST when it receives a probe for a port that has no listening service.
Some output may include a TTL value with the host reason. TTL is an IP header field that routers decrement as a packet crosses the network. A returned TTL can help explain packet details or provide rough path-related context, but it is not a reliable, standalone method for identifying the target's operating system.
Do not use the host-up reason as proof that a particular service is available. Review the port rows separately. Host discovery answers “can Nmap establish that something is reachable?” Port scanning answers “what evidence exists about this specific port?”
Reading port-state reasons
Detailed output commonly relates several pieces of information:
| Output element | Purpose | Example interpretation |
| Host status line | Summarizes whether the target is reachable and may show the evidence. | A reset indicates that a reachable system responded to a probe. |
| Omitted-port summary | Aggregates repetitive results instead of printing every port. | “Several closed ports” may share a reset reason. |
| Port number and protocol | Identifies the tested endpoint, such as TCP port 443. | Port 443 is the TCP endpoint being classified. |
| State | Reports Nmap's classification. | open, closed, or filtered. |
| Service label | Provides a familiar name associated with the port. | https is commonly associated with TCP 443. |
| Reason | Shows the reply or missing reply supporting the state. | syn-ack, reset, or no-response. |
| TTL or related packet detail | Adds packet-level context when Nmap reports it. | A TTL value describes the received IP packet's remaining lifetime. |
Service labels are usually port-based names. They are useful hints, but they do not prove which application is actually running. Confirm the application with authorized service or version detection and other appropriate verification.
TCP handshake interpretation
A TCP three-way handshake normally consists of SYN, SYN-ACK, and ACK. A SYN scan uses the early part of this exchange to classify a port without completing a normal application connection in the same way as a full client session.
- The scanner sends a SYN to the target port.
- If an application is accepting connections, the target normally replies with SYN-ACK. This is strong evidence for an
openport. - If no application is listening, the reachable TCP stack commonly replies with RST. This supports a
closedclassification. - If a firewall or another condition prevents a useful reply, Nmap may classify the port as
filtered, depending on the scan type and other observations.
| Observed reason | Typical reported state | What the observation means | Important limitations |
| SYN-ACK received | Open | The target responded as though a service is willing to continue the TCP handshake. | It does not by itself identify the application or prove that a complete application session will succeed. |
| Reset received | Closed | A reachable TCP stack rejected the connection attempt on a port without an accepting service. | Network devices can generate or alter resets, so consider the path and scan type. |
| No response | Filtered or otherwise inconclusive | No reply was observed during the relevant waiting period. | Packet loss, rate limiting, an unavailable route, silent filtering, and timing can all produce this observation. |
| ICMP unreachable or administratively prohibited | Often filtered | An intermediate or target device reported that delivery is blocked or unavailable. | The exact classification depends on the ICMP code, scan type, and Nmap's interpretation; it does not always reveal the specific filtering rule. |
Filtered and no-response results
No response does not conclusively prove that a firewall blocked a port. It only says that Nmap did not observe a usable reply within the scan's conditions. Possible causes include:
- A firewall or access-control device silently dropped the probe.
- Packets were lost on a congested or unstable network.
- The target or a security device applied rate limiting.
- The route or target was temporarily unavailable.
- The scan timing was too aggressive for the path.
Therefore, filtered means uncertainty from the scanner's perspective: the port might be open or closed, but the available observations do not distinguish those possibilities.
Grouped results and omitted ports
Nmap may consolidate repetitive results, especially when scanning many ports. For a full TCP range, use:
nmap -p- --reason 192.0.2.10
A summary might state that many omitted ports are closed for the same reason. Read that as an aggregate: the listed count of ports received a shared type of evidence, commonly TCP resets. The summary does not mean that every port had a separately displayed row.
Using reasons to analyze a scan
- Prefer direct replies over assumptions. A SYN-ACK or reset is direct observed evidence; no-response is an absence of evidence.
- Separate reachability from service availability. A host-up reset can show that the system is reachable while individual services remain closed.
- Compare similar ports. An open port with a SYN-ACK, a closed port with a reset, and a filtered port with no response suggest different network behavior.
- Use a focused port list during investigation.
nmap -p 22,80,443,3389 --reason 192.0.2.10makes the evidence easier to review. - Repeat authorized scans when needed. If loss or filtering is suspected, compare runs during an approved test window and with suitable timing.
- Verify service labels. A label based on a well-known port is not proof of the actual application.
Troubleshooting common results
Filtered with a no-response reason
Confirm the target address, scope, and routing first. Then repeat the scan during an approved window with a narrower port list and appropriate timing. If available, compare the results with firewall, host, and network logs. Treat the result as an inconclusive observation rather than proof of a particular firewall rule.
Host is up because of a reset, but expected services are not open
The target may be reachable while the expected service is not listening. A firewall may also permit enough traffic for reset responses while blocking other traffic, or the service may be bound to another interface or port. Review each port reason, verify the intended protocol and port list, and check the authorized host's listeners and firewall configuration.
More no-response results appear in a faster scan
Network congestion, target-side rate limiting, security-device throttling, or an overly aggressive timing policy can cause this pattern. Compare with a less aggressive timing template, reduce the scan scope, and correlate results with available network telemetry.
Exam-relevant notes
--reasondisplays the response evidence, or lack of response, behind Nmap's host and port states.- SYN-ACK normally supports
openduring a SYN-based scan. - A TCP reset commonly supports
closed. - No response can contribute to
filtered, but it does not prove that a firewall is responsible. - A host can be up while its scanned ports are closed or filtered.
- TTL is supplementary packet context, not definitive operating-system identification.
- Service names in ordinary port output are typically port-based hints, not verified application identities.
- Timing options such as
-T4can be combined with--reason, but aggressive timing may reduce reliability.
Summary
Nmap's --reason flag turns a state-only result into an evidence-oriented result. Use it to see whether a classification came from a SYN-ACK, a reset, an ICMP error, or no observed response. Interpret those reasons in context: direct replies can distinguish reachable closed ports from many filtered cases, while no-response results remain subject to loss, filtering, rate limiting, routing, and timing. For related study, review Nmap reason output alongside TCP SYN scanning, port-state meanings, timing, service detection, and authorized packet analysis.