{"id":678,"date":"2019-04-17T13:27:24","date_gmt":"2019-04-17T05:27:24","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=678"},"modified":"2022-05-04T18:51:01","modified_gmt":"2022-05-04T10:51:01","slug":"ping","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ping","title":{"rendered":"ping\u547d\u4ee4 – \u6d4b\u8bd5\u4e3b\u673a\u95f4\u7f51\u7edc\u8fde\u901a\u6027"},"content":{"rendered":"\n

ping\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u6d4b\u8bd5\u4e3b\u673a\u95f4\u7f51\u7edc\u8fde\u901a\u6027\uff0c\u53d1\u9001\u51fa\u57fa\u4e8eICMP\u4f20\u8f93\u534f\u8bae\u7684\u6570\u636e\u5305\uff0c\u8981\u6c42\u5bf9\u65b9\u4e3b\u673a\u4e88\u4ee5\u56de\u590d\uff0c\u82e5\u5bf9\u65b9\u4e3b\u673a\u7684\u7f51\u7edc\u529f\u80fd\u6ca1\u6709\u95ee\u9898\u4e14\u9632\u706b\u5899\u653e\u884c\u6d41\u91cf\uff0c\u5219\u5c31\u4f1a\u56de\u590d\u8be5\u4fe1\u606f\uff0c\u6211\u4eec\u4e5f\u5c31\u53ef\u5f97\u77e5\u5bf9\u65b9\u4e3b\u673a\u7cfb\u7edf\u5728\u7ebf\u5e76\u8fd0\u884c\u6b63\u5e38\u4e86\u3002<\/p>\n\n\n\n

\u4e0d\u8fc7\u503c\u5f97\u6211\u4eec\u6ce8\u610f\u7684\u662fLinux\u4e0eWindows\u76f8\u6bd4\u6709\u4e00\u5b9a\u5dee\u5f02\uff0cWindows\u7cfb\u7edf\u4e0b\u7684ping\u547d\u4ee4\u4f1a\u53d1\u9001\u51fa\u53bb4\u4e2a\u8bf7\u6c42\u540e\u81ea\u52a8\u7ed3\u675f\u8be5\u547d\u4ee4\uff1b\u800cLinux\u7cfb\u7edf\u5219\u4e0d\u4f1a\u81ea\u52a8\u7ec8\u6b62\uff0c\u9700\u8981\u7528\u6237\u624b\u52a8\u6309\u4e0b\u7ec4\u5408\u952e\u201cCtrl+c\u201d\u624d\u80fd\u7ed3\u675f\uff0c\u6216\u662f\u53d1\u8d77\u547d\u4ee4\u65f6\u52a0\u5165-c\u53c2\u6570\u9650\u5b9a\u53d1\u9001\u4e2a\u6570\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>ping [\u53c2\u6570] \u76ee\u6807\u4e3b\u673a<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-d<\/td>\u4f7f\u7528Socket\u7684SO_DEBUG\u529f\u80fd<\/td><\/tr>
-c<\/td>\u6307\u5b9a\u53d1\u9001\u62a5\u6587\u7684\u6b21\u6570 <\/td><\/tr>
-i<\/td>\u6307\u5b9a\u6536\u53d1\u4fe1\u606f\u7684\u95f4\u9694\u65f6\u95f4 <\/td><\/tr>
-I<\/td>\u4f7f\u7528\u6307\u5b9a\u7684\u7f51\u7edc\u63a5\u53e3\u9001\u51fa\u6570\u636e\u5305<\/td><\/tr>
-l<\/td>\u8bbe\u7f6e\u5728\u9001\u51fa\u8981\u6c42\u4fe1\u606f\u4e4b\u524d\uff0c\u5148\u884c\u53d1\u51fa\u7684\u6570\u636e\u5305 <\/td><\/tr>
-n<\/td>\u53ea\u8f93\u51fa\u6570\u503c <\/td><\/tr>
-p<\/td>\u8bbe\u7f6e\u586b\u6ee1\u6570\u636e\u5305\u7684\u8303\u672c\u6837\u5f0f<\/td><\/tr>
-q<\/td>\u4e0d\u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b<\/td><\/tr>
-R<\/td>\u8bb0\u5f55\u8def\u7531\u8fc7\u7a0b<\/td><\/tr>
-s<\/td>\u8bbe\u7f6e\u6570\u636e\u5305\u7684\u5927\u5c0f <\/td><\/tr>
-t<\/td>\u8bbe\u7f6e\u5b58\u6d3b\u6570\u503cTTL\u7684\u5927\u5c0f<\/td><\/tr>
-v<\/td>\u8be6\u7ec6\u663e\u793a\u6307\u4ee4\u7684\u6267\u884c\u8fc7\u7a0b <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u6d4b\u8bd5\u4e0e\u6307\u5b9a\u7f51\u7ad9\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u7f51\u7edc\u8fde\u901a\u6027\uff08\u9700\u624b\u52a8\u6309\u4e0b\u201cCtrl+c\u201d\u7ec4\u5408\u952e\u7ed3\u675f\u547d\u4ee4\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ping www.linuxcool.com<\/strong>\nPING www.linuxcool.com.w.kunlunar.com (222.85.26.229) 56(84) bytes of data.\n64 bytes from www.linuxcool.com (222.85.26.229): icmp_seq=1 ttl=52 time=22.4 ms\n64 bytes from www.linuxcool.com (222.85.26.229): icmp_seq=2 ttl=52 time=22.4 ms\n64 bytes from www.linuxcool.com (222.85.26.229): icmp_seq=3 ttl=52 time=22.4 ms\n64 bytes from www.linuxcool.com (222.85.26.229): icmp_seq=4 ttl=52 time=22.4 ms\n^C\n--- www.linuxcool.com.w.kunlunar.com ping statistics ---\n5 packets transmitted, 5 received, 0% packet loss, time 4005ms\nrtt min\/avg\/max\/mdev = 22.379\/22.389\/22.400\/0.094 ms<\/pre>\n\n\n\n

\u6d4b\u8bd5\u4e0e\u6307\u5b9a\u7f51\u7ad9\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u7f51\u7edc\u8fde\u901a\u6027\uff0c\u53d1\u9001\u8bf7\u6c42\u5305\u9650\u5b9a\u4e3a4\u6b21\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ping -c 4 www.linuxcool.com<\/strong>\nPING www.linuxcool.com (222.85.26.234) 56(84) bytes of data.\n64 bytes from www.linuxcool.com (222.85.26.234): icmp_seq=1 ttl=52 time=24.7 ms\n64 bytes from www.linuxcool.com (222.85.26.234): icmp_seq=2 ttl=52 time=24.7 ms\n64 bytes from www.linuxcool.com (222.85.26.234): icmp_seq=3 ttl=52 time=24.7 ms\n64 bytes from www.linuxcool.com (222.85.26.234): icmp_seq=4 ttl=52 time=24.7 ms\n\n--- www.linuxcool.com.w.kunlunar.com ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3005ms\nrtt min\/avg\/max\/mdev = 24.658\/24.664\/24.673\/0.111 ms\n<\/pre>\n\n\n\n

\u6d4b\u8bd5\u4e0e\u6307\u5b9a\u4e3b\u673a\u4e4b\u95f4\u7684\u7f51\u7edc\u8fde\u901a\u6027\uff0c\u53d1\u90013\u6b21\u8bf7\u6c42\u5305\uff0c\u6bcf\u6b21\u95f4\u96940.2\u79d2\uff0c\u6700\u957f\u7b49\u5f85\u65f6\u95f4\u4e3a3\u79d2\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ping -c 3 -i 0.2 -W 3 192.168.10.10<\/strong>\n64 bytes from 192.168.10.10: icmp_seq=1 ttl=64 time=0.166 ms\r\n64 bytes from 192.168.10.10: icmp_seq=2 ttl=64 time=0.060 ms\r\n64 bytes from 192.168.10.10: icmp_seq=3 ttl=64 time=0.113 ms\r\n\r\n--- 192.168.10.10 ping statistics ---\r\n3 packets transmitted, 3 received, 0% packet loss, time 410ms\r\nrtt min\/avg\/max\/mdev = 0.060\/0.113\/0.166\/0.043 ms\r<\/pre>\n","protected":false},"excerpt":{"rendered":"

ping\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u6d4b\u8bd5\u4e3b\u673a\u95f4\u7f51\u7edc\u8fde\u901a\u6027\uff0c\u53d1\u9001\u51fa\u57fa\u4e8eICMP\u4f20\u8f93\u534f\u8bae\u7684\u6570\u636e\u5305\uff0c\u8981\u6c42\u5bf9\u65b9\u4e3b\u673a\u4e88\u4ee5\u56de\u590d\uff0c\u82e5\u5bf9\u65b9 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/678"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=678"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/678\/revisions"}],"predecessor-version":[{"id":9276,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/678\/revisions\/9276"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}