We have always been using ping command ever since the network begun. Ping has been in the service for gazillions of echo requests and replies locally and/or from the web. Almost everybody doing link connectivity test between two points is familiar with ping command. Ping command is available in many worlds of operating system and IP address domain. You can easily find them installed by default OS installation. Not only sysads, even newbies and non-techies who's currently beginning to enter the world of connectivity troubleshooting never crawl google index to search for more ping explanation.
Ping command as compared to a new kid's world is like a new bike, just hit the pedal with your feet and your bike will move forward then. Ping results is more likely provides the same concept of the bike. The ping command result, host reachable or not reachable is what matter most.
As ping command is so easy and widely used, even grandma can manage to ping grandpa from the other room, this entry is here to explain and document more of ping arguments and usage details, which might be helpful to others hopefully.
PING definition
~~~~~~~~~~~~~~~~~
Wikipedia says:
ping is a computer network tool used to test whether a particular host is reachable across an IP network. It works by sending ICMP “echo request” packets to the target host and listening for ICMP “echo response” replies. ping estimates the round-trip time, generally in milliseconds, and records any packet loss, and prints a statistical summary when finished.
The word ping is also frequently used as a verb or noun, where it can refer directly to the round-trip time, the act of running a ping program or measuring the round-trip time.
PING USAGE
~~~~~~~~~~~
The simplest way to use ping from any operating system is to supply it with an IP address without further consideration to DNS issue and current IP address of working host, like so:
# ping 192.168.0.1
This is the usual way to ping an IPv4 based host. The above assumes that 192.168.0.1 is the host we wish to get ICMP ECHO RESPONSE reply from.
To send a specified or limited number of ECHO REQUEST packets, simply use -c argument like so
# ping -c2 192.168.0.1
-c followed by 2 is the number of ICMP ECHO REQUEST we wish to send forth against the target host . The above command sends out 2 ICMP ECHO REQUEST to target host.
To ping a broadcast address using ping on a subnetted IP network or network class, simply
# ping -b 192.168.0.31
The above command assumes a broadcast IP address of 192.168.0.31 for /27 subnet class.
To send ping with interval mode between each ping, this can be done like so
# ping -i 3 192.168.0.1
which sends out a single echo request every 3 seconds against the target host. This is also handy as some target host are too sensitive and have too high ping thresholds against echo request that immediately triggers ping flood attack, which might cause blockage to your current host.
A ping source address can also be specified with ping. This is where ping echo request would be released from ifever your current host has several virtual IP address or multiple network card interface.
# ping -I eth0:0 192.168.0.1
# ping -I eth1 192.168.1.1
To use ping flood would be
# ping -f localhost
which display . for every ping echo request sent and prints a backspace for every ICMP reply received
To send out ping packets while displaying host route path found along the round trip travel of ping packets would be like so
# ping -R 192.168.0.1
This could be visually handy with those hidden routers, firewalls, or gateways that has transparent port forwarding enabled and being supported.
To customize and change the default IP time to live or TTL values with ping would be like
# ping -t 1 192.168.0.1
Ping sends out ping echo request packet size of 64 ICMP bytes including data headers. To send out a customized ping packet size
# ping -s 24 192.168.0.1
changes ping echo request packet size from 56 down to 24, excluding the ICMP data header.
To specify in seconds a forced termination of ping commands would be
# ping -w 5 192.168.0.1
which forcefully but gracefully terminates the issue ping command after 5 seconds.
To ping an IPv6 IP address would be as follows
# ping6 -I eth0 fe80::203:47ff:fe31:5569
# ping6 -c 3 -I eth1 fe80::203:47ff:fe31:556a
Ping arguments can be combined when needed so.
A sample ping command would be
# ping 192.168.60.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64 bytes from 192.168.60.1: icmp_seq=1 ttl=255 time=4.19 ms
64 bytes from 192.168.60.1: icmp_seq=2 ttl=255 time=1.05 ms
64 bytes from 192.168.60.1: icmp_seq=3 ttl=255 time=1.02 ms
--- 192.168.60.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 1.025/2.092/4.197/1.488 ms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Legend:
Notes: that icmp_seq displays the number of ping echo request being sent which appears in consecutive number patterns for normal ping echo replies.
From above results, 3 ICMP echo request packets have been transmitted, and 3 ICMP echo replies have been received with default 255 TTL. A round trip icmp echo reply average of 2.092 ms for the whole ping round trip transmitted and received, that is 0% packet loss in total stats.
Multiple host pinging using ping is not possible via command line unless you create a script to feed in IP address from it. However, there are alternatives to ping multiple host, one of them is using the linux command fping.
For a more verbosed mode would be the usual verbose mode parameter -v and for more a quite mode would be -q, the usual parameter with most handy linux tools.
By default, ping is installed as world executable and and readable binary.
FINAL NOTE:
~~~~~~~~~~~
Remember that issuing ping command can not guarantee anybody a reachable host connectivity between two or more hosts. Any failed ICMP reply does not mean a dead target host as well. Ping does not consider target host's setup, firewalls, and routers in between the travel path. Ping ignorantly assumes that the target host and the path is open for ICMP echo replies from requesting ICMP echo request host.
So happy pinging!
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2007
(340)
-
▼
September
(58)
- Dear Linux SysAd Blog Readers
- Proactive monitoring from linux terminal
- deleting new lines and return line from text file
- Google chat setup using PSI howto
- PSI messenger - a truly promising open messaging a...
- Google chat setup using GAIM Pidgin howto
- Linux command line shell variables defined
- ls - displaying directory contents in many ways
- Control of alternative linux executables
- Searching using whereis linux command
- Witchy which linux command
- NeroLinux - diehard Nero burning software
- Google Sky - Explore and Rediscover the Sky
- Celestia - 3D Earth and Sky visualization
- Earth3D - real-time 3D Earth visualization
- GcStar - managing personal collection items
- DStat - resource statistics linux tool
- Bandwidth Monitor-NG - terminal-based interface ba...
- KNemo - KDE network interface monitoring tool
- EtherApe - graphical network activity monitoring tool
- Beauty of Math using Linux
- print leading/trailing lines before/after a matchi...
- Nagios Monitoring - install and generic setup howto
- ChRT- change real-time attribute process scheduling
- squeezed out multiple commented lines
- UNIX to DOS text file format converter
- totally squeezed out multiple blank lines
- squeezed multiple blank lines into single line
- fmt - simple optimal text formatter
- Linux backup powered by RDiff-Backup
- Linux Ping command explained
- read and display text file from terminal
- URLView - URL and email extractor
- TFTP server - setup and install howto
- NMap - Linux port scanning
- removing garbage characters from screen terminal
- invert string match using grep
- RDesktop - remote desktop howto
- Graveman on Linux - burn baby burn burn
- HTOP - interactive process viewer alternative
- Caching DNS server install howto
- BitTorrent - downloading large files made easy
- PHPAlbum - web photo album install howto
- MRTG graph creation with Cisco routers
- Tree view of directories and file listings from co...
- MAC address packet filtering using IPTables
- GTK-based GNOME Linux Tools
- Linux backups powered by RSnapShot
- MRTG tutorial, install and howtos
- FindSMB - view shared folders from network
- Squid - upgrade and install howto
- prompt and press a key between script lines
- Devede - DVD/VCD video authoring and creation tool
- display file and file system status
- determine file type
- GNOME GUI task scheduler install howto
- Linux backups powered by Rsync
- KPackage - GUI package administration and manageme...
-
▼
September
(58)
Tuesday, September 11, 2007
Linux Ping command explained
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment