网络基本命令-ARP

上一篇 / 下一篇  2009-03-25 11:56:11 / 个人分类:网络

一、基础知识
ARP是一个重要的TCP/IP协议,并且用于确定对应IP地址的网卡物理地址。arp命令的使用,能够使你查看本地计算机 或另一台计算机的ARP高速缓存中的当前内容。此外,使用arp命令,也可以用人工方式输入静态的网卡物理/IP地址,你可能会使用这种方式为缺省网关和 本地服务器等常用主机进行这项操作,有助于减少网络上的信息量。
按照缺省设置,ARP高速缓存中的项目是动态的,每当发送一个指定地点的 数据报且高速缓存中不存在当前项目时,ARP便会自动添加该项目。一旦高速缓存的项目被输入,它们就已经开始走向失效状态。因此,如果ARP高速缓存中项 目很少或根本没有时,请不要奇怪,通过另一台计算机或路由器的ping命令即可添加。所以,需要通过arp命令查看高速缓存中的内容时,请最好先ping 此台计算机(不能是本机发送ping命令)。
usage:
Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP).(显示和修改“地址解析协议”(ARP) 所使用的到以太网的 IP 或物理地址翻译表)
ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]

-a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.(通过询问 TCP/IP 显示当前 ARP 项。如果指定了 inet_addr,则只显示指定计算机的 IP 和物理地址)
-g Same as -a.(与 -a 相同)
inet_addr Specifies an internet address.(以加点的十进制标记指定 IP 地址)
-N if_addr Displays the ARP entries for the network interface specified by if_addr.(显示由 if_addr 指定的网络界面 ARP 项)
-d Deletes the host specified by inet_addr. inet_addr may be wildcarded with * to delete all hosts.(删除由 inet_addr 指定的项)
-s Adds the host and associates the Internet address inet_addr with the Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent.(在 ARP 缓存中添加项,将 IP 地址 inet_addr 和物理地址 ether_addr 关联。物理地址由以连字符分隔的 6 个十六进制字节给定。使用带点的十进制标记指定 IP 地址。项是永久性的,即在超时到期后项自动从缓存删除)
eth_addr Specifies a physical address.(指定物理地址)
if_addr If present, this specifies the Internet address of the interface whose address translation table should be modified.If not present, the first applicable interface will be used..(指定需要修改其地址转换表接口的 IP 地址(如果有的话)。如果不存在,将使用第一个可适用的接口)

二、实例
Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-2000 Microsoft Corp.

C:\>ping 192.168.0.10

Pinging 192.168.0.10 with 32 bytes of data:

Reply from 192.168.0.10: bytes=32 time<10ms TTL=128
Reply from 192.168.0.10: bytes=32 time<10ms TTL=128
Reply from 192.168.0.10: bytes=32 time<10ms TTL=128
Reply from 192.168.0.10: bytes=32 time<10ms TTL=128

Ping statistics for 192.168.0.10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\>arp -a【用于查看高速缓存中的所有项目】

Interface: 192.168.0.65 on Interface 0x2
Internet Address Physical Address Type
192.168.0.10 00-00-00-11-22-33 dynamic
192.168.0.68 00-80-c8-ad-d2-cd dynamic
192.168.0.255 12-50-ba-00-22-98 dynamic

C:\>arp -s 192.168.0.10 00-00-00-11-22-33【向ARP高速缓存中人工输入一个静态项目】

Interface: 192.168.0.65 on Interface 0x02
Internet Address Physical Address Type
192.168.0.10 00-00-00-11-22-33 static【静态的】
192.168.0.68 00-80-c8-ad-d2-cd dynamic【动态的】
192.168.0.255 12-50-ba-00-22-98 dynamic

C:\>arp -d 192.168.0.10

C:\>arp -a
Interface: 192.168.0.65 on Interface 0x02
Internet Address Physical Address Type
192.168.0.68 00-80-c8-ad-d2-cd dynamic
192.168.0.255 12-50-ba-00-22-98 dynamic

具体此命令使用http://www.pconline.com.cn/pcedu/soft/lan/jywgl/10207/79487.html


_addr. The Physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent.(在 ARP 缓存中添加项,将 IP 地址 inet_addr 和物理地址 ether_addr 关联。物理地址由以连字符分隔的 6 个十六进制字节给定。使用带点的十进制标记指定 IP 地址。项是永久性的,即在超时到期后项自动从缓存删除)
eth_addr Specifies a physical address.(指定物理地址)
if_addr If present, this specifies the Internet address of the interface whose address translation table should be modified.If not present, the first applicable interface will be used..(指定需要修改其地址转换表接口的 IP 地址(如果有的话)。如果不存在,将使用第一个可适用的接口)

二、实例
Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-2000 Microsoft Corp.

C:\>ping 192.168.0.10

相关阅读:

TAG: ARP

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-24  
 123456
78910111213
14151617181920
21222324252627
282930    

我的存档

数据统计

  • 访问量: 5091
  • 日志数: 9
  • 建立时间: 2009-03-24
  • 更新时间: 2009-03-25

RSS订阅

Open Toolbar