实验六网络命令(ARP、PING)的使用分析一、实验目的
掌握掌握ARP、PING命令的操作使用
二、实验环境
用以太网交换机连接起来的WIN2000操作系统计算机
三、实验内容及步骤:
1、ARP命令的使用
2、PING命令的操作使用
四、实验过程
1、ARP命令
1)arp命令的功能:查看、添加和删除高速缓存区中的ARP表项
2)Windows 2000 ARP高速缓冲区
∙动态表项(dynamic):随时间推移自动添加和删除
∙静态表项(static):一直存在,直到人为删除或重新启动
3)arp命令操作:
(1)显示高速cache中的ARP表:命令arp -a
添加ARP静态表项:
arp-s inet_addr ether_addr
在ARP 缓存中添加项,将IP 地址inet_addr 和物理地址ether_addr 关联。
例:arp -s 192.168.0.100 00-d0-09-f0-33-71
添加ip为192.168.0.100,与其对应的MAC为00-d0-09-f0-33-71的表项
删除ARP表项:
arp -d inet_addr 删除由inet_addr指定的项
2、PING命令
Ping命令的全称叫做Ping.exe,是微软提供用来进行网络连接测试的十分有用的工具,能准确快速地判断出网络故障。
1)Windows 2000的ping命令形式
ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] 目的主机/IP地址
2)连续发送ping探测报文: ping –t 192.168.0.88 Ctrl+Break查看统计信息,Ctrl+C结束命令
3)自选数据长度的ping探测报文: ping 目的主机/IP地址-l size 4)不允许对ping探测报分片:ping 目的主机/IP地址-f
5.修改“ping”命令的请求超时时间
ping 目的主机/IP地址-w
指定等待每个回送应答的超时时间,单位为毫秒,默认值为1000毫秒
6)假设目前使用的服务器设置如下:
DNS 服务器的IP 地址:202.99.96.98
61.136.18.10
网关:10.10.0.1
本机IP 地址:10.10.0.77
子网掩码:255.255.255.0
(1)验证网卡工作正常与否:
点击“开始”→“程序”→“MS-DOS 方式” ,提示符后输入“ Ping 10.10.0.77(本机IP地址)”回车运行,若出现如下图A ,则说明网卡工作正常。
若出现如下图B ,则说明网卡工作不正常。
图A
C:\>ping 10.10.0.77
Pinging 10.10.0.77 with 32 bytes of data:
Reply from 10.10.0.77: bytes=32 time<10ms TTL=128
Reply from 10.10.0.77: bytes=32 time<10ms TTL=128
Reply from 10.10.0.77: bytes=32 time<10ms TTL=128
Reply from 10.10.0.77: bytes=32 time<10ms TTL=128
Ping statistics for 10.10.0.77:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
图B
C:\>ping 10.10.0.77
Pinging 10.10.0.77 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 10.10.0.77:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
(2)验证网络线路正常与否:
点击“开始”→“程序”→“MS-DOS 方式” ,提示符后输入“ Ping 10.10.0.1(网关)”回车运行,若出现如上图A ,则说明网卡工作正常。
若出现如上图B ,则说明网卡工作不正常。
(地址改为:10.10.0.1)
(3)验证DNS 配置正确与否:
点击“开始”→“程序”→“MS-DOS 方式” ,提示符后输入任一域名(如),看其是否能被解析成一个IP 地址。
如输入“ Ping ”若出现如图C 所示,说明DNS 服务器配置正确;若出现“unknow host name”的提示信息,说明DNS 配置错误。
图C
C:\>ping
Pinging [202.99.64.102] with 32 bytes of data:
Reply from 202.99.64.102: bytes=32 time=181ms TTL=252
Reply from 202.99.64.102: bytes=32 time=180ms TTL=252
Reply from 202.99.64.102: bytes=32 time=180ms TTL=252
Reply from 202.99.64.102: bytes=32 time=160ms TTL=252
Ping statistics for 202.99.64.102:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 160ms, Maximum = 181ms, Average = 175ms
(4)验证网关配置正确与否:
点击“开始”→“程序”→“MS-DOS 方式” ,提示符后输入任一域外主机IP,看看从网络内主机向域外主机发送IP 包能否送出。
如输入“ Ping 202.99.64.102 若出现如图D 所示,说明网关配置正确,若出现如图E 所示,说明网关配置不正确,
图D
C:\>ping 202.99.64.102
Pinging 202.99.64.102 with 32 bytes of data:
Reply from 202.99.64.102: bytes=32 time=10ms TTL=252
Reply from 202.99.64.102: bytes=32 time=10ms TTL=252
Reply from 202.99.64.102: bytes=32 time=10ms TTL=252
Reply from 202.99.64.102: bytes=32 time=11ms TTL=252
Ping statistics for 202.99.64.102:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 11ms, Average = 10ms
图E C:\>ping 202.99.64.102
Pinging 202.99.64.102 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 202.99.64.102:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
五、实验总结:
通过这个实验让学生掌握了ARP、PING命令的操作使用。
六、实验思考题:
利用ping命令如何检查网络故障?。