ARP Command - Syntax, Parameters and Examples
The arp command is used to display and modify the Address Resolution Protocol (ARP) cache. The ARP cache is a table that stores the mapping between IP addresses and MAC addresses.
In this article, we will discuss the arp command, its syntax, parameters, and examples.
ARP Command Syntax
arp [-a [InetAddr] [-N IfaceAddr]] [-g [InetAddr] [-N IfaceAddr]] [-d InetAddr [IfaceAddr]] [-s InetAddr EtherAddr [IfaceAddr]]
ARP Command Parameters
| Parameter | Description |
|---|---|
| -a | Displays the current ARP entries. |
| -g | Same as -a. |
| -d | Deletes the host specified by InetAddr. |
| -s | Adds a static entry to the ARP cache. |
| InetAddr | Specifies an internet address. |
| EtherAddr | Specifies a physical address. |
| IfaceAddr | Specifies the IP address of the interface. |
How to Display the Arp Cache Tables for All Interfaces?
To display the arp cache table for all interfaces, use the following command.
arp -a
The output of the above arp command displays the arp cache table as given below.
Interface: 192.168.1.103 --- 0x5
Internet Address Physical Address Type
192.168.1.1 6c-23-12-4d-34-10 dynamic
192.168.1.101 10-a8-ae-ae-26-2e dynamic
How to Display Arp Cache Table for the Interface Assigned Having IP address?
To display the arp cache table for the interface assigned that is assigned to the IP address 172.28.24.2
arp /a /n 172.28.24.2
```powershell
## How to Display ARP Entries for a Specific IP Address
To display the ARP entry for a specific IP address:
```cmd
arp -a 192.168.1.1
How to Add Static Arp Cache Entry?
To add an entry to the arp cache, use the arp command with the -s option. The -s option specifies the IP address and MAC address of the entry to be added.
To add a static arp cache entry that resolves the IP address 172.28.24.10 to the physical address ff-ff-ff-ff-ff-ff, use the following command.
arp /s 172.28.24.10 ff-ff-ff-ff-ff-ff
How to Delete an Entry from the Arp Cache?
To delete an entry from the arp cache, use the arp command with the -d option. The -d option specifies the IP address of the entry to be deleted.
To delete the entry for the IP address 192.168.1.1, use the following command.
arp -d 192.168.1.1
```powershell
## What is the Use of Arp Command?
The arp command can be used to:
- Display the ARP cache.
- Add entries to the ARP cache
- Delete entries from the ARP cache.
## Conclusion
The arp command is a powerful tool for managing the ARP cache. It can be used to troubleshoot network problems and improve network performance.
You can find more topics about Active Directory tools and PowerShell basics on the [ActiveDirectoryTools](https://activedirectorytools.net/) home page.