By default Net::Ping does a tcp ping. Normal OS pings are usually ICMP. You could try allowing inbound port number 7 to make the TCP Net::Ping work or
$p = Net::Ping->new("icmp");
to make your Net::Ping use ICMP protocol.
| [reply] [d/l] |
Agreed, You will probably have more luck with an ICMP ping.
One caveat, is that on Linux at least, your perl process will need root to send ICMP packets. (you will find that the ping binary is setuid root on Linux). This might not be an issue on windows as the security tends to be more lax, and you are probably logged in with admin privileges, but it is something to keep in mind.
| [reply] |
A quick reading of Net::Ping shows it uses tcp by default, whereas your ping command likely used icmp. You can tell Net::Ping to use icmp. See the synopsis.
| [reply] |
| [reply] |