• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Adding static entry into system ARP cache (CentOS/RHEL)

by admin

The arp command is used to view the ARP table or make changes to it. When executed with no arguments, the arp command displays the ARP table:

# arp
Address         HWtype   HWaddress             Flags Mask    Iface
192.168.1.11    ether    30:3a:64:44:a5:02     C             eth0

Sometimes you may want to manually configure the static ARP entry on Linux servers. This post includes steps on how to add a static entry into the system ARP cache.

Temporary change (modification will be lost after system reboot)

1. Add ARP entry into system ARP cache via command:

# arp -s hostname hw_addr

For example:

# arp -s 192.168.0.10 00:23:f6:7c:b9:4d

Permanent change (modification remains after system reboot)

Add 48 bit Ethernet addresses and their corresponding IP numbers into file /etc/ethers, for instance:

# echo "00:23:f6:7c:b9:4d 192.168.0.10" >> /etc/ethers

Deleting arp entry

In the event that a remote system has its network card replaced, it may be necessary to delete an entry from the ARP table. This can be accomplished by using the -d option to the arp command:

# arp -i eth0 -d 192.169.1.11

Once the address has been removed from the ARP table, there should be no need to add the new address manually. The next time the local system uses this IP address, it sends a broadcast request on the appropriate network to determine the new MAC address.

arp: command not found

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to monitor your CPU on debian or ubuntu systems
  2. Command ntpstat Shows unsynchronised (CentOS/RHEL)
  3. GlusterFS – Real Time Data Replication Across Multiple RHEL/CentOS Nodes
  4. CentOS / RHEL : How to find Logical volumes (LVs) contained in Physical Volume (PVs) in LVM
  5. How to install an RPM package into a different directory in CentOS/RHEL/Fedora
  6. yum-config-manager: command not found
  7. A little trick: select a random file or line in the file with shuf
  8. How to Disable Docker Process and docker0 Interface on CentOS/RHEL
  9. chsh Command Examples in Linux
  10. How to format code within web pages

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright