Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux basic command arp

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the usage of the Linux basic command arp". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the usage of the Linux basic command arp".

Arp

The arp instruction is used to manage the arp buffer of the system, which can display, delete, and add static mac addresses. ARP manipulates the kernel's ARP cache in various ways. The main option is to clear the address mapping entry and set it manually. For debugging purposes, the ARP program also allows a full dump of the ARP cache.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Arp [- evn] [- H type] [- I if]-a [hostname]

Arp [- v] [- I if]-d hostname [pub]

Arp [- v] [- H type] [- I if]-s hostname hw_ addr [temp]

Arp [- v] [- H type] [- I if]-s hostname hw_ addr [netmask nm] pub

Arp [- v] [- H type] [- I if]-Ds hostname ifa [netmask nm] pub

Arp [- vnD] [- H type] [- I if]-f [filename]

2. List of options

Option

Description

-- help

Show help documentation

-- version

Show command version

-H type

-- hw-typetype

-t type

This optional parameter tells ARP what kind of entries to check when setting or reading the ARP cache. The default value for this parameter is ether (that is, the hardware code 0x01 for IEEE 802.3 10 Mbps Ethernet). Other possible values are ARCnet (Arcnet), PROnet (PRINET), AX.25 (Axis 25), and Net/ROM (Netrom).

-a [hostname] |-- all [hostname]

Display the contents of the native arp buffer

-dhostname |-- deletehostname

Removes the specified address type from the buffer

-D |-use-device

Use the mac address of the specified interface

-e

Display in Linux style

-I if |-- device if

Displays the arp buffer for the specified device

-shostnamehw_addr

Sets the mac address mapping for the specified host

-f filename |-- file filename

Similar to the-s option, except that this time the address information is set from filename. The name of the data file is usually "/ etc/ether", but this is not official. If the file name "/ etc/ether" is not specified as the default. The format of this file is simple; it contains only ASCII lines with hardware addresses and hostnames separated by spaces. In addition, you can use the pub, temp, and netmask flags.

-n |-- numeric

Display digitally

-v |-- verbose

Show execution process

In all places where hostnames are needed, people can also enter IP addresses using dotted decimal point notation. As a special case of compatibility, the order of hostnames and hardware addresses can be exchanged. Each complete entry in the ARP cache will be marked with a C flag. Permanent items are marked with M, and published items are marked with the P flag.

3. Examples

1) add static mapping

[root@localhost ~] # arp-I eth0-s 192.168.1.6 ff:ee:ee:ee:ee:ee / / fixed mac for destination ip address mapping

[root@localhost ~] # arp-a / / View arp buffer

? (10.0.2.2) at 52V 5400V 1235V 02 [ether] on eth0

? (192.168.1.6) at ff:ee:ee:ee:ee:ee [ether] PERM on eth0

2) display digitally

[root@localhost ~] # arp-vn

Address HWtype HWaddress Flags Mask Iface

10.0.2.2 ether 52:54:00:12:35:02 C eth0

192.168.1.6 ether ff:ee:ee:ee:ee:ee CM eth0

Entries: 2 Skipped: 0Found: 2

Thank you for your reading, the above is the content of "the usage of the Linux basic command arp". After the study of this article, I believe you have a deeper understanding of the usage of the Linux basic command arp, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report