arp command in Linux with examples Last Updated : 24 Nov, 2022 Comments Improve Suggest changes 11 Likes Like Report arp command manipulates the System's ARP cache. It also allows a complete dump of the ARP cache. ARP stands for Address Resolution Protocol. The primary function of this protocol is to resolve the IP address of a system to its mac address, and hence it works between level 2(Data link layer) and level 3(Network layer). Syntax: arp [-v] [-i if] [-H type] -a [hostname] Example: Here we created two machines with name machine1 and machine2 with IP address 10.0.2.4 and 10.0.2.5 Screenshot of hosts before adding Addition of host Hosts file after adding machines Now checking arp for all Options: -v, --verbose: This option shows the verbose information.-n, --numeric: This option shows numerical addresses instead of symbolic host, port or usernames. -H type, --hw-type type, -t type: This tells arp which class of entries it should check for. Default value is ether. List of possible hardware types(which support ARP) are ash(Ash), ether(Ethernet), ax25(AMPR AX.25), netrom (AMPR NET/ROM), rose (AMPR ROSE), arcnet (ARCnet), dlci (Frame Relay DLCI), fddi (Fiber Distributed Data Interface), hippi (HIPPI), irda (IrLAP), x25 (generic X.25), eui64 (Generic EUI-64). -a [hostname] --all: This option is used for showing entries of the specified host. If nothing is passed all entries will be displayed. -d hostname, --delete hostname: Removes any entry for the specified host. If any host is down, there is no need of keeping its entry in arp cache so this command is used to delete those entries explicitly by the user. -D, --use-device: Use the given interface's hardware address. -e: Shows the entries in default(Linux) Style.-i If, --device If: Select an interface. When dumping the ARP cache, only entries matching the specified interface will be printed. Note: This has to be different from the interface to which the IP datagrams will be routed.-s hostname hw_address: Manually create an ARP address mapping entry for the host hostname with its mac address as hw_address. -f filename: Works same as -s but instead of giving the entries manually, it takes entry from the file given as parameter. Some useful flags are: -C: Complete entry.-M: Permanent entry.-P: Published entry. Some useful file related to these data are: /proc/net/arp/etc/networks/etc/hosts//etc/ethers Create Quiz Comment S sshubhamk1 Follow 11 Improve S sshubhamk1 Follow 11 Improve Article Tags : Linux-Unix Explore Linux/Unix Tutorial 5 min read Getting Started with LinuxWhat is Linux Operating System 8 min read LINUX Full Form - Lovable Intellect Not Using XP 2 min read Difference between Linux and Windows 7 min read What are Linux Distributions ? 8 min read Difference between Unix and Linux 5 min read Installation with LinuxHow to Install Arch Linux in VirtualBox? 7 min read Fedora Linux Operating System 12 min read How to install Ubuntu on VirtualBox? 6 min read How to Install Linux Mint? 3 min read How to Install Kali Linux on Windows? 2 min read How to Install Linux on Windows PowerShell Subsystem? 2 min read How to Find openSUSE Linux Version? 2 min read How to Install CentOS 2 min read Linux CommandsLinux Commands 15+ min read Essential Unix Commands 7 min read Find Command in Linux with Examples 7 min read Linux File SystemLinux File System 12 min read Linux File Hierarchy Structure 5 min read Linux Directory Structure 6 min read Linux KernelLinux Kernel 4 min read Kernel in Operating System 3 min read How Linux Kernel Boots? 11 min read Difference between Operating System and Kernel 3 min read Linux Kernel Module Programming: Hello World Program 7 min read Linux Loadable Kernel Module 7 min read Loadable Kernel Module - Linux Device Driver Development 4 min read Linux Networking ToolsNetwork configuration and troubleshooting commands in Linux 5 min read How to configure network interfaces in CentOS? 5 min read Command-Line Tools and Utilities For Network Management in Linux 8 min read Linux - Network Monitoring Tools 4 min read Linux ProcessProcesses in Linux/Unix 5 min read How to Manage Process in Linux 4 min read Getting System and Process Information Using C Programming and Shell in Linux 2 min read Process states and Transitions in a UNIX Process 4 min read Linux FirewallLINUX Firewall 7 min read iptables command in Linux with Examples 7 min read How to Configure your Linux Firewall - 3 Methods 12 min read Shell Scripting & Bash ScriptingIntroduction to Linux Shell and Shell Scripting 7 min read What is Terminal, Console, Shell and Kernel? 5 min read How to Create a Shell Script in linux 7 min read Shell Scripting - Different types of Variables 4 min read Bash Scripting - Introduction to Bash and Bash Scripting 12 min read Bash Script - Define Bash Variables and its types 12 min read Shell Scripting - Shell Variables 6 min read Bash Script - Difference between Bash Script and Shell Script 4 min read Shell Scripting - Difference between Korn Shell and Bash shell 3 min read Shell Scripting - Interactive and Non-Interactive Shell 3 min read Shell Script to Show the Difference Between echo â$SHELLâ and echo â$SHELLâ 4 min read Like