In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use the arp command in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
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.
The arparp command is used to display and modify the IP to MAC conversion table
It is added that the arp command is Address Resolution Protocol, the address resolution protocol, which is a very important network transmission protocol in the network protocol package that parses the network layer address to find the data link layer address. This command can display and modify the buffered data in the arp protocol parsing table.
This core protocol module implements the Address Resolution Protocol defined in RFC826, which is used to change the translation between layer 2 hardware addresses and Ipv4 protocol addresses in directly connected networks. Users generally do not operate this module directly unless they want to configure it.
In fact, it provides services to other protocols in the core.
The user process can use the sockets of packet (7) to receive ARP packets. Another mechanism is to use netlink (7) sockets to manage ARP caching in user space. We can also control the ARP table on any PF_INET socket through ioctl (2).
The ARP module maintains a cache of hardware address to protocol address mappings. This cache has a size limit, so infrequent and old records (Entry) will be garbage-collected by the garbage collector, which can never delete records marked as permanent. We can use ioctls to directly manipulate buffers, and its traits can be adjusted with the sysctl defined below.
If there is no positive feedback for an existing mapping within a limited time (see sysctl below), the cache record of the adjacent layer is considered invalid. In order to send data to the destination again, ARP will first try to ask the local arp process app_solicit times to obtain the updated MAC (Media access Control) address. If it fails, and the old MAC address is known, the unicast probe of the ucast_solicit is sent. If it still fails, a new ARP request will be broadcast to the network with the queue to send the data.
If Linux receives an address request, and the address points to the address forwarded by Linux, and the receiving interface opens proxy arp, Linux automatically adds a non-permanent proxy arp record, and if there is a route denied to the destination, no proxy arp record is added.
Syntax arp (options) (parameters) option-a # host: displays all entries in the arp buffer;-H # address type: specifies the type of address used by the arp instruction;-d # host: removes the arp entry for the specified host from the arp buffer;-D # uses the hardware address of the specified interface;-e # displays the entries in the arp buffer in the display style of Linux -I # interface: specifies the network interface on which to operate the arp buffer;-s # host MAC address: sets the static mapping between the IP address and the MAC address of the specified host;-n # displays entries in the arp buffer digitally;-v # displays detailed arp buffer entries, including statistics on buffer entries -f # file: sets the static mapping of the host's IP address to MAC address. Parameter host: query the arp entry of the specified host in the arp buffer.
Instance displays the contents of the arp buffer
[root@localhost ~] # arp-v Address HWtype HWaddress Flags Mask Iface 192.168.0.134 ether 00:21:5E:C7:4D:88 C eth2 115.238.144.129 ether 38:22:D6:2F:B2:F1 C eth0 Entries: 2 Skipped: 0 Found: 2 add static arp mapping
Arp-s IP MAC-ADDRESS arp-s 192.168.1.1 00:b1:b2:b3:b4:b5 delete arp cache entry
Arp-d 192.168.1.1 and above are all the contents of this article entitled "how to use arp commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.