ARP

(arp)


显示和修改“地址解析协议”(ARP) 所使用的到以太网的 IP 或令牌环物理地址翻译表。

该命令只有在安装了 TCP/IP 协议之后才可用。

arp -a [inet_addr] [-N [if_addr]]

arp -d inet_addr [if_addr]

arp -s inet_addr ether_addr [if_addr]

 

参数

-a

通过询问 TCP/IP 显示当前 ARP 项。如果指定了 inet_addr 则只显示指定计算机的IP 和物理地址。

 

-g

-a 相同。

 

inet_addr

以加点的十进制标记指定 IP 地址。

 

-N

显示由 if_addr 指定的网络界面 ARP 项。

 

if_addr

指定需要修改其地址转换表接口的 IP 地址(如果有的话)。如果不存在,将使用第一个可适用的接口。

 

-d

删除由 inet_addr 指定的项。

 

-s

ARP 缓存中添加项,将 IP 地址 inet_addr 和物理地址 ether_addr 关联:物理地址由以连字符分隔的 6 十六进制字节给定。使用带点的十进制标记指定 IP 地址。项是永久性的,即在超时到期后项自动从缓存删除。

 

ether_addr

指定物理地址。

 


Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP).

 

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.

  -g            Same as -a.

  inet_addr     Specifies an internet address.

  -N if_addr    Displays the ARP entries for the network interface specified  by if_addr.

  -d            Deletes the host specified by inet_addr. inet_addr may be wildcarded with * to delete all hosts.

  -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.

  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.

Example:

  > arp -s 157.55.85.212   00-aa-00-62-c6-09  .... Adds a static entry.

  > arp -a                                    .... Displays the arp table.