Home ยป Arp Command – Syntax, Parameters and Examples

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 of IP addresses and their resolved Ethernet or MAC addresses.

To display the arp cache, simply type the arp command without parameters.

arp

In this article, we will discuss the arp command, its syntax, parameters, examples, and use of arp command.

arp Syntax

syntax

arp [/a [<inetaddr>] [/n <ifaceaddr>]] [/g [<inetaddr>] [-n <ifaceaddr>]] [/d <inetaddr> [<ifaceaddr>]] [/s <inetaddr> <etheraddr> [<ifaceaddr>]]

arp Parameters

The parameters used with the arp command are given below.

ParametersDescription
[/a [<inetaddr>]
[/n <ifaceaddr>]
It displays the current arp cache tables for all interfaces. /n parameter is case-sensitive.
To display the arp cache entry for a specific IP address, use arp /a with the inetaddr parameter, where inetaddr is an IP address.

To display the arp cache table for a specific interface, use the /n ifaceaddr parameter in conjunction with the /a parameter.
[/g [<inetaddr>]
[/n <ifaceaddr>]
It is identical to /a.
[/d <inetaddr> [<ifaceaddr>]It deletes an entry with a specific IP address, where inetaddr is the IP address.

To delete an entry in a table for a specific interface, use the ifaceaddr parameter where ifaceaddr is the IP address assigned to the interface.
[/s <inetaddr> <etheraddr> [<ifaceaddr>]It adds a static entry to the arp cache that resolves the IP address inetaddr to the physical address etheraddr.
/?It displays help at the command prompt.

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

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

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.

Cool Tip: How to use FType Commnd!

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 home page.