linux ping鍛戒护

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux ping鍛戒护相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/ESS' title='ESS'>ESS   baidu   鍙戦€佹暟鎹寘   avg   鎯呭喌   閫夐」   sock   

ping [閫夐」] destination

ping鍛戒护鍚戠綉缁滀富鏈哄彂閫両CMP鍥炰紶璇锋眰

璇︾粏鎻忚堪锛歱ing浣跨敤ICMP鍗忚寮哄埗ECHO_REQUEST锛堝洖浼犺姹傦級鏁版嵁鎶ヤ粠涓绘満鎴栫綉鍏宠幏鍙朓CMP鍗忚鐨凟CHO_RESPONSE锛堝洖浼犲搷搴旓級銆侲CHO_REQUEST锛堝洖浼犺姹傦級鏁版嵁鎶ワ紙“ping”锛夋湁涓€涓狪P鍜孖CMP澶达紝涔嬪悗鏄竴涓粨鏋勬椂闂村€硷紝鍐嶄箣鍚庢槸涓€涓换鎰忔暟閲忕殑“pad”瀛楄妭锛岀敤浜庡~鍏呮暟鎹寘銆?/p>

 

-b 鍏佽ping缃戝叧鍦板潃
-c count 鍙戦€乧ount娆CHO_REQUEST锛堝洖浼犺姹傦級鏁版嵁鍖呫€傚綋鏈塪eadline閫夐」锛堟渶鍚庢湡闄愶紝-w閫夐」锛夛紝鍦ㄨ秴鏃朵箣鍓嶏紝ping绛夊緟ECHO_REPLY锛堝洖浼犲搷搴旓級鐩村埌count娆°€?-d 鍦ㄦ鍦ㄤ娇鐢ㄧ殑socket锛堝鎺ュ瓧锛変笂璁剧疆SO_DEBUG閫夐」銆傛湰璐ㄤ笂锛孡inux鍐呮牳涓嶄娇鐢ㄦ濂楁帴瀛楅€夐」銆?-f 澶ч噺ping锛屾瀬闄恜ing銆傛瘡涓狤CHO_REQUEST锛堝洖浼犺姹傦級鎵撳嵃涓€涓偣锛屾瘡鏈変竴涓狤CHO_REPLY锛堝洖浼犲搷搴旓級鎵撳嵃涓€涓€€鏍肩锛圔ackspace锛夈€傝繖鏍峰彲浠ュ揩閫熸樉绀轰涪寮冪殑鏁版嵁鍖呮暟閲忋€傚鏋滄病鏈夌粰鍑洪棿闅旓紝瀹冧細灏嗛棿闅旇缃负0锛屽苟鎸夌収瀹冧滑杩斿洖鎴栨瘡绉掔櫨娆$殑閫熷害杈撳嚭鏁版嵁鍖咃紝浠ュ鑰呬负鍑嗐€傚彧鏈夎秴绾х敤鎴锋墠鍙互0闂撮殧浣跨敤姝ら€夐」銆?-i interval 鍙戦€佹瘡涓暟鎹寘涔嬮棿绛夊緟鐨勯棿闅旓紙鍗曚綅绉掞級銆傞粯璁よ缃槸绛夊緟涓€绉掞紝鏋侀檺妯″紡涓嬩笉绛夊緟銆傚彧鏈夎秴绾х敤鎴峰彲浠ヨ缃棿闅斿€煎皬浜?.2绉掋€?-I interface address 灏嗘簮鍦板潃璁剧疆涓烘寚瀹氱殑鎺ュ彛鍦板潃銆傚弬鏁板彲浠ユ槸鏁板瓧IP鍦板潃鎴栬澶囧悕绉般€傚湪ping IPv6 linklocal鍦板潃鏃讹紝姝ら€夐」鏄繀闇€鐨勩€?-l preload 濡傛灉鎸囧畾浜唒reload锛屽垯ping鍙戦€佽澶氫笉绛夊緟鍥炲鐨勬暟鎹寘銆傚彧鏈夎秴绾х敤鎴峰彲浠ラ€夋嫨瓒呰繃3鐨勯鍔犺浇銆?-n 浠呴檺鏁板瓧杈撳嚭銆備笉浼氬皾璇曟煡鎵句富鏈哄湴鍧€鐨勭鍙峰悕绉?-p pattern 浣犲彲浠ユ寚瀹氭渶澶?6涓?ldquo;pad”瀛楄妭鏉ュ~鍏呬綘鍙戦€佺殑鏁版嵁鍖呫€傝繖瀵逛簬璇婃柇缃戠粶涓殑鏁版嵁浠ユ潵闂鏄湁鐢ㄧ殑銆備緥濡?p ff灏嗗鑷村厖婊℃暣涓鍙戦€佸寘銆?-q 闈欓粯杈撳嚭銆傞櫎鍚姩鍜屽畬鎴愭椂鐨勬憳瑕佽澶栵紝涓嶆樉绀轰换浣曞唴瀹?-r 缁曡繃姝e父鐨勮矾鐢辫〃骞剁洿鎺ュ彂閫佸埌杩炴帴鎺ュ彛涓婄殑涓绘満銆傚鏋滀富鏈轰笉鍦ㄧ洿鎺ヨ繛鎺ョ殑缃戠粶涓婏紝鍒欒繑鍥為敊璇€傚鏋滆繕鏄敤浜?I閫夐」锛屽垯姝ら€夐」鍙敤浜庨€氳繃娌℃湁璺敱鐨勬帴鍙ing鏈湴涓绘満銆?-R 璁板綍绾胯矾銆傚寘鍚獷CHO_REQUEST鏁版嵁鍖呬腑鐨凴ECORD_ROUTE閫夐」锛屽苟鍦ㄨ繑鍥炵殑鏁版嵁鍖呬笂鏄剧ず璺敱缂撳啿鍖恒€傝娉ㄦ剰锛孖P鎶ュご鍙兘瀹圭撼9涓繖鏍风殑璺敱銆傝澶氫富鏈哄拷鐣ユ垨鏀惧純姝ら€夐」銆?-s packetsize 鎸囧畾瑕佸彂閫佺殑鏁版嵁瀛楄妭鏁般€傞粯璁?6锛屽綋涓?瀛楄妭鐨処CMP澶存暟鎹粍鍚堟椂锛岃浆鎹负64涓狪CMP鏁版嵁瀛楄妭銆?-t ttl 璁剧疆IP鐢熷瓨鏃堕棿鍊硷紙TTL锛?-v 璇︾粏杈撳嚭
-w deadline 鎸囧畾涓€涓互绉掍负鍗曚綅鐨勯€€鍑烘椂闂达紝涓嶇ping閫€鍑轰箣鍓嶅彂閫佹垨鎺ユ敹浜嗗灏戞暟鎹寘銆傚湪杩欑鎯呭喌涓嬶紝ping灏嗕竴鐩村彂閫佹暟鎹寘锛岀洿鍒癲eadline杩囨湡鎴朿ount鎺㈤拡缁撴潫鎴栦竴浜涙潵鑷綉缁滅殑閿欒閫氱煡銆?/pre>

 

瀹炰緥锛?/strong>

1銆乸ing 缃戝叧

[xf@xuexi ~]$ ping 192.168.128.255
Do you want to ping broadcast? Then -b. If not, check your local firewall rules.
[xf@xuexi ~]$ ping -b 192.168.128.255
WARNING: pinging broadcast address
PING 192.168.128.255 (192.168.128.255) 56(84) bytes of data.
64 bytes from 192.168.128.212: icmp_seq=1 ttl=64 time=0.621 ms
64 bytes from 192.168.128.213: icmp_seq=1 ttl=64 time=0.922 ms (DUP!)
64 bytes from 192.168.128.2: icmp_seq=1 ttl=64 time=2.30 ms (DUP!)
64 bytes from 192.168.128.218: icmp_seq=1 ttl=64 time=75.6 ms (DUP!)
64 bytes from 192.168.128.251: icmp_seq=1 ttl=64 time=76.1 ms (DUP!)
64 bytes from 192.168.128.212: icmp_seq=2 ttl=64 time=0.646 ms
64 bytes from 192.168.128.2: icmp_seq=2 ttl=64 time=1.20 ms (DUP!)
64 bytes from 192.168.128.213: icmp_seq=2 ttl=64 time=1.46 ms (DUP!)
64 bytes from 192.168.128.218: icmp_seq=2 ttl=64 time=91.8 ms (DUP!)
64 bytes from 192.168.128.251: icmp_seq=2 ttl=64 time=92.3 ms (DUP!)

 

2銆乸ing鎸囧畾娆℃暟

[xf@xuexi ~]$ ping -c 5 baidu.com
PING baidu.com (123.125.115.110) 56(84) bytes of data.
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=1 ttl=51 time=31.6 ms
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=2 ttl=51 time=31.4 ms
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=3 ttl=51 time=31.4 ms
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=4 ttl=51 time=31.4 ms
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=5 ttl=51 time=31.3 ms
--- baidu.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 31.392/31.480/31.677/0.189 ms

3銆乸ing鎸囧畾鏃堕棿闂撮殧

[xf@xuexi ~]$ ping -c 5 -i 0.5 baidu.com
PING baidu.com (220.181.57.216) 56(84) bytes of data.
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=1 ttl=54 time=29.5 ms
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=2 ttl=54 time=29.4 ms
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=3 ttl=54 time=29.8 ms
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=4 ttl=54 time=30.1 ms
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=5 ttl=54 time=29.7 ms
--- baidu.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 29.468/29.747/30.100/0.230 ms

 

以上是关于linux ping鍛戒护的主要内容,如果未能解决你的问题,请参考以下文章

Linux鍩虹鍛戒护

Linux绯荤粺-鍛戒护琛屽揩鎹烽敭

Linux甯哥敤鍛戒护

Linux甯哥敤鍛戒护

Linux涔媎f鍛戒护

Linux甯哥敤鍛戒护