Вы можете проверить, не заблокирован ли ICMP, с помощью следующей perl-программы:
ping.pl (отредактировано для печати порта)
#!/usr/bin/env perl
use strict;
use warnings;
use Net::Ping;
my @hosts = @ARGV;
die "usage: sudo perl ping.pl host\n" unless @ARGV;
my $timeout = 5;
my @proto = ("tcp", "udp", "icmp","syn");
foreach my $pro ( @proto ) {
my $p = Net::Ping->new($pro);
# default port
my $port = 7;
$p->port_number($port);
# tcp on https port
if ( $pro eq "tcp"){
$port = 443;
$p->port_number($port);
}
print "\nProtocol $pro port $port\n";
foreach my $host( @hosts ) {
if ($p->ping($host, $timeout)){
print "$host is reachable\n";
}
else{
print "$host is NOT reachable\n";
}
}
$p->close();
sleep(2);
}
exit;
#$ sudo perl ping.pl google.com
Protocol tcp port 443
google.com is reachable
Protocol udp port 7
google.com is NOT reachable
Protocol icmp port 7
google.com is reachable
Protocol syn port 7
google.com is reachable
вывод ping и curl (видеотронная сеть)
#$ ping -c 4 google.com
PING google.com (24.200.237.84) 56(84) bytes of data.
64 bytes from google-084.237.cache.videotron.ca (24.200.237.84): icmp_seq=1 ttl=61 time=7.14 ms
64 bytes from google-084.237.cache.videotron.ca (24.200.237.84): icmp_seq=2 ttl=61 time=10.1 ms
64 bytes from google-084.237.cache.videotron.ca (24.200.237.84): icmp_seq=3 ttl=61 time=6.86 ms
64 bytes from google-084.237.cache.videotron.ca (24.200.237.84): icmp_seq=4 ttl=61 time=8.86 ms
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 6.866/8.243/10.102/1.320 ms
#$ curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.ca/?gfe_rd=cr&ei=ArVmVbiOLajd8gfKq4DoCQ">here</A>.
</BODY></HTML>