大网数据广告活动
服务器运维问答

ping command is not printing result to the console

· 52CE 我爱测

When I am trying to ping the server, the output of ping command is not coming to the console. ads@3290:~#ping ksr-india01 PING ksr-india01.uit.com (10.105.34.184) 56(84) bytes of data. ^C --- ksr-india01.uit.com ping statistics -…

问题原文

原帖链接 · user583819 · CC BY-SA 4.0

When I am trying to ping the server, the output of ping command is not coming to the console.

ads@3290:~#ping ksr-india01
PING ksr-india01.uit.com (10.105.34.184) 56(84) bytes of data.
^C
--- ksr-india01.uit.com  ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 5999ms

if you see until i pressed the ctrl+c , no output came. I believe that even though server is unreachable then also ping should print the some info. Something like this

Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6

but it is not printing. Can anyone please tell me what is the setting I am missing

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

This is normal behavior.

The Linux version of ping does not print any output if there is no reply or ICMP error response to the ping. Nor is there an option to cause it to print any such reply.

Note that ping will print a line if an ICMP error is returned from a router somewhere on the network, but you are not guaranteed to receive this ICMP error reply if the remote host is not on your LAN; any router between you and the destination may drop it, or it might not have been generated at all.

The Windows version of ping does print a line if the request times out. Perhaps this is where you have seen such a thing before?

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-07-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。