An ARP (Address Resolution Protocol) is a communication protocol that works on a “Physical (Data-Link)” layer of a TCP/IP stack and is used to discover a MAC address of a device on a LAN (local-area network) based on its IP address.
An ARP table is used to store the discovered pairs of the MAC and IP addresses.
In this note i will show how to display the ARP table and how to clear the ARP cache using the Windows arp
command.
Windows ARP Command
Show ARP Table
To display the current ARP table in Windows, use the arp
command with the -a
option:
C:\> arp -a Interface: 192.168.1.31 --- 0x7 Internet Address Physical Address Type 192.168.1.1 60-35-c0-6b-a2-b7 dynamic 192.168.1.255 ff-ff-ff-ff-ff-ff static 224.0.0.22 01-00-5e-00-00-16 static 224.0.0.252 01-00-5e-00-00-fc static
Show the ARP table in a verbose mode:
C:\> arp -av
To record an IP and MAC address of a device on a LAN to the ARP table, simply ping
it:
C:\> ping 192.168.1.95
Pinging 192.168.1.95 with 32 bytes of data:
Reply from 192.168.1.952: bytes=32 time=18ms TTL=64
C:\> arp -a
Interface: 192.168.1.31 --- 0x7
Internet Address Physical Address Type
192.168.1.1 60-35-c0-6b-a2-b7 dynamic
192.168.1.95 d6-58-01-33-dd-bc dynamic
192.168.1.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
To discover all the devices on a LAN, you can ping
them all using this one-liner (adjust the IP of your network):
C:\> FOR /L %i IN (1,1,254) DO ping -n 1 -w 100 192.168.1.%i | FIND /i "Reply"
Clear ARP Cache
To start the elevated command prompt, press the ⊞ Win keybutton to open the start menu, type in cmd
to search for the command prompt and press the Ctrl + Shift + Enter to start the command prompt as an administrator.
To clear the ARP cache in Windows, use the arp
command with the -d
option:
C:\> arp -d