ping命令详解_第1页
ping命令详解_第2页
ping命令详解_第3页
ping命令详解_第4页
ping命令详解_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

pingping 命令详解命令详解 系统内置的网络测试工具 ping 1 Ping 命令的语法格式 ping 命令看似小小的一个工具 但它带有许多参数 要完全掌握它的使用方法 还真不容易 要达到熟练使用则更是难下加难 但不管怎样我们还得来看看它 的真面目 首先我们还是从最基本的命令格式入手吧 ping 命令的完整格式如下 ping t a n count l length f i ttl v tos r count s count j Host list k Host list w timeout destination list 从这个命令式中可以看出它的复杂程度 ping 命令本身后面都是它的执行参数 现对其参数作一下详细讲解吧 t 有这个参数时 当你 ping 一个主机时系统就不停的运行 ping 这个命令 直到你按下 Control C a 解析主机的 NETBIOS 主机名 如果你想知道你所 ping 的要机计算机名则 要加上这个参数了 一般是在运用 ping 命令后的第一行就显示出来 n count 定义用来测试所发出的测试包的个数 缺省值为 4 通过这个命 令可以自己定义发送的个数 对衡量网络速度很有帮助 比如我想测试发送 20 个数据包的返回的平均时间为多少 最快时间为多少 最慢时间为多少就可以 通过执行带有这个参数的命令获知 l length 定义所发送缓冲区的数据包的大小 在默认的情况下 windows 的 ping 发送的数据包大小为 32byt 也可以自己定义 但有一个限制 就是最 大只能发送 65500byt 超过这个数时 对方就很有可能因接收的数据包太大而 死机 所以微软公司为了解决这一安全漏洞于是限制了 ping 的数据包大小 f 在数据包中发送 不要分段 标志 一般你所发送的数据包都会通过路 由分段再发送给对方 加上此参数以后路由就不会再分段处理 i ttl 指定 TTL 值在对方的系统里停留的时间 此参数同样是帮助你检查 网络运转情况的 v tos 将 服务类型 字段设置为 tos 指定的值 r count 在 记录路由 字段中记录传出和返回数据包的路由 一般情况 下你发送的数据包是通过一个个路由才到达对方的 但到底是经过了哪些路由 呢 通过此参数就可以设定你想探测经过的路由的个数 不过限制在了 9 个 也就是说你只能跟踪到 9 个路由 s count 指定 count 指定的跃点数的时间戳 此参数和 r 差不多 只 是这个参数不记录数据包返回所经过的路由 最多也只记录 4 个 j host list 利用 computer list 指定的计算机列表路由数据包 连续计算机可以被中间网关分隔 IP 允许的最大数量为 9 k host list 利用 computer list 指定的计算机列表路由数据包 连续计算机不能被中间网关分隔 IP 允许的最大数量为 9 w timeout 指定超时间隔 单位为毫秒 destination list 是指要测试的主机名或 IP 地址 t 参数 t 有这个参数时 当你 ping 一个主机时系统就不停的运行 ping 这个命令 直到你按下 Control C 例如 C WINDOWS ping 192 168 1 188 t Pinging 192 168 1 188 with 32 bytes of data Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 timeping a 192 168 1 100 Pinging 000 192 168 1 100 with 32 bytes of data Reply from 192 168 1 100 bytes 32 time 10ms TTL 128 Reply from 192 168 1 100 bytes 32 time 10ms TTL 128 Reply from 192 168 1 100 bytes 32 time 10ms TTL 128 Reply from 192 168 1 100 bytes 32 timeping a 192 168 0 23 Pinging 9 localdomain 192 168 0 23 with 32 bytes of data Reply from 192 168 0 23 bytes 32 time 10ms TTL 128 Reply from 192 168 0 23 bytes 32 time 10ms TTL 128 Reply from 192 168 0 23 bytes 32 time 10ms TTL 128 Reply from 192 168 0 23 bytes 32 timeping n 10 192 168 1 188 Pinging 192 168 1 188 with 32 bytes of data Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 time 10ms TTL 64 Reply from 192 168 1 188 bytes 32 timeping l 32768 n 10 192 168 1 188 Pinging 192 168 1 188 with 32768 bytes of data Request timed out Reply from 192 168 1 188 bytes 32768 time 12ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 12ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 12ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 9ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 9ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 9ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 9ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 9ms TTL 64 Reply from 192 168 1 188 bytes 32768 time 9ms TTL 64 Ping statistics for 192 168 1 188 Packets Sent 10 Received 9 Lost 1 10 loss Approximate round trip times in milli seconds Minimum 9ms Maximum 12ms Average 9ms 向 IP 为 192 168 1 188 的计算机 发送大小为 32768byt 的数据包 10 个 发送 10 个 返回 9 个 丢失 1 个 返回数据包最短时间为 9ms 最长时间为 12ms 2 Ping 命令的应用 1 测试网络的通畅 我们知道可以用 ping 命令来测试一下网络是否通畅 这在局域网的维护中经常 用到 方法很简单 只需要在 DOS 或 Windows 的开始菜单下的 运行 子项中 用 ping 命令加上所要测试的目标计算机的 IP 地址或主机名即可 目标计算机 要与你所运行 ping 命令的计算机在同一网络或通过电话线或其它专线方式已连 接成一个网络 其它参数可全不加 如要测试台 IP 地址为 196 168 0 23 的工 作站与服务器是否已连网成功 就可以在服务器上运行 ping a 196 168 0 23 即可 如果工作站上 TCP IP 协议工作正常 即会以 DOS 屏幕方 式显示如下所示的信息 C WINDOWS ping a 192 168 0 23 Pinging 9 localdomain 192 168 0 23 with 32 bytes of data Reply from 192 168 0 23 bytes 32 time 10ms TTL 128 Reply from 192 168 0 23 bytes 32 time 10ms TTL 128 Reply from 192 168 0 23 bytes 32 time 10ms TTL 128 Reply from 192 168 0 23 bytes 32 timeping 192 168 0 1 Pinging 192 168 0 1 with 32 bytes of data Request timed out Request timed out Request timed out Request timed out Ping statistics for 192 168 0 1 Packets Sent 4 Received 0 Lost 4 100 loss Approximate round trip times in milli seconds Minimum 0ms Maximum 0ms Average 0ms 为什么不管网络是否连通在提示信息中都会有重复四次一样的信息呢 如上的 Reply from 192 168 1 188 bytes 32768 time 12ms TTL 64 和 Request timed out 那是因为一般系统默认每次用 ping 测试时是发送四个数据包 这些提示就是告诉你所发送的四个数据包的发送情况 2 获取计算机的 IP 地址 利用 ping 这个工具我们可以获取对方计算机的 IP 地址 特别是在局域网中 我们经常是利用 NT 或 WIN2K 的 DHCP 动态 IP 地址服务自动为各工作站分配动态 IP 地址 这时当然我们要知道所要测试的计算机的 NETBIOS 名 也即我们通常 在 网络邻居 中看到的 计算机名 使用 ping 命令时我们只要用 ping 命令 加上目标计算机名即可 如果网络连接正常 则会显示所 ping 的这台机的动态 IP 地址 其实我们完全可以在互联网使用 以获取对方的动态 IP 地址 这一 点对于黑客来说是比较有用的 当然首先的一点就是你先要知道对方的计算机 名 例如 C WINDOWS ping Pinging 218 26 153 214 with 32 bytes of data Request timed out Request timed out Request timed out Request timed out Ping statistics for 218 26 153 214 Packets Sent 4 Received 0 Lost 4 100 loss Approximate round trip times in milli seconds Minimum 0ms

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论