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

List of Arp commands under Linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "the list of Arp commands under Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the list of Arp commands under Linux.

Let's first take a look at the arp command under linux (if the initial arp table is empty, we need to make a connection to a host, for example, ping the target host to generate an arp entry.

The Linux Arp command displays and modifies the IP-to-physical address translation table used by the address Resolution Protocol (ARP).

ARP-s inet_addr eth_addr [if_addr]

ARP-d inet_addr [if_addr]

ARP-a [inet_addr] [- N if_addr] [- v]

-a displays the current ARP entry by asking about the current protocol data. If inet_addr is specified, only the IP address and physical address of the specified computer are displayed. If more than one network interface uses ARP, the entries for each ARP table are displayed.

-g is the same as-a.

-v displays the current ARP entry in detail mode. All invalid entries and entries on the loopback interface will be displayed.

Inet_addr specifies the Internet address (IP address).

-N if_addr displays the ARP entry for the network interface specified by if_addr.

-d Delete the host specified by inet_addr. Inet_addr can be the wildcard * to delete all hosts.

-s add the host and associate the Internet address inet_addr with the physical address eth_addr. The physical address is six hexadecimal bytes separated by a hyphen. This item is *.

Eth_addr specifies the physical address.

If if_addr exists, this item specifies the Internet address of the interface that the address translation table should modify. If it does not exist, * applicable interfaces are used.

Example:

Add a static item. This is very useful, especially after the arp virus is in the local area network.

# arp-s 123.253.68.209 00:19:56:6F:87:D2

# arp-a.... Displays the ARP table.

However, the static items set by arp-s will expire after the user logs out or restarts. If you want not to fail at any time, you can write the corresponding relationship between ip and mac into the default configuration file / etc/ethers of the arp command.

For example:

Quote

Root@ubuntu:/# vi / etc/ethers

211.144.68.254 00:12:D9:32:BF:44

Just execute the following command after writing

Quote

Arp-f / etc/ethers

To ensure that the binding remains valid after a restart, you need to write the above command to / etc/ethers

ARP (Address Resolution Protocol), or address Resolution Protocol.

When the local machine sends data to "a certain IP address-target machine IP address", look up the local ARP table first. If the ARP entry of "target machine IP address" is found in the ARP table, the "MAC address" corresponding to the "target machine IP address" will be sent directly to the "destination MAC address field" of the MAC packet.

If the ARP entry for "target IP address" is not found in the ARP table, a broadcast ARP packet is sent to the local area network ("destination MAC address field" = = FF:FF:FF:FF:FF:FF), and the target machine will reply to the local machine with the ARP packet (including the MAC address of the target machine).

At this point, I believe you have a deeper understanding of the "list of Arp commands under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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