Windows ARP Command – Display and Clear ARP Cache
The following tutorial explains how to use the arp
command in Windows to view and clear the ARP cache.
The Windows operating system maintains an ARP CacheāA table that contains the recent mappings of IP addresses to MAC addresses. The arp
command is the Windows command we use to view and modify the ARP table.
Command Options
The Windows arp
command has only a couple of options: -a
to view the ARP cache and -d
to clear the ARP cache.
-a | Use this option to display the ARP table. |
-d | Use this option to clear the ARP cache. |
-s | Use this option to add manual entries to the ARP table. |
You can run the arp
command from both CMD and Windows PowerShell.
Display ARP Table
To view the ARP cache on a Windows system, run the following command:
arp -a
Running arp -a
on Windows shows output similar to the following:
If the computer has multiple network interfaces, you will see an ARP table under each interface. We can view the ARP table of a specific interface with the -N
option by specifying the IP address of the NIC.
arp -a -N 192.168.1.245
Clear ARP Cache
To clear the ARP cache, we use the -d
option, as shown in the following example:
arp -d
The above command deletes all entries from the ARP table. To delete a single entry from the table, specify the IP address of the destination host, as shown in the following example:
arp -d 10.0.0.10
In the above example, the arp
command deletes the MAC address associated with host 10.0.0.10
.
Add a Static Entry to the ARP Table
The -s
option of the Windows arp
command allows administrators to add manual entries to the ARP cache. To add a static entry, you will run the arp
command as follows:
arp -s 10.0.0.20 00-aa-00-62-c6-09
In the arp -a
output, static entries are marked as "static" in the type column.
Address Resolution Protocol
ARP stands for Address Resolution Protocol. It is a TCP/IP protocol that resolves the MAC address of a destination host.
When the host_a needs to send a packet to host_b, it needs to know the MAC address of host_b. If host_a does not know the MAC address of host_b, it will send a broadcast message to the network asking for the MAC address (all devices in the local network receive this message).
Once the broadcast message is received, host_b responds to host_a with its MAC address. This process is known as Address Resolution.