Linux command-ARP: ARP cache for the operating system

Source: Internet
Author: User

The ARP command can view the ARP cache or manually add and remove entries from the cache.

Command format

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]

Command parameters

-V,--verbose
Output detailed information.

-N,--numeric
Displays the address in digital form.

-H type,--hw-type type,-t type
Specifies what type of ARP entry to check, the default type is ether, the other values are Arcnet (arcnet), Pronet (pronet), ax25ax.25, Netrom (Net/rom), and so on.

-A [hostname],--all [hostname]
Displays the ARP entries for a specific host and displays all entries if no host is specified. The entries will be displayed in BSD style.

-d hostname,--delete hostname
Deletes the ARP entry corresponding to the specified host.

-E
Displays the ARP entry in the default style.

-I if,--device if
Specifies a network interface, such as eth0.

-S hostname hw_addr,--set hostname
Set the ARP entry manually.

-f filename,--file filename
Similar to the-s option, only the address information is taken from the specified file, and if no file is specified,/etc/ethers as the specified file. The contents of each line of the file are physical addresses and host names separated by spaces.

Instance

A) View the ARP cache.

[Email protected] ~]$ arpaddress                  hwtype  hwaddress           Flags Mask            Iface10.1.241.254             ether   C0 : 67:af:45:9d:3f   C                     eth010.1.241.145             ether   fa:1a:3e:b3:17:62   c                     eth010.1.241.253             Ether   00:1c:54:ff:08:13   C                     eth0

b) only display the ARP cache for eth0.

[Email protected] ~]$ arp-i eth0address                  hwtype  hwaddress           Flags Mask            Iface10.1.241.254             ether   c0:67:af:45:9d:3f   C                     eth010.1.241.145             ether   fa:1a:3e:b3:17:62   c                     eth0

c) Manual ARP entry, bind 10.1.241.253 with 00:1c:54:ff:08:13.

[Email protected] ~]$ arp-s 10.1.241.253 00:1c:54:ff:08:13

d) Delete the ARP entry corresponding to the 10.1.241.253 host.

[Email protected] ~]$ arp-d 10.1.241.253

Linux command-ARP: ARP cache for the operating system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.