ping命令
私密日志
小字体 上一篇 下一篇 返回私密日志列表 miinm
转为日志| 编辑 | 删除 Joy & sorrow 保存于2010年05月11日 11:40
常用网络命令使用
一、实验目的
l 了解系统网络命令及其所代表的含义,以及所能对网络进行的操作。
l 过网络命令了解网络状态,并利用网络命令对网络进行简单的操作。
二、实验设备
实验机房,计算机安装的是Windows 98/2000/XP操作系统
三、背景知识
Windows操作系统本身带有多种网络命令,利用这些网络命令可以对网络进行简单的操作。需要注意是这些命令均是在DOS命令行下执行。本次实验学习最常用的网络命令。
l Ping命令
验证与远程计算机的连接。该命令只有在安装了 TCP/IP 协议后才可以使用。
ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j computer-list] | [-k computer-list]] [-w timeout] destination-list
参数
-t 指定的计算机直到中断。
C:\>ping 172.16.109.103 -t
Pinging 172.16.109.103 with 32 bytes of data:
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Reply from 172.16.109.103: bytes=32 time<1ms TTL=64
Ping statistics for 172.16.109.103:
Packets: Sent = 9, Received = 9, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C
^C Ctrl+Break查看统计信息,Ctrl+C结束命令
-a 将地址解析为计算机名。
-n count 发送 count 指定的 ECHO 数据包数。默认值为 4 。
-l length 发送包含由 length 指定的数据量的 ECHO 数据包。默认为 32 字节;最大值是 65,527 。
-f 在数据包中发送“不要分段”标志。数据包就不会被路由上的网关分段。
-i ttl 将“生存时间”字段设置为 ttl 指定的值。
-v tos 将“服务类型”字段设置为 tos 指定的值。
-r count 在“记录路由”字段中记录传出和返回数据包的路由。 count 可以指定最少 1 台,最多 9 台计算机。
-s count 指定 count 指定的跃点数的时间戳。
-j computer-list 利用 computer-list 指定的计算机列表路由数据包。连续计算机可以被中间网关分隔(路由稀疏源) IP 允许的最大数量为 9 。
-k computer-list 利用 computer-list 指定的计算机列表路由数据包。连续计算机不能被中间网关分隔(路由严格源) IP 允许的最大数量为 9 。
-w timeout
指定超时间隔,单位为毫秒。
destination-list 指定要 ping 的远程计算机。
l ipconfig命令
C:\>ipconfig
Windows IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 172.16.109.103
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 172.16.109.1
ipconfig是windows操作系统中用于查看主机的IP配置命令,其显示信息中还包括主机网卡的MAC地址信息。该命令还可释放动态获得的IP地址并启动新一次的动态IP分配请求。
l ipconfig/all
C:\>ipconfig/all
Windows IP Configuration
Host Name . . . . . . . . . . . . : xxgc02
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Broadcom NetLink (TM) Gigabit Ethern
et
Physical Address. . . . . . . . . : 00-15-58-E5-E3-6B
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 172.16.109.103
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 172.16.109.1
DNS Servers . . . . . . . . . . . : 202.103.24.68
l ARP 显示和修改 IP 地址与物理地址之间的转换表
-a 显示当前的 ARP 信息,可以指定网络地址,不指定显示所有的表项
-g 跟 -a 一样 .
-d 删除由 inet_addr 指定的主机 . 可以使用 * 来删除所有主机 .
-s 添加主机,并将网络地址跟物理地址相对应,这一项是永久生效的。
eth_addr 物理地址 .
if_addr 网卡的 IP 地址
InetAddr 代表指定的 IP 地址
l tracert命令:判断数据包到达目的主机所经过的路径,显示数据包经过的中继节点的清单和到达时间
C:\>tracert
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.
C:\>tracert https://www.360docs.net/doc/4d14572386.html,
Tracing route to https://www.360docs.net/doc/4d14572386.html, [119.75.213.61]
over a maximum of 30 hops:
1 1 ms 10 ms 16 ms 172.16.109.1
2 7 ms 10 ms 9 ms 2.1.1.1.in-addr.arpa [1.1.1.2]
3 <1 ms <1 ms <1 ms 2.0.16.172.in-addr.arpa [172.16.0.2]
4 10 ms 10 ms 10 ms 219.140.59.89
5 ^C
l netstat:让用户了解到自己的主机是怎样与Internet连接的,显示
当前正在活动的网络连接
netstat-r:显示路由表信息
netstat-s:显示每个协议的状态,包括TCP﹨UDP﹨ICMP等
netstat-n:以数字表格形式显示已经建立连接的IP地址和端口。
netstat-a:查看所有的连接
C:\>netstat -r
Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 15 58 e5 e3 6b ...... Broadcom NetLink (TM) Gigabit Ethernet - Rising
RfwBase Driver
============================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 172.16.109.1 172.16.109.103 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
172.16.109.0 255.255.255.0 172.16.109.103 172.16.109.103 20
172.16.109.103 255.255.255.255 127.0.0.1 127.0.0.1 20
172.16.255.255 255.255.255.255 172.16.109.103 172.16.109.103 20
224.0.0.0 240.0.0.0 172.16.109.103 172.16.109.103 20
255.255.255.255 255.255.255.255 172.16.109.103 172.16.109.103 1
Default Gateway: 172.16.109.1
======================================================================
二、带红色字体的文字写出命令的格式和执行结果
小字体 上一篇 下一篇 返回私密日志列表
评论列表
腾讯公司温馨提示:当前已出现通过网络、电话和短信等途径假冒中奖网站、“400”“0898”开头电话、宣称低价购物、购房退税等手段诈骗,请您提高警惕,慎防遭骗。识别更多网络骗术,请点击:腾讯反骗术帮助中心。取消批量删除批量删除全选删除
上一篇 下一篇 返回私密日志列表