概念

地址解析协议,即ARP(Address Resolution Protocol),是根据IP地址获取物理地址的一个TCP/IP协议主机发送信息时将包含目标IP地址的ARP请求广播到局域网络上的所有主机,并接收返回消息,以此确定目标的物理地址。

命令详解

  1. C:\Users\sunzhengbo>arp
  2. Displays and modifies the IP-to-Physical address translation tables used by
  3. address resolution protocol (ARP).
  4. ARP -s inet_addr eth_addr [if_addr]
  5. ARP -d inet_addr [if_addr]
  6. ARP -a [inet_addr] [-N if_addr] [-v]
  7. -a Displays current ARP entries by interrogating the current
  8. protocol data. If inet_addr is specified, the IP and Physical
  9. addresses for only the specified computer are displayed. If
  10. more than one network interface uses ARP, entries for each ARP
  11. table are displayed.
  12. -g Same as -a.
  13. -v Displays current ARP entries in verbose mode. All invalid
  14. entries and entries on the loop-back interface will be shown.
  15. inet_addr Specifies an internet address.
  16. -N if_addr Displays the ARP entries for the network interface specified
  17. by if_addr.
  18. -d Deletes the host specified by inet_addr. inet_addr may be
  19. wildcarded with * to delete all hosts.
  20. -s Adds the host and associates the Internet address inet_addr
  21. with the Physical address eth_addr. The Physical address is
  22. given as 6 hexadecimal bytes separated by hyphens. The entry
  23. is permanent.
  24. eth_addr Specifies a physical address.
  25. if_addr If present, this specifies the Internet address of the
  26. interface whose address translation table should be modified.
  27. If not present, the first applicable interface will be used.
  28. Example:
  29. > arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.
  30. > arp -a .... Displays the arp table.

显示arp树

  1. C:\Users\sunzhengbo>arp -a
  2. Interface: 192.168.9.188 --- 0x4
  3. Internet Address Physical Address Type
  4. 192.168.9.1 34-96-72-02-48-ae dynamic
  5. 192.168.9.147 a4-97-b1-cd-05-fb dynamic
  6. 192.168.9.162 7c-11-cb-54-c6-42 dynamic
  7. 192.168.9.179 00-11-32-6e-3a-7c dynamic
  8. 192.168.9.199 be-aa-a7-52-18-ab dynamic
  9. 192.168.9.254 1c-7d-22-1c-73-b6 dynamic
  10. 192.168.9.255 ff-ff-ff-ff-ff-ff static
  11. 224.0.0.2 01-00-5e-00-00-02 static
  12. 224.0.0.22 01-00-5e-00-00-16 static
  13. 224.0.0.251 01-00-5e-00-00-fb static
  14. 224.0.0.252 01-00-5e-00-00-fc static
  15. 239.11.20.1 01-00-5e-0b-14-01 static
  16. 239.255.255.250 01-00-5e-7f-ff-fa static
  17. 255.255.255.255 ff-ff-ff-ff-ff-ff static
  18. Interface: 192.168.217.1 --- 0xa
  19. Internet Address Physical Address Type
  20. 192.168.217.254 00-50-56-f3-48-6f dynamic
  21. 192.168.217.255 ff-ff-ff-ff-ff-ff static
  22. 224.0.0.2 01-00-5e-00-00-02 static
  23. 224.0.0.22 01-00-5e-00-00-16 static
  24. 224.0.0.251 01-00-5e-00-00-fb static
  25. 224.0.0.252 01-00-5e-00-00-fc static
  26. 239.11.20.1 01-00-5e-0b-14-01 static
  27. 239.255.255.250 01-00-5e-7f-ff-fa static
  28. 255.255.255.255 ff-ff-ff-ff-ff-ff static
  29. Interface: 192.168.36.1 --- 0x11
  30. Internet Address Physical Address Type
  31. 192.168.36.254 00-50-56-f5-77-5c dynamic
  32. 192.168.36.255 ff-ff-ff-ff-ff-ff static
  33. 224.0.0.2 01-00-5e-00-00-02 static
  34. 224.0.0.22 01-00-5e-00-00-16 static
  35. 224.0.0.251 01-00-5e-00-00-fb static
  36. 224.0.0.252 01-00-5e-00-00-fc static
  37. 239.11.20.1 01-00-5e-0b-14-01 static
  38. 239.255.255.250 01-00-5e-7f-ff-fa static
  39. 255.255.255.255 ff-ff-ff-ff-ff-ff static
  40. Interface: 192.168.0.112 --- 0x15
  41. Internet Address Physical Address Type
  42. 192.168.0.1 24-69-68-fd-61-7f dynamic
  43. 192.168.0.101 4e-80-73-0b-6e-2d dynamic
  44. 192.168.0.107 34-96-72-02-48-b0 dynamic
  45. 192.168.0.109 90-2b-34-d2-e6-a4 dynamic
  46. 192.168.0.110 94-de-80-aa-84-ab dynamic
  47. 192.168.0.113 f8-ff-c2-34-4b-4b dynamic
  48. 192.168.0.115 2c-56-dc-74-8d-a8 dynamic
  49. 192.168.0.116 00-d8-61-b3-18-1e dynamic
  50. 192.168.0.119 d8-12-65-77-7b-61 dynamic
  51. 192.168.0.120 6c-4b-90-25-8e-ab dynamic
  52. 192.168.0.255 ff-ff-ff-ff-ff-ff static
  53. 224.0.0.2 01-00-5e-00-00-02 static
  54. 224.0.0.22 01-00-5e-00-00-16 static
  55. 224.0.0.251 01-00-5e-00-00-fb static
  56. 224.0.0.252 01-00-5e-00-00-fc static
  57. 239.11.20.1 01-00-5e-0b-14-01 static
  58. 239.255.255.250 01-00-5e-7f-ff-fa static

显示指定网段的arp树

  1. C:\Users\sunzhengbo>arp -a | findstr "192.168.0."
  2. Interface: 192.168.0.112 --- 0x15
  3. 192.168.0.1 24-69-68-fd-61-7f dynamic
  4. 192.168.0.101 4e-80-73-0b-6e-2d dynamic
  5. 192.168.0.107 34-96-72-02-48-b0 dynamic
  6. 192.168.0.109 90-2b-34-d2-e6-a4 dynamic
  7. 192.168.0.110 94-de-80-aa-84-ab dynamic
  8. 192.168.0.113 f8-ff-c2-34-4b-4b dynamic
  9. 192.168.0.115 2c-56-dc-74-8d-a8 dynamic
  10. 192.168.0.116 00-d8-61-b3-18-1e dynamic
  11. 192.168.0.119 d8-12-65-77-7b-61 dynamic
  12. 192.168.0.120 6c-4b-90-25-8e-ab dynamic
  13. 192.168.0.255 ff-ff-ff-ff-ff-ff static