-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
不停的ping地方LQ直C按下Control-C?br />
此功能没有什么特别的技巧,不过可以配合其他参数使用Q将在下面提到?br />
-a Resolve addresses to hostnames.
解析计算机NetBios名?br />
CZQ?br />
C:Q?gt;ping -a 192.168.1.21
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Ping statistics for 192.168.1.21:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
从上面就可以知道IP?92.168.1.21的计机NetBios名ؓ(f)iceblood.yofor.com?br />
-n count Number of echo requests to send.
发送count指定的Echo数据包数?br />
在默认情况下Q一般都只发送四个数据包Q通过q个命o(h)可以自己定义发送的个数Q对衡量|络速度很有帮助Q比如我x试发?0个数据包的返回的q_旉为多,最快时间ؓ(f)多少Q最慢时间ؓ(f)多少可以通过以下L(fng)Q?br />
C:Q?gt;ping -n 50 202.103.96.68
Pinging 202.103.96.68 with 32 bytes of data:
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Request timed out.
………………
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Ping statistics for 202.103.96.68:
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
Minimum = 40ms, Maximum = 51ms, Average = 46ms
从以上我可以知道在l?02.103.96.68发?0个数据包的过E当中,q回?8个,其中有两个由于未知原因丢失,q?8个数据包当中q回速度最快ؓ(f)40msQ最慢ؓ(f)51msQ^均速度?6ms?br />
-l size Send buffer size.
定义echo数据包大?br />
在默认的情况下windows的ping发送的数据包大ؓ(f)32bytQ我们也可以自己定义它的大小Q但有一个大的限制Q就是最大只能发?5500bytQ也许有Z(x)问ؓ(f)什么要限制?65500bytQ因为Windowspd的系l都有一个安全漏z(也许q包括其他系l)(j)是当向Ҏ(gu)一ơ发送的数据包大于或{于65532ӞҎ(gu)很有可能当机,所以微软公ؓ(f)?jin)解册一安全漏洞于是限制?jin)ping的数据包大小。虽然微软公司已l做?jin)此限制Q但q个参数配合其他参数以后危害依然非常强大Q比如我们就可以通过配合-t参数来实C个带有攻?yn)L的命o(h)Q(以下介绍带有危险性,仅用于试验,请勿L施于别h机器上,否则后果自负Q?br />
C:Q?gt;ping -l 65500 -t 192.168.1.21
Pinging 192.168.1.21 with 65500 bytes of data:
Reply from 192.168.1.21: bytes=65500 time<10ms TTL=254
Reply from 192.168.1.21: bytes=65500 time<10ms TTL=254
………………
q样它就?x)不停的?92.168.1.21计算机发送大ؓ(f)65500byt的数据包Q如果你只有一台计机也许没有什么效果,但如果有很多计算机那么就可以使对方完全瘫痪,我曾l就做过q样的试验,当我同时使用10C上计机ping一台Win2000Propȝ的计机Ӟ不到5分钟Ҏ(gu)的网l就已经完全瘫痪Q网l严重堵塞,HTTP和FTP服务完全停止Q由此可见威力非同小可?br />
-f Set Don't Fragment flag in packet.
在数据包中发?#8220;不要分段”标志?br />
在一般你所发送的数据包都?x)通过路由分段再发送给Ҏ(gu)Q加上此参数以后路由׃?x)再分段处理?br />
-i TTL Time To Live.
指定TTL值在Ҏ(gu)的系l里停留的时间?br />
此参数同h帮助你检查网l运转情늚?br />
-v TOS Type Of Service.
?#8220;服务cd”字段讄?tos 指定的倹{?br />
-r count Record route for count hops.
?#8220;记录路由”字段中记录传出和q回数据包的路由?br />
在一般情况下你发送的数据包是通过一个个路由才到辑֯方的Q但到底是经q了(jin)哪些路由呢?通过此参数就可以讑֮你想探测l过的\q个数Q不q限制在?个,也就是说你只能跟t到9个\由,如果x更多,可以通过其他命o(h)实现Q我在以后的文章中l大家讲解。以下ؓ(f)CZQ?br />
C:Q?gt;ping -n 1 -r 9 202.96.105.101 Q发送一个数据包Q最多记?个\由)(j)
Ping statistics for 202.96.105.101:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 10ms, Average = 10ms
-w timeout Timeout in milliseconds to wait for each reply.
指定时间隔Q单位ؓ(f)毫秒?br />
此参数没有什么其他技巧?br />
ping命o(h)的其他技巧:(x)在一般情况下q可以通过 pingҎ(gu)让对方返回给你的TTL值大,_略的判断目标主机的pȝcd是Windowspdq是UNIX/LinuxpdQ一般情况下Windows pd的系l返回的TTL值在100-130之间Q而UNIX/Linuxpd的系l返回的TTL值在240-255之间Q当然TTL的值在Ҏ(gu)的主机里是可以修改的QW(xu)indowspd的系l可以通过修改注册表以下键值实玎ͼ(x)
Windows下ping命o(h)怿大家已经再熟(zhn)不q了(jin)Q但是能把ping的功能发挥到最大的人却q不
是很多,当然我也q不是说我可以让ping发挥最大的功能Q我也只不过l常用pingq个工具Q?br />
也ȝ?jin)一些小l验Q现在和大家分n一下?br />
现在我就参照ping命o(h)的帮助说明来l大家说说我使用ping时会(x)用到的技巧,ping只有在安
装了(jin)TCP/IP协议以后才可以用:(x)
ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s coun
t] [-j computer-list] | [-k computer-list] [-w timeout] destination-list
Options:
-t Ping the specified host until stopped.To see statistics and continue - type C
ontrol-Break;To stop - type Control-C.
不停的ping地方LQ直C按下Control-C?br />
此功能没有什么特别的技巧,不过可以配合其他参数使用Q将在下面提到?br />
-a Resolve addresses to hostnames.
解析计算机NetBios名?br />
CZQC:Q?gt;ping -a 192.168.1.21
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
Ping statistics for 192.168.1.21:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times
in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
从上面就可以知道IP?92.168.1.21的计机NetBios名ؓ(f)iceblood.yofor.com?br />
-n count Number of echo requests to send.
发送count指定的Echo数据包数?br />
在默认情况下Q一般都只发送四个数据包Q通过q个命o(h)可以自己定义发送的个数Q对衡量
|络速度很有帮助Q比如我x试发?0个数据包的返回的q_旉为多,最快时间ؓ(f)多少
Q最慢时间ؓ(f)多少可以通过以下L(fng)Q?br />
C:Q?gt;ping -n 50 202.103.96.68
Pinging 202.103.96.68 with 32 bytes of data:
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Request timed out.
………………
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
Ping statistics for 202.103.96.68:
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip tim
es in milli-seconds:
Minimum = 40ms, Maximum = 51ms, Average = 46ms
从以上我可以知道在l?02.103.96.68发?0个数据包的过E当中,q回?8个,其中有两
个由于未知原因丢失,q?8个数据包当中q回速度最快ؓ(f)40msQ最慢ؓ(f)51msQ^均速度?6m
s?br />