Home > Article > Operation and Maintenance > What is the function of linux arp
Linux arp is used to manage the system's arp buffer, and 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 item and set it manually; For debugging purposes, the ARP program also allows a complete dump of the ARP cache.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
What is the function of linux arp?
Linux basic command arp
arp
The arp instruction is used To manage the system's arp buffer, you 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 entries and set them manually. For debugging purposes, the ARP program also allows a complete dump of the ARP cache.
This command is applicable to: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.
1、Syntax
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, option list
Options |
Description |
##--help |
Show help document |
##--version
| Display command version|
-H type --hw-typetype -ttype | at When setting or reading the ARP cache, this optional parameter tells ARP what types of entries it should check. The default value of this parameter is ether (which 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 local arp buffer|
hostname | --deletehostname Delete the specified address type from the buffer |
|
Use the mac address of the specified interface |
|
Use Linux style display |
|
if | --device if Display the arp buffer of the specified device |
|
hostnamehw_addr Set the specified host Mac address mapping |
|
| --file filename |
Similar to the -s option, except 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 filename "/etc/ether" is not specified as the default value. The format of the file is simple; it simply contains lines of ASCII text with the hardware address and the hostname separated by spaces. Additionally, the pub, temp, and netmask flags may be used. |
-n | --numeric |
Use numeric display |
-v | --verbose |
##Display execution process |
3, Example
1) Add static mapping[root@localhost ~]# arp -i eth0 -s 192.168.1.6 ff:ee:ee:ee:ee:ee //将目标ip地址映射固定mac [root@localhost ~]# arp –a //查看arp缓冲区 ? (10.0.2.2) at 52:54:00:12:35:02 [ether] on eth0 ? (192.168.1.6) at ff:ee:ee:ee:ee:ee [ether] PERM on eth02) 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: 2Related recommendations: "
Linux Video Tutorial"
The above is the detailed content of What is the function of linux arp. For more information, please follow other related articles on the PHP Chinese website!