概念
地址解析协议,即ARP(Address Resolution Protocol),是根据IP地址获取物理地址的一个TCP/IP协议。主机发送信息时将包含目标IP地址的ARP请求广播到局域网络上的所有主机,并接收返回消息,以此确定目标的物理地址。
命令详解
C:\Users\sunzhengbo>arpDisplays and modifies the IP-to-Physical address translation tables used byaddress resolution protocol (ARP).ARP -s inet_addr eth_addr [if_addr]ARP -d inet_addr [if_addr]ARP -a [inet_addr] [-N if_addr] [-v]-a Displays current ARP entries by interrogating the currentprotocol data. If inet_addr is specified, the IP and Physicaladdresses for only the specified computer are displayed. Ifmore than one network interface uses ARP, entries for each ARPtable are displayed.-g Same as -a.-v Displays current ARP entries in verbose mode. All invalidentries and entries on the loop-back interface will be shown.inet_addr Specifies an internet address.-N if_addr Displays the ARP entries for the network interface specifiedby if_addr.-d Deletes the host specified by inet_addr. inet_addr may bewildcarded with * to delete all hosts.-s Adds the host and associates the Internet address inet_addrwith the Physical address eth_addr. The Physical address isgiven as 6 hexadecimal bytes separated by hyphens. The entryis permanent.eth_addr Specifies a physical address.if_addr If present, this specifies the Internet address of theinterface 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.
显示arp树
C:\Users\sunzhengbo>arp -aInterface: 192.168.9.188 --- 0x4Internet Address Physical Address Type192.168.9.1 34-96-72-02-48-ae dynamic192.168.9.147 a4-97-b1-cd-05-fb dynamic192.168.9.162 7c-11-cb-54-c6-42 dynamic192.168.9.179 00-11-32-6e-3a-7c dynamic192.168.9.199 be-aa-a7-52-18-ab dynamic192.168.9.254 1c-7d-22-1c-73-b6 dynamic192.168.9.255 ff-ff-ff-ff-ff-ff static224.0.0.2 01-00-5e-00-00-02 static224.0.0.22 01-00-5e-00-00-16 static224.0.0.251 01-00-5e-00-00-fb static224.0.0.252 01-00-5e-00-00-fc static239.11.20.1 01-00-5e-0b-14-01 static239.255.255.250 01-00-5e-7f-ff-fa static255.255.255.255 ff-ff-ff-ff-ff-ff staticInterface: 192.168.217.1 --- 0xaInternet Address Physical Address Type192.168.217.254 00-50-56-f3-48-6f dynamic192.168.217.255 ff-ff-ff-ff-ff-ff static224.0.0.2 01-00-5e-00-00-02 static224.0.0.22 01-00-5e-00-00-16 static224.0.0.251 01-00-5e-00-00-fb static224.0.0.252 01-00-5e-00-00-fc static239.11.20.1 01-00-5e-0b-14-01 static239.255.255.250 01-00-5e-7f-ff-fa static255.255.255.255 ff-ff-ff-ff-ff-ff staticInterface: 192.168.36.1 --- 0x11Internet Address Physical Address Type192.168.36.254 00-50-56-f5-77-5c dynamic192.168.36.255 ff-ff-ff-ff-ff-ff static224.0.0.2 01-00-5e-00-00-02 static224.0.0.22 01-00-5e-00-00-16 static224.0.0.251 01-00-5e-00-00-fb static224.0.0.252 01-00-5e-00-00-fc static239.11.20.1 01-00-5e-0b-14-01 static239.255.255.250 01-00-5e-7f-ff-fa static255.255.255.255 ff-ff-ff-ff-ff-ff staticInterface: 192.168.0.112 --- 0x15Internet Address Physical Address Type192.168.0.1 24-69-68-fd-61-7f dynamic192.168.0.101 4e-80-73-0b-6e-2d dynamic192.168.0.107 34-96-72-02-48-b0 dynamic192.168.0.109 90-2b-34-d2-e6-a4 dynamic192.168.0.110 94-de-80-aa-84-ab dynamic192.168.0.113 f8-ff-c2-34-4b-4b dynamic192.168.0.115 2c-56-dc-74-8d-a8 dynamic192.168.0.116 00-d8-61-b3-18-1e dynamic192.168.0.119 d8-12-65-77-7b-61 dynamic192.168.0.120 6c-4b-90-25-8e-ab dynamic192.168.0.255 ff-ff-ff-ff-ff-ff static224.0.0.2 01-00-5e-00-00-02 static224.0.0.22 01-00-5e-00-00-16 static224.0.0.251 01-00-5e-00-00-fb static224.0.0.252 01-00-5e-00-00-fc static239.11.20.1 01-00-5e-0b-14-01 static239.255.255.250 01-00-5e-7f-ff-fa static
显示指定网段的arp树
C:\Users\sunzhengbo>arp -a | findstr "192.168.0."Interface: 192.168.0.112 --- 0x15192.168.0.1 24-69-68-fd-61-7f dynamic192.168.0.101 4e-80-73-0b-6e-2d dynamic192.168.0.107 34-96-72-02-48-b0 dynamic192.168.0.109 90-2b-34-d2-e6-a4 dynamic192.168.0.110 94-de-80-aa-84-ab dynamic192.168.0.113 f8-ff-c2-34-4b-4b dynamic192.168.0.115 2c-56-dc-74-8d-a8 dynamic192.168.0.116 00-d8-61-b3-18-1e dynamic192.168.0.119 d8-12-65-77-7b-61 dynamic192.168.0.120 6c-4b-90-25-8e-ab dynamic192.168.0.255 ff-ff-ff-ff-ff-ff static
