Ping: Unterschied zwischen den Versionen

Aus Foxwiki
Rafihanifi (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
KKeine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
=Bezeichnung=
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 ('''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.


=Intallation=
= Beschreibung =
= Installation =
Die Programme ping und ping6 sind in jeder Installation bereits enthalten und im Paket '''iputils-ping''' integriert.
Die Programme ping und ping6 sind in jeder Installation bereits enthalten und im Paket '''iputils-ping''' integriert.


=Syntax=
= Syntax =
Der Befehl hat die folgende, allgemeine Syntax:
Der Befehl hat die folgende, allgemeine Syntax:
 
$ ping OPTIONEN IP-ADRESSE
ping OPTIONEN IP-ADRESSE


Anstelle der IP-Adresse kann auch ein Host-Name angegeben werden. Es wird dann versucht, diesen in eine DNS-Adresse aufzulösen.
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
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.
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
Es gibt zwei Varianten des ping-Befehl
Zeile 23: Zeile 20:
  $ping www.google.com      >>  zeigt uns ip von google     
  $ping www.google.com      >>  zeigt uns ip von google     
  64 bytes from ams15s33-in-f4.1e100.net (172.217.20.68): icmp_seq=1 ttl=119 time=15.8 m
  64 bytes from ams15s33-in-f4.1e100.net (172.217.20.68): icmp_seq=1 ttl=119 time=15.8 m
== Parameter ==
== Optionen ==
'''-4'''
Use IPv4 only.


=OPTIONS=
'''-6'''
      '''-4'''
Use IPv6 only.
          Use IPv4 only.


      '''-6'''
'''-a'''
          Use IPv6 only.
Audible ping.


      '''-a'''
'''-A'''
          Audible ping.
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.


      '''-A'''
'''-b'''
          Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered
Allow pinging a broadcast address.
          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'''
'''-B'''
          Allow pinging a broadcast address.
Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.


      '''-B'''
'''-c''' count
          Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.
Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.


      '''-c''' count
'''-d'''
          Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.


      '''-d'''
'''-D'''
          Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.
Print timestamp (unix time + microseconds as in gettimeofday) before each line.


      '''-D'''
'''-f'''
          Print timestamp (unix time + microseconds as in gettimeofday) before each line.
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'''
'''-F''' flow label
          Flood ping. For every ECHO_REQUEST sent a period “.” is printed, while for every ECHO_REPLY received a backspace is printed. This provides a
IPv6 only. Allocate and set 20 bit flow label (in hex) on echo request packets. If value is zero, kernel allocates random flow label.
          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
'''-h'''
          IPv6 only. Allocate and set 20 bit flow label (in hex) on echo request packets. If value is zero, kernel allocates random flow label.
Show help.


      '''-h'''
'''-i''' interval
          Show help.
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''' interval
'''-I''' interface
          Wait interval seconds between sending each packet. Real number allowed with dot as a decimal separator (regardless locale setup). The default
interface is either an address, an interface name or a VRF name. If interface is an address, it sets source address to specified interface
          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
address. If interface is an interface name, it sets source interface to specified interface. If interface is a VRF name, each packet is
          0.2 seconds.
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.


      '''-I''' interface
'''-l''' preload
          interface is either an address, an interface name or a VRF name. If interface is an address, it sets source address to specified interface
If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.
          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
'''-L'''
          If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.
Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.


      '''-L'''
'''-m''' mark
          Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.
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''' mark
'''-M''' pmtudisc_opt
          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
Select Path MTU Discovery strategy. pmtudisc_option may be either do (prohibit fragmentation, even local one), want (do PMTU discovery,
          specific outbound processing.
fragment locally when packet size is large), or dont (do not set DF flag).


      '''-M''' pmtudisc_opt
'''-N''' nodeinfo_option
          Select Path MTU Discovery strategy.  pmtudisc_option may be either do (prohibit fragmentation, even local one), want (do PMTU discovery,
IPv6 only. Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request. CAP_NET_RAW capability is required.
          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.
= Anwendungsbeispiele =


= Konfiguration =
== Dateien ==


= Anwendungen =
{|class="wikitable"
{|class="wikitable"
!Option !! Beispiele
!Option !! Beispiele
Zeile 111: Zeile 110:
|}
|}


=Ping und [[Netzwerke:MTU|MTU]]=
== Ping und [[Netzwerke:MTU|MTU]] ==
 
* Die im Befehl ping angegebene Größe entspricht der Anzahl der zu sendenden Datenbytes.  
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.  
* 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==
==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


$ ping -s 1500 -c 10 -M do <Hostname>
= Testfragen =
 
<div class="toccolours mw-collapsible mw-collapsed">
=Quelle=
''Testfrage 1''
https://wiki.ubuntuusers.de/ping/
<div class="mw-collapsible-content">'''Antwort1'''</div>
 
</div>
https://www.tecchannel.de/a/tcp-ip-tuning-fuer-linux,429773,2
<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]]
[[Category:Linux:Netzwerke]]

Version vom 22. März 2022, 01:08 Uhr

ping (Packed Internet Grouper) ist ein Programm / Befehl zum Prüfen der Erreichbarkeit von anderen Rechnern oder Geräten über ein (beliebiges) Netzwerk.

Beschreibung

Installation

Die Programme ping und ping6 sind in jeder Installation bereits enthalten und im Paket iputils-ping integriert.

Syntax

Der Befehl hat die folgende, allgemeine Syntax:

$ ping OPTIONEN IP-ADRESSE

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 www.google.com       >>  zeigt uns ip von google    
64 bytes from ams15s33-in-f4.1e100.net (172.217.20.68): icmp_seq=1 ttl=119 time=15.8 m

Parameter

Optionen

-4 Use IPv4 only.

-6 Use IPv6 only.

-a Audible ping.

-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.

Konfiguration

Dateien

Anwendungen

Option Beispiele
-c ANZAHL $ ping -c 10 itw-berlin.net
-w ENDE $ ping -w 15 itw-berlin.net
-W AUSZEIT $ ping -W 015 itw-berlin.net
-i INTERVALL $ ping -i 15 itw-berlin.net
-I SCHNITTSTELLE $ ping -I enp2s0 ($ ip a)itw-berlin.net

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.

Beispiel

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

Dokumentation

Man-Pages

Info-Pages

Links

Intern

Weblinks

Testfragen

Testfrage 1

Antwort1

Testfrage 2

Antwort2

Testfrage 3

Antwort3

Testfrage 4

Antwort4

Testfrage 5

Antwort5