Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the arp command of linux to manipulate the system arp cache

Shulou Source: shulou.com Published: 2022-06-02 16:16:13 10月04日 Update

This article mainly introduces the use of linux arp command manipulation system arp cache, the article is very detailed, has a certain reference value, interested friends must read it!

The English word for arp command is spelled "Address Resolution Protocol". This command is used to manipulate the host's arp cache. It can display all entries in the arp cache, delete specified entries, or add static ip addresses to MAC addresses.

Syntax format: arp [parameters] [IP]

Common parameters:

-a displays all entries in the arp cache, the host bit optional parameter-H specifies the type of address used by the arp instruction-d removes the arp entry for the specified host from the arp cache-D uses the hardware address of the specified interface-e displays the entries in the arp cache in the linux display style-I specifies the network interface to manipulate the arp cache-n displays entries in the arp cache digitally-v displays detailed arp cache entries Includes statistics for cache entries-f sets the static mapping of the host's IP address to MAC address

Reference example

Displays all records in the native arp cache:

[root@linuxcool ~] # arp

Address HWtype HWaddress Flags Mask Iface

Gateway ether 00:03:0f:81:6b:f1 C ens160

Digitally display specified host arp cache entries:

[root@linuxcool] # arp-n 192.168.60.1

Address HWtype HWaddress Flags Mask Iface

192.168.60.1 ether 00:03:0f:81:6b:f1 C ens160

Delete the entry in the arp table of 192.168.60.1 on interface eth2:

[root@linuxcool] # arp-I eth2-d 192.168.60.1

Answer the arp request for 192.168.60.2 on eth0 using the MAC address of eth2:

[root@linuxcool] # arp-I eth0-Ds 192.168.60.2 eth2 pub is all the contents of the arp cache using linux's arp command to manipulate the system. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Cache entry address host command parameter interface system content number method static reference value information full spelling interest instance guy partner Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology vpn Xiaomi NVidia