Search code examples
c#.net-2.0icmp

C# - Ping server with ICMP disabled


I am trying to ping a series of servers frequently using the PingReply class. Most of the time this is fine, but other times I get failed pings. I'm guessing this has something to do with ICMP being disabled on the remote server(s). Is there any way to get a ping to from a server even if ICMP is disabled?


Solution

  • If the remote server won't respond to an ICMP ECHO request, it won't work with the Ping command. Odds are there is some difference between the packet you're sending and the one Ping is sending. You can use something like Network Monitor or Wireshark to see the packets and compare them.

    Odds are you're sending a packet with a lower TTL (or maybe too big of a buffer). I would try increasing PingOptions.Ttl first.