Lab
ping, ping6:-
send ICMP ECHO_REQUEST to network hosts. It is use to find connectivity between two nodes. Ping uses ICMP protocol. ping6 is IPv6 version of ping, and can also send Node Information Queries (RFC4620).
Usage:-
ping [-aAbBdDfhLnOqrRUvV] [-c count] [-F flowlabel] [-i interval] [-I interface] [-l preload] [-m mark] [-M pmtudisc_option] [-N node‐info_option] [-w deadline] [-W timeout] [-p pattern] [-Q tos] [-s pack‐ etsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop ...] destination
Options:-
1. ping IP_addr/domain_name
By default ping without any option uses to check network connection between two nodes by sending & receiving packet to & from nodes.
2. ping –a IP_addr/domain_name
Ex. ping –a www.google.com
Audiable ping, it gives beep after every packet transmittion & reception.
3. ping domain_name
Ex. ping www.google.com
Use to find out ip address of specified domain name.
4. ping [–i interval ] IP_addr/domain_name
Ex. ping –i 5 www.google.com
This is used to ping increase/decrese time interval, as mention in command. By default ping takes 1sec interval to send packets but with this utility we can increase/decrease its time interval.
5. ping [-c count] IP_addr/domain_name
Ex. ping –c 4 www.google.com
command cannot stop automatically we have to terminate it with CTRL+c. But with this utility we can specify no. of packet count ping can send , once it done it stop automatically.
6. ping –f IP_addr/domain_name
Ex. ping –f www.google.com
Flood ping. here it send “.” For every ECHO_REQUEST & received backspace for every ECHO_REPLY. So increases output, ping can send thousands of packets in few seconds.
7. ping [-l preload] IP_addr/domain_name
Ex.ping –l 4 www.google.com
If preload option is specified then ping sends that many packets only not waiting for reply. Preload value more than 3 sudo privileges requires.
8. ping [-p pattern] IP_addr
Ex. ping –p aa 127.0.0.1
You may specify up to 16 ``pad'' bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, -p ff will cause the sent packet to be filled with all ones.
9. Ping [-m mark] IP_addr
Ex. ping –m 10 127.0.0.1
This extends ping to send a packet out based on a given mark using -m option. Useful with policy routing to take different paths to same destination.
10. ping –q IP_addr
Ex. ping –q 127.0.0.1
Ping specified with q option nothing print on screen when we terminate command it prints only ping statistics summary.
11. ping [-s pack‐ etsize] IP_addr
Ex. ping –s 110 1270.0.01
Ping with s option , we can modify packet size of ping command. By default its range between 56 to 100. Ping has header size is ‘28’ so packet bytes send by ping in total is = ping packet size + ping header size.
Here total byte send = 110 + 28
= 138
12. ping [-w deadline] IP_addr
Ex. ping –w 4 127.0.0.
Ping by default gives continuous output ,it cannot terminate itself , if we specify ‘w’ g with time then ping will stop automatically after specified time interval given in command.
Time =3998ms(@4sec)
13. ping –R IP_addr
Ex. ping –R 127.0.0.1
Ping with option ‘R’ we can record & prints the network routes through which packets is sent & received.
14. ping [-M pmtudisc_option] IP_addr
Ex .ping –M do 127.0.0.1
Select Path MTU Discovery strategy. Their are three parameter provided with MTU discovery do/don’t/want. These are use along with packet size ,if packet size is greater than maximum data payload depend on MTU parameter specified it takes decision to fragment packet or not.
15. ping IP IP_addr IP_addr
Ex. ping 192.168.2.3 192.168.33.1 192.168.64.1
We can specify path to reach ping packet to destination address. But here its important if any one path is not reachable then the ping fails to send packet to destination address.
16. Ping –D IP_addr
Ex . ping –D 127.0.0.1
It prints time stamp before each line in format (unix time + microseconds as in gettimeofday)
17. ping localhost/127.0.0.1/0
These are the way we can ping to localhost.
18. ping –V
This show the the current version of ping on your machine.