I am able to ping a server on an vpn. However, when I use a normal nmap scan it does not pickup on the host. Doing a scan with host discovery turned off (nmap -Pn host scan) does show the host.

If I am not mistaken, should my ping not fail if the regular nmap scan (nmap host) fails?


From nmap.org:

If no host discovery options are given, Nmap sends an ICMP echo request, a TCP SYN packet to port 443, a TCP ACK packet to port 80, and an ICMP timestamp request. ... For unprivileged Unix shell users, the default probes are a SYN packet to ports 80 and 443 using the connect system call.

I am guessing you ran nmap as an unprivileged user, so ICMP was not used for host discovery. Using -Pn "works" because it skips host discovery and treats the host as up no matter what.


The ping protocol is a layer 3 protocol, so, it doesn't made any TCP/UDP connection and it doesn't use any port, maybe the server that you ran nmap against it is simply block TCP/UDP connection or Block them just if they come from unknown IP.

  • 2
    Either TCP/UDP and ICMP (the protocol used by ping) is layer 3. This answer is incorrect.
    – slayer
    May 21 '21 at 3:01
  • @slayer ICMP is often presented as a layer 3 protocol (which I do disagree with) May 22 '21 at 3:55
  • @slayer, TCP/UDP are transport layer protocols but the ICMP is a network layer protocol. May 24 '21 at 15:54
  • @MohamedMarrouchi The TCP/UDP on transport (4) layer doesn’t provide a guarantee of packet delivery. It is the charge of the network (3) layer to assurance the connection-oriented and connectionless service, AFAIK. The ICMP is a connectionless protocol.
    – slayer
    May 24 '21 at 16:13
  • @MohamedMarrouchi Ah! I noticed a mess here. Now I understood what you mean. When you affirmed, ICMP protocol is the network layer to clarify that it is a connectionless protocol, I had confused because TCP/UDP is also layer 3. So, I had understood that you were dealing with TCP/UDP working only at the transport layer. Your answer was confusing to me, but now that I understand, I agree. lol
    – slayer
    May 24 '21 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.