Zum Inhalt springen

Ping: Unterschied zwischen den Versionen

Aus Foxwiki
KKeine Bearbeitungszusammenfassung
 
(150 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
ping ('''P'''acked '''I'''nternet '''G'''rouper) ist ein Programm / Befehl zum Prüfen der Erreichbarkeit von anderen Rechnern oder Geräten über ein (beliebiges) Netzwerk.
'''ping''' - Erreichbarkeit eines Netzwerkknotens prüfen


= Beschreibung =
== Beschreibung ==
= Installation =
Erreichbarkeit eines Netzwerkknotens mit einem [[ICMP]] [[ECHO_REQUEST]] prüfen
Die Programme ping und ping6 sind in jeder Installation bereits enthalten und im Paket '''iputils-ping''' integriert.


= Syntax =
; PING - Packed INternet Grouper
Der Befehl hat die folgende, allgemeine Syntax:
Prüft die Erreichbarkeit eines Netzwerkknotens durch Senden eines ICMP ECHO_REQUEST
$ ping OPTIONEN IP-ADRESSE
* '''[[ping]]''' prüft die Verbindung zu einem Zielsystem, indem es einen '''Echo Request''' sendet und einen '''Echo Reply''' erwartet


Anstelle der IP-Adresse kann auch ein Host-Name angegeben werden. Es wird dann versucht, diesen in eine DNS-Adresse aufzulösen.
$ '''ping google.de'''
  $ ping OPTIONEN 10.10.0.1
PING google.de(ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003)) 56 data bytes
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=1 ttl=119 time=25.7 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=2 ttl=119 time=22.9 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=3 ttl=119 time=22.6 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=4 ttl=119 time=22.9 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=5 ttl=119 time=23.1 ms
^C
  --- google.de ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 22.572/23.416/25.650/1.130 ms


Man muss ping entweder händisch stoppen '''(mit Strg + C )''' oder mit der entsprechenden Option die Anzahl der gesendeten Pakete begrenzen.
== Installation ==
[[ping]] ist Teil des Pakets [[iputils-ping]]


Es gibt zwei Varianten des ping-Befehl
== Aufruf ==
ping - für IPv4-Adressen
<syntaxhighlight lang="bash" highlight="1" line copy>
ping6 - für IPv6-Adressen
</syntaxhighlight>


$ping www.google.com      >>  zeigt uns ip von google   
=== Optionen ===
64 bytes from ams15s33-in-f4.1e100.net (172.217.20.68): icmp_seq=1 ttl=119 time=15.8 m
{| class="wikitable sortable options gnu big"
== Parameter ==
|-
== Optionen ==
! Unix !! GNU !! Parameter !! Beschreibung
'''-4'''
|-
Use IPv4 only.
| || || ||
|-
|}


'''-6'''
=== Parameter ===
Use IPv6 only.
=== Umgebungsvariablen ===
=== Exit-Status ===
{| class="wikitable options col1center big"
|-
! Wert !! Beschreibung
|-
| 0 || Erfolg
|-
| >0  || Fehler
|}


'''-a'''
== Anwendung ==
Audible ping.
<syntaxhighlight lang="bash" highlight="1" line copy>
</syntaxhighlight>


'''-A'''
<!-- output -->
Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered
<syntaxhighlight lang="bash" highlight="" line>
probe is present in the network. Minimal interval is 200msec unless super-user. On networks with low RTT this mode is essentially equivalent
</syntaxhighlight>
to flood mode.


'''-b'''
; "Nur ein Ping"
Allow pinging a broadcast address.
-c ANZAHL
$ ping -c 10 foxtom.de


'''-B'''
-w ENDE || $ ping -w 15 foxtom.de ||
Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.
-W AUSZEIT || $ ping -W 015 foxtom.de ||
-i INTERVALL || $ ping -i 15 foxtom.de ||
-I SCHNITTSTELLE || $ ping -I enp2s0 ($ ip a)foxtom.de ||


'''-c''' count
=== Ping und MTU ===
Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
* Die im Befehl ping angegebene Größe entspricht der Anzahl der zu sendenden Datenbytes.
* Diese muss also 28 Byte kleiner sein als die tatsächliche Paketgröße, um die Größe des Paket-Headers zu berücksichtigen.
* Dieser lässt sich recht einfach über Bordmittel des Betriebssystems bestimmen.
* siehe [[MTU]]


'''-d'''
'''Beispiel'''
Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.
$ ping -s 1500 -c 10 -M do <Hostname>


'''-D'''
Print timestamp (unix time + microseconds as in gettimeofday) before each line.


'''-f'''
=== Problembehebung ===
Flood ping. For every ECHO_REQUEST sent a period “.” is printed, while for every ECHO_REPLY received a backspace is printed. This provides a
* Viele Hosts und Gateways ignorieren die Option RECORD_ROUTE.
rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they
* Die maximale Länge des IP-Headers ist zu gering, als dass Optionen wie RECORD_ROUTE vollständig genutzt werden könnten. Hiergegen lässt sich jedoch nicht viel unternehmen.
come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval.
* Flood-Pinging wird generell nicht empfohlen, und Flood-Pinging der Broadcast-Adresse sollte nur unter streng kontrollierten Bedingungen durchgeführt werden.
 
== Konfiguration ==
=== Dateien ===
{| class="wikitable options big"
|-
! Datei !! Beschreibung
|-
| ||
|-
| ||
|}
 
<noinclude>
 
== Anhang ==
=== Siehe auch ===
<div style="column-count:2">
<categorytree hideroot=on mode="pages">{{BASEPAGENAME}}</categorytree>
</div>
----
{{Special:PrefixIndex/{{BASEPAGENAME}}/}}
----
* [[netstat]](1)
* [[ifconfig]](1)
* [[routed]](8)
 
=== Dokumentation ===
; Man-Page
# [https://manpages.debian.org/stable/inetutils-ping/ping.1.en.html ping(1)]


'''-F''' flow label
<!--
IPv6 only. Allocate and set 20 bit flow label (in hex) on echo request packets. If value is zero, kernel allocates random flow label.
; Info-Pages
-->


'''-h'''
=== Links ===
Show help.
==== Projekt ====
==== Weblinks ====
# https://wiki.ubuntuusers.de/ping/


'''-i''' interval
{{DEFAULTSORT:ping}}
Wait interval seconds between sending each packet. Real number allowed with dot as a decimal separator (regardless locale setup). The default
{{DISPLAYTITLE:ping}}
is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less than
0.2 seconds.


'''-I''' interface
[[Kategorie:Linux/Monitoring]]
interface is either an address, an interface name or a VRF name. If interface is an address, it sets source address to specified interface
[[Kategorie:Linux/Befehl]]
address. If interface is an interface name, it sets source interface to specified interface. If interface is a VRF name, each packet is
[[Kategorie:Linux/Netzwerk/Befehl]]
routed using the corresponding routing table; in this case, the -I option can be repeated to specify a source address. NOTE: For IPv6, when
[[Kategorie:ICMP]]
doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) can be used but it is no
longer required.


'''-l''' preload
</noinclude>
If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.


'''-L'''
= TMP =
Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.
== Aufruf ==
ping [-aAbBdDfhLnOqrRUvV46] [-c count] [-F flowlabel] [-i interval] [-I interface] [-l preload]
[-m mark] [-M pmtudisc_option] [-N nodeinfo_option] [-w deadline] [-W timeout] [-p pattern]
[-Q tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop...] {destination}


'''-m''' mark
Anstelle der IP-Adresse kann auch ein Host-Name angegeben werden. Es wird dann versucht, diesen in eine DNS-Adresse aufzulösen.
use mark to tag the packets going out. This is useful for variety of reasons within the kernel such as using policy routing to select
$ ping OPTIONEN 10.10.0.1
specific outbound processing.


'''-M''' pmtudisc_opt
Man muss ping entweder händisch stoppen '''(mit Strg + C )''' oder mit der entsprechenden Option die Anzahl der gesendeten Pakete begrenzen.
Select Path MTU Discovery strategy.  pmtudisc_option may be either do (prohibit fragmentation, even local one), want (do PMTU discovery,
fragment locally when packet size is large), or dont (do not set DF flag).


'''-N''' nodeinfo_option
; Es gibt zwei Varianten des ping-Befehl
IPv6 only. Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request. CAP_NET_RAW capability is required.
* ping - für IPv4-Adressen
* ping6 - für IPv6-Adressen


= Konfiguration =
$ '''ping foxtom.de'''
== Dateien ==
PING foxtom.de (116.202.118.50) 56(84) bytes of data.
64 bytes from mx10.foxtom.de (116.202.118.50): icmp_seq=1 ttl=54 time=28.5 ms
64 bytes from mx10.foxtom.de (116.202.118.50): icmp_seq=2 ttl=54 time=22.7 ms
64 bytes from mx10.foxtom.de (116.202.118.50): icmp_seq=3 ttl=54 time=22.8 ms
^C
--- foxtom.de ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 22.685/24.664/28.471/2.692 ms


= Anwendungen =
=== Optionen ===
{|class="wikitable"
{| class="wikitable sortable options big"
!Option !! Beispiele
|-
|-
| <nowiki>-c ANZAHL</nowiki> || <tt>$ ping -c 10 itw-berlin.net</tt>
! Option !! Beschreibung
|-
|-
| <nowiki>-w ENDE</nowiki> || <tt>$ ping -w 15 itw-berlin.net </tt>
| -4 || Use IPv4 only.
|-
|-
| <nowiki>-W AUSZEIT</nowiki> ||<tt>$ ping -W 015 itw-berlin.net </tt> 
| -6 || Use IPv6 only.
|-
|-
| <nowiki>-i INTERVALL</nowiki> || <tt>$ ping -i 15 itw-berlin.net </tt>
| -a || Audible ping.
|-
|-
| <nowiki>-I SCHNITTSTELLE</nowiki> || <tt>$ ping -I enp2s0 ($ ip a)itw-berlin.net </tt>
|-A || Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered
probe is present in the network. Minimal interval is 200msec unless super-user. On networks with low RTT this mode is essentially equivalent
to flood mode.
|-
| -b || Allow pinging a broadcast address.
|-
| -B || Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.
|-
| -c count || Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
|-
| -d || Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.
|-
|-D || Print timestamp (unix time + microseconds as in gettimeofday) before each line.
|-
|-f || Flood ping. For every ECHO_REQUEST sent a period "." is printed, while for every ECHO_REPLY received a backspace is printed. This provides a
rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they
come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval.
|-
| -F flow label || IPv6 only. Allocate and set 20 bit flow label (in hex) on echo request packets. If value is zero, kernel allocates random flow label.
|-
| -h || Show help.
|-
|-i interval || Wait interval seconds between sending each packet. Real number allowed with dot as a decimal separator (regardless locale setup). The default
is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less than
0.2 seconds.
|-
|-I interface || interface is either an address, an interface name or a VRF name. If interface is an address, it sets source address to specified interface
address. If interface is an interface name, it sets source interface to specified interface. If interface is a VRF name, each packet is
routed using the corresponding routing table; in this case, the -I option can be repeated to specify a source address. NOTE: For IPv6, when
doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) can be used but it is no
longer required.
|-
|-
| -l preload || If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.
|-
| -L || Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.
|-
| -m mark || use mark to tag the packets going out. This is useful for variety of reasons within the kernel such as using policy routing to select
specific outbound processing.
|-
| -M pmtudisc_opt || Select Path MTU Discovery strategy. pmtudisc_option may be either do (prohibit fragmentation, even local one), want (do PMTU discovery,
fragment locally when packet size is large), or dont (do not set DF flag).
|-
| -N nodeinfo_option || IPv6 only. Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request. CAP_NET_RAW capability is required.
|}
|}


== Ping und [[Netzwerke:MTU|MTU]] ==
=== Paketaufbau ===
* Die im Befehl ping angegebene Größe entspricht der Anzahl der zu sendenden Datenbytes.
[[File:Ping.png|800px]]
* Diese muss also 28 Byte kleiner sein als die tatsächliche Paketgröße, um die Größe des Paket-Headers zu berücksichtigen.
* Dieser lässt sich recht einfach über Bordmittel des Betriebssystems bestimmen.
 
==Beispiel==
$ ping -s 1500 -c 10 -M do <Hostname>
= Dokumentation =
== Man-Pages ==
== Info-Pages ==
= Links =
== Intern ==
== Weblinks ==
* https://wiki.ubuntuusers.de/ping/
* https://www.tecchannel.de/a/tcp-ip-tuning-fuer-linux,429773,2
 
= Testfragen =
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 1''
<div class="mw-collapsible-content">'''Antwort1'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 2''
<div class="mw-collapsible-content">'''Antwort2'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 3''
<div class="mw-collapsible-content">'''Antwort3'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 4''
<div class="mw-collapsible-content">'''Antwort4'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 5''
<div class="mw-collapsible-content">'''Antwort5'''</div>
</div>
 
[[Category:Linux:Netzwerke]]

Aktuelle Version vom 8. November 2025, 08:31 Uhr

ping - Erreichbarkeit eines Netzwerkknotens prüfen

Beschreibung

Erreichbarkeit eines Netzwerkknotens mit einem ICMP ECHO_REQUEST prüfen

PING - Packed INternet Grouper

Prüft die Erreichbarkeit eines Netzwerkknotens durch Senden eines ICMP ECHO_REQUEST

  • ping prüft die Verbindung zu einem Zielsystem, indem es einen Echo Request sendet und einen Echo Reply erwartet
$ ping google.de
PING google.de(ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003)) 56 data bytes
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=1 ttl=119 time=25.7 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=2 ttl=119 time=22.9 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=3 ttl=119 time=22.6 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=4 ttl=119 time=22.9 ms
64 bytes from ham02s17-in-x03.1e100.net (2a00:1450:4005:80b::2003): icmp_seq=5 ttl=119 time=23.1 ms
^C
--- google.de ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 22.572/23.416/25.650/1.130 ms

Installation

ping ist Teil des Pakets iputils-ping

Aufruf

Optionen

Unix GNU Parameter Beschreibung

Parameter

Umgebungsvariablen

Exit-Status

Wert Beschreibung
0 Erfolg
>0 Fehler

Anwendung

"Nur ein Ping"
-c ANZAHL 
$ ping -c 10 foxtom.de
-w ENDE || $ ping -w 15 foxtom.de || 
-W AUSZEIT || $ ping -W 015 foxtom.de || 
-i INTERVALL || $ ping -i 15 foxtom.de || 
-I SCHNITTSTELLE || $ ping -I enp2s0 ($ ip a)foxtom.de || 

Ping und MTU

  • Die im Befehl ping angegebene Größe entspricht der Anzahl der zu sendenden Datenbytes.
  • Diese muss also 28 Byte kleiner sein als die tatsächliche Paketgröße, um die Größe des Paket-Headers zu berücksichtigen.
  • Dieser lässt sich recht einfach über Bordmittel des Betriebssystems bestimmen.
  • siehe MTU

Beispiel

$ ping -s 1500 -c 10 -M do <Hostname>


Problembehebung

  • Viele Hosts und Gateways ignorieren die Option RECORD_ROUTE.
  • Die maximale Länge des IP-Headers ist zu gering, als dass Optionen wie RECORD_ROUTE vollständig genutzt werden könnten. Hiergegen lässt sich jedoch nicht viel unternehmen.
  • Flood-Pinging wird generell nicht empfohlen, und Flood-Pinging der Broadcast-Adresse sollte nur unter streng kontrollierten Bedingungen durchgeführt werden.

Konfiguration

Dateien

Datei Beschreibung


Anhang

Siehe auch



Dokumentation

Man-Page
  1. ping(1)


Links

Projekt

Weblinks

  1. https://wiki.ubuntuusers.de/ping/


TMP

Aufruf

ping [-aAbBdDfhLnOqrRUvV46] [-c count] [-F flowlabel] [-i interval] [-I interface] [-l preload]
[-m mark] [-M pmtudisc_option] [-N nodeinfo_option] [-w deadline] [-W timeout] [-p pattern]
[-Q tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop...] {destination}

Anstelle der IP-Adresse kann auch ein Host-Name angegeben werden. Es wird dann versucht, diesen in eine DNS-Adresse aufzulösen.

$ ping OPTIONEN 10.10.0.1

Man muss ping entweder händisch stoppen (mit Strg + C ) oder mit der entsprechenden Option die Anzahl der gesendeten Pakete begrenzen.

Es gibt zwei Varianten des ping-Befehl
  • ping - für IPv4-Adressen
  • ping6 - für IPv6-Adressen
$ ping foxtom.de
PING foxtom.de (116.202.118.50) 56(84) bytes of data.
64 bytes from mx10.foxtom.de (116.202.118.50): icmp_seq=1 ttl=54 time=28.5 ms
64 bytes from mx10.foxtom.de (116.202.118.50): icmp_seq=2 ttl=54 time=22.7 ms
64 bytes from mx10.foxtom.de (116.202.118.50): icmp_seq=3 ttl=54 time=22.8 ms
^C
--- foxtom.de ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 22.685/24.664/28.471/2.692 ms

Optionen

probe is present in the network. Minimal interval is 200msec unless super-user. On networks with low RTT this mode is essentially equivalent to flood mode. rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval. is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less than 0.2 seconds. address. If interface is an interface name, it sets source interface to specified interface. If interface is a VRF name, each packet is routed using the corresponding routing table; in this case, the -I option can be repeated to specify a source address. NOTE: For IPv6, when doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) can be used but it is no longer required.
Option Beschreibung
-4 Use IPv4 only.
-6 Use IPv6 only.
-a Audible ping.
-b Allow pinging a broadcast address.
-B Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.
-c count Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
-d Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.
-F flow label IPv6 only. Allocate and set 20 bit flow label (in hex) on echo request packets. If value is zero, kernel allocates random flow label.
-h Show help.
-l preload If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.
-L Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.
-m mark use mark to tag the packets going out. This is useful for variety of reasons within the kernel such as using policy routing to select

specific outbound processing.

-M pmtudisc_opt Select Path MTU Discovery strategy. pmtudisc_option may be either do (prohibit fragmentation, even local one), want (do PMTU discovery,

fragment locally when packet size is large), or dont (do not set DF flag).

-N nodeinfo_option IPv6 only. Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request. CAP_NET_RAW capability is required.

Paketaufbau