• 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. vgextend Command Examples in Linux
  2. ltrace Command Examples in Linux
  3. autorandr: command not found
  4. pvdisplay Command Examples in Linux
  5. Difference between absolute and relative paths in Linux
  6. ldconfig Command Options
  7. unzip: command not found
  8. groupadd Command Examples in Linux
  9. debugfs: command not found
  10. lsdev: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright