[Redes] Comandos: ping

Alguno de los usos del comando ping, Packet Internet Groper:

  1. Comprobar la conectividad del host local con uno o varios equipos de una red TCP/IP mediante el envío de paquetes ICMP de solicitud y respuesta.
  2. Medir la latencia o tiempo que tardan en comunicarse dos puntos remotos y de esta forma detectar posibles problemas en las conexiones de red.
  3. Localizar una IP correspondiente a un dominio Web.


Usage

ping [options] <destination>

Options

  <destination>      dns name or ip address
  -a                 use audible ping
  -A                 use adaptive ping
  -B                 sticky source address
  -c <count>         stop after <count> replies
  -C                 call connect() syscall on socket creation
  -D                 print timestamps
  -d                 use SO_DEBUG socket option
  -e <identifier>    define identifier for ping session, default is random for
                     SOCK_RAW and kernel defined for SOCK_DGRAM
                     Imply using SOCK_RAW (for IPv4 only for identifier 0)
  -f                 flood ping
  -h                 print help and exit
  -I <interface>     either interface name or address
  -i <interval>      seconds between sending each packet
  -L                 suppress loopback of multicast packets
  -l <preload>       send <preload> number of packages while waiting replies
  -m <mark>          tag the packets going out
  -M <pmtud opt>     define mtu discovery, can be one of <do|dont|want>
  -n                 no dns name resolution
  -O                 report outstanding replies
  -p <pattern>       contents of padding byte
  -q                 quiet output
  -Q <tclass>        use quality of service <tclass> bits
  -s <size>          use <size> as number of data bytes to be sent
  -S <size>          use <size> as SO_SNDBUF socket option value
  -t <ttl>           define time to live
  -U                 print user-to-user latency
  -v                 verbose output
  -V                 print version and exit
  -w <deadline>      reply wait <deadline> in seconds
  -W <timeout>       time to wait for response

IPv4 options:
  -4                 use IPv4
  -b                 allow pinging broadcast
  -R                 record route
  -T <timestamp>     define timestamp, can be one of <tsonly|tsandaddr|tsprespec>

IPv6 options:
  -6                 use IPv6
  -F <flowlabel>     define flow label, default is random
  -N <nodeinfo opt>  use icmp6 node info query, try <help> as argument


  1. $ ping 192.168.113.254
    

    Hace infinitas peticiones de respuesta hasta que se corte el proceso con Ctr+C

  2. $ ping www.google.es -c 5
    

    Hace solo 5 peticiones de respuesta y además nos mostrará la IP pública de ese nombre.

  • doc/tec/net/cmd/ping/inicio.txt
  • Última modificación: 2026/04/09 09:31
  • por fepg