GO KALI FREE
Networking Commands

ping Linux Command

Sends ICMP echo request packets to test network connectivity to a host.

What does ping do?

Sends ICMP echo request packets to test network connectivity to a host.

Syntax

ping [options] host

Practical example

ping -c 4 google.com

Questions about ping

How do I limit the number of pings?

Use `ping -c 4 hostname` to send exactly 4 pings and stop. Without `-c`, ping continues until you press Ctrl+C.

How do I set the ping interval?

Use `ping -i 2 hostname` to ping every 2 seconds (default is 1 second). You cannot set intervals below 0.2 seconds.

What does ping -c 4 google.com do?

Sends 4 ICMP echo request packets to google.com and displays the response times. This tests network connectivity and measures latency.

How do I ping a specific port?

Ping only works with ICMP protocol, not specific ports. Use `nc -zv host port` or `telnet host port` to test port connectivity.

How do I increase ping count for statistics?

Use `ping -c 100 hostname` to send 100 packets. At the end, ping shows statistics like packet loss percentage and min/max/avg round-trip times.

How do I set packet size for ping?

Use `ping -s 1024 hostname` to send 1024-byte packets. The default is 56 bytes (64 with ICMP header).

How do I do a flood ping?

Use `sudo ping -f hostname` for flood pinging (requires root). This sends packets as fast as possible and is useful for stress testing.

What does 'Request timed out' mean in ping?

It means the host did not respond within the timeout period. This could indicate the host is down, a firewall is blocking ICMP, or there is a network issue.

Related Networking Commands

nmap

Network exploration tool and port scanner (basic usage).

ifconfig

Displays or configures network interface parameters (deprecated, use ip).

iwconfig

Displays and configures wireless network interface parameters.

ip

Modern replacement for ifconfig. Shows and manipulates routing, devices, and tunnels.

hostname

Shows or sets the system's hostname.

netstat

Displays network connections, routing tables, interface statistics, and more.