xref: /freebsd/usr.sbin/arp/arp.4 (revision 8a7b61203704d362cfbc66c00619f51b24106b55)
184e59eb5SGarrett Wollman.\" Copyright (c) 1985, 1986, 1988, 1994
284e59eb5SGarrett Wollman.\"	The Regents of the University of California.  All rights reserved.
384e59eb5SGarrett Wollman.\"
484e59eb5SGarrett Wollman.\" Redistribution and use in source and binary forms, with or without
584e59eb5SGarrett Wollman.\" modification, are permitted provided that the following conditions
684e59eb5SGarrett Wollman.\" are met:
784e59eb5SGarrett Wollman.\" 1. Redistributions of source code must retain the above copyright
884e59eb5SGarrett Wollman.\"    notice, this list of conditions and the following disclaimer.
984e59eb5SGarrett Wollman.\" 2. Redistributions in binary form must reproduce the above copyright
1084e59eb5SGarrett Wollman.\"    notice, this list of conditions and the following disclaimer in the
1184e59eb5SGarrett Wollman.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
1384e59eb5SGarrett Wollman.\"    may be used to endorse or promote products derived from this software
1484e59eb5SGarrett Wollman.\"    without specific prior written permission.
1584e59eb5SGarrett Wollman.\"
1684e59eb5SGarrett Wollman.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1784e59eb5SGarrett Wollman.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1884e59eb5SGarrett Wollman.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1984e59eb5SGarrett Wollman.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2084e59eb5SGarrett Wollman.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2184e59eb5SGarrett Wollman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2284e59eb5SGarrett Wollman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2384e59eb5SGarrett Wollman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2484e59eb5SGarrett Wollman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2584e59eb5SGarrett Wollman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2684e59eb5SGarrett Wollman.\" SUCH DAMAGE.
2784e59eb5SGarrett Wollman.\"
285bbdbbcdSEric van Gyzen.Dd October 7, 2016
2984e59eb5SGarrett Wollman.Dt ARP 4
30a4c37c81SRuslan Ermilov.Os
3184e59eb5SGarrett Wollman.Sh NAME
3284e59eb5SGarrett Wollman.Nm arp
3384e59eb5SGarrett Wollman.Nd Address Resolution Protocol
3484e59eb5SGarrett Wollman.Sh SYNOPSIS
352dab76f7SRuslan Ermilov.Cd "device ether"
3684e59eb5SGarrett Wollman.Sh DESCRIPTION
378a4e4849SJeroen Ruigrok van der WervenThe Address Resolution Protocol (ARP) is used to dynamically
388a4e4849SJeroen Ruigrok van der Wervenmap between Protocol Addresses (such as IP addresses) and
398a4e4849SJeroen Ruigrok van der WervenLocal Network Addresses (such as Ethernet addresses).
40*0da3f8c9SAlexander V. ChernikovThis implementation maps IP addresses to Ethernet addresses.
418a4e4849SJeroen Ruigrok van der WervenIt is used by all the Ethernet interface drivers.
4284e59eb5SGarrett Wollman.Pp
4384e59eb5SGarrett WollmanARP caches Internet-Ethernet address mappings.
4484e59eb5SGarrett WollmanWhen an interface requests a mapping for an address not in the cache,
4584e59eb5SGarrett WollmanARP queues the message which requires the mapping and broadcasts
4684e59eb5SGarrett Wollmana message on the associated network requesting the address mapping.
4784e59eb5SGarrett WollmanIf a response is provided, the new mapping is cached and any pending
4884e59eb5SGarrett Wollmanmessage is transmitted.
49*0da3f8c9SAlexander V. ChernikovARP will queue at most
50*0da3f8c9SAlexander V. Chernikov.Va net.link.ether.inet.maxhold
51*0da3f8c9SAlexander V. Chernikovpackets while waiting for a response to a mapping request;
52*0da3f8c9SAlexander V. Chernikovonly the most recently ``transmitted'' packets are kept.
5384e59eb5SGarrett WollmanIf the target host does not respond after several requests,
541a5d3a92SGleb Smirnoffthe host is considered to be down allowing an error to be returned to
551a5d3a92SGleb Smirnofftransmission attempts.
561a5d3a92SGleb SmirnoffFurther demand for this mapping causes ARP request retransmissions, that
571a5d3a92SGleb Smirnoffare ratelimited to one packet per second.
5884e59eb5SGarrett WollmanThe error is
59b92a189eSRuslan Ermilov.Er EHOSTDOWN
6084e59eb5SGarrett Wollmanfor a non-responding destination host, and
61b92a189eSRuslan Ermilov.Er EHOSTUNREACH
6284e59eb5SGarrett Wollmanfor a non-responding router.
6384e59eb5SGarrett Wollman.Pp
64*0da3f8c9SAlexander V. ChernikovThe ARP cache is stored in per-interface link-level table.
6584e59eb5SGarrett Wollman.Pp
6684e59eb5SGarrett WollmanARP entries may be added, deleted or changed with the
6784e59eb5SGarrett Wollman.Xr arp 8
6884e59eb5SGarrett Wollmanutility.
6984e59eb5SGarrett WollmanManually-added entries may be temporary or permanent,
7084e59eb5SGarrett Wollmanand may be
7184e59eb5SGarrett Wollman.Dq published ,
7284e59eb5SGarrett Wollmanin which case the system will respond to ARP requests for that host
7384e59eb5SGarrett Wollmanas if it were the target of the request.
7484e59eb5SGarrett Wollman.Pp
7584e59eb5SGarrett WollmanIn the past,
7684e59eb5SGarrett WollmanARP was used to negotiate the use of a trailer encapsulation.
7784e59eb5SGarrett WollmanThis is no longer supported.
7884e59eb5SGarrett Wollman.Pp
7907bfccd7SRuslan ErmilovARP watches passively for hosts impersonating the local host (i.e., a host
8084e59eb5SGarrett Wollmanwhich responds to an ARP mapping request for the local host's address).
81cc090be0SBruce M Simpson.Pp
82cc090be0SBruce M SimpsonProxy ARP is a feature whereby the local host will respond to requests
83cc090be0SBruce M Simpsonfor addresses other than itself, with its own address.
84cc090be0SBruce M SimpsonNormally, proxy ARP in
85cc090be0SBruce M Simpson.Fx
86cc090be0SBruce M Simpsonis set up on a host-by-host basis using the
876311b38fSBruce M Simpson.Xr arp 8
88cc090be0SBruce M Simpsonutility, by adding an entry for each host inside a given subnet for
89cc090be0SBruce M Simpsonwhich proxying of ARP requests is desired.
90cc090be0SBruce M SimpsonHowever, the
91cc090be0SBruce M Simpson.Dq "proxy all"
92cc090be0SBruce M Simpsonfeature causes the local host to act as a proxy for
93cc090be0SBruce M Simpson.Em all
9434c96b56SRuslan Ermilovhosts reachable through some other network interface,
9534c96b56SRuslan Ermilovdifferent from the one the request came in from.
96cc090be0SBruce M SimpsonIt may be enabled by setting the
97cc090be0SBruce M Simpson.Xr sysctl 8
98cc090be0SBruce M SimpsonMIB variable
99cc090be0SBruce M Simpson.Va net.link.ether.inet.proxyall
100cc090be0SBruce M Simpsonto 1.
1011a5d3a92SGleb Smirnoff.Sh MIB Variables
1028972c8b6SJoel DahlThe ARP protocol implements a number of configurable variables in
1031a5d3a92SGleb Smirnoff.Va net.link.ether.inet
1041a5d3a92SGleb Smirnoffbranch
1051a5d3a92SGleb Smirnoffof the
1061a5d3a92SGleb Smirnoff.Xr sysctl 3
1071a5d3a92SGleb SmirnoffMIB.
1085610c8a7SGleb Smirnoff.Bl -tag -width "log_arp_permanent_modify"
109478df1d5SGleb Smirnoff.It Va allow_multicast
1105bbdbbcdSEric van GyzenInstall ARP entries with the multicast bit set in the hardware address.
1115bbdbbcdSEric van GyzenInstalling such entries is an RFC 1812 violation, but some proprietary load
1125bbdbbcdSEric van Gyzenbalancing techniques require routers to do so.
113478df1d5SGleb SmirnoffTurned off by default.
11435ef77a2SEric van Gyzen.It Va garp_rexmit_count
1155bbdbbcdSEric van GyzenRetransmit gratuitous ARP (GARP) packets when an IPv4 address is added to an
1165bbdbbcdSEric van Gyzeninterface.
11735ef77a2SEric van GyzenA GARP is always transmitted when an IPv4 address is added to an interface.
1185bbdbbcdSEric van GyzenA non-zero value causes the GARP packet to be retransmitted the stated number
1195bbdbbcdSEric van Gyzenof times.
12035ef77a2SEric van GyzenThe interval between retransmissions is doubled each time, so the
12135ef77a2SEric van Gyzenretransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds).
12235ef77a2SEric van GyzenThe default value of zero means only the initial GARP is sent; no
12335ef77a2SEric van Gyzenadditional GARP packets are retransmitted.
12435ef77a2SEric van GyzenThe maximum value is sixteen.
12535ef77a2SEric van Gyzen.Pp
1265bbdbbcdSEric van GyzenThe default behavior of a single GARP packet is usually sufficient.
1275bbdbbcdSEric van GyzenHowever, a single GARP might be dropped or lost in some circumstances.
1285bbdbbcdSEric van GyzenThis is particularly harmful when a shared address is passed between cluster
1295bbdbbcdSEric van Gyzennodes.
1305bbdbbcdSEric van GyzenNeighbors on the network link might then work with a stale ARP cache and send
1315bbdbbcdSEric van Gyzenpackets destined for that address to the node that previously owned the
1325bbdbbcdSEric van Gyzenaddress, which might not respond.
1335610c8a7SGleb Smirnoff.It Va log_arp_movements
1345bbdbbcdSEric van GyzenLog movements of IP addresses from one hardware address to another.
1355610c8a7SGleb SmirnoffSee
1365610c8a7SGleb Smirnoff.Sx DIAGNOSTICS
1375610c8a7SGleb Smirnoffbelow.
1385610c8a7SGleb SmirnoffTurned on by default.
1395610c8a7SGleb Smirnoff.It Va log_arp_permanent_modify
1405bbdbbcdSEric van GyzenLog attempts by a remote host to modify a permanent ARP entry.
1415610c8a7SGleb SmirnoffSee
1425610c8a7SGleb Smirnoff.Sx DIAGNOSTICS
1435610c8a7SGleb Smirnoffbelow.
1445610c8a7SGleb SmirnoffTurned on by default.
1455610c8a7SGleb Smirnoff.It Va log_arp_wrong_iface
1465bbdbbcdSEric van GyzenLog attempts to insert an ARP entry on an interface when the IP network to
1475bbdbbcdSEric van Gyzenwhich the address belongs is connected to another interface.
1485610c8a7SGleb SmirnoffSee
1495610c8a7SGleb Smirnoff.Sx DIAGNOSTICS
1505610c8a7SGleb Smirnoffbelow.
1515610c8a7SGleb SmirnoffTurned on by default.
1525d81d095SGleb Smirnoff.It Va max_log_per_second
1535bbdbbcdSEric van GyzenLimit the number of remotely triggered logging events to a configured value per
1545bbdbbcdSEric van Gyzensecond.
1555d81d095SGleb SmirnoffDefault is 1 log message per second.
15644ec3c8cSGleb Smirnoff.It Va max_age
15744ec3c8cSGleb SmirnoffHow long an ARP entry is held in the cache until it needs to be refreshed.
1585610c8a7SGleb SmirnoffDefault is 1200 seconds.
1595610c8a7SGleb Smirnoff.It Va maxhold
1605bbdbbcdSEric van GyzenHow many packets to hold in the per-entry output queue while the entry
1615610c8a7SGleb Smirnoffis being resolved.
162*0da3f8c9SAlexander V. ChernikovDefault is 16 packets.
16344ec3c8cSGleb Smirnoff.It Va maxtries
1645bbdbbcdSEric van GyzenNumber of retransmits before a host is considered down and an error is
1655bbdbbcdSEric van Gyzenreturned.
1665610c8a7SGleb SmirnoffDefault is 5 tries.
1675610c8a7SGleb Smirnoff.It Va proxyall
1685bbdbbcdSEric van GyzenEnables ARP proxying.
1695610c8a7SGleb SmirnoffTurned off by default.
1705610c8a7SGleb Smirnoff.It Va wait
1715610c8a7SGleb SmirnoffLifetime of an incomplete ARP entry.
1725610c8a7SGleb SmirnoffDefault is 20 seconds.
1731a5d3a92SGleb Smirnoff.El
17484e59eb5SGarrett Wollman.Sh DIAGNOSTICS
175bc84aa4bSRuslan Ermilov.Bl -diag
1765610c8a7SGleb Smirnoff.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d on %s!"
17784e59eb5SGarrett WollmanARP has discovered another host on the local network which responds to
17884e59eb5SGarrett Wollmanmapping requests for its own Internet address with a different Ethernet
17984e59eb5SGarrett Wollmanaddress, generally indicating that two hosts are attempting to use the
18084e59eb5SGarrett Wollmansame Internet address.
181bc84aa4bSRuslan Ermilov.It "arp: link address is broadcast for IP address %d.%d.%d.%d!"
18231a32280SBill FennerARP requested information for a host, and received an answer indicating
18331a32280SBill Fennerthat the host's ethernet address is the ethernet broadcast address.
18431a32280SBill FennerThis indicates a misconfigured or broken device.
185bc84aa4bSRuslan Ermilov.It "arp: %d.%d.%d.%d moved from %x:%x:%x:%x:%x:%x to %x:%x:%x:%x:%x:%x on %s"
18631a32280SBill FennerARP had a cached value for the ethernet address of the referenced host,
1870cc7c160SBruce M Simpsonbut received a reply indicating that the host is at a new address.
1880cc7c160SBruce M SimpsonThis can happen normally when host hardware addresses change,
1890cc7c160SBruce M Simpsonor when a mobile node arrives or leaves the local subnet.
1900cc7c160SBruce M SimpsonIt can also indicate a problem with proxy ARP.
1911e709b6fSBruce M SimpsonThis message can only be issued if the sysctl
19243039b7dSBruce M Simpson.Va net.link.ether.inet.log_arp_movements
1931e709b6fSBruce M Simpsonis set to 1, which is the system's default behaviour.
194bc84aa4bSRuslan Ermilov.It "arpresolve: can't allocate llinfo for %d.%d.%d.%d"
19531a32280SBill FennerThe route for the referenced host points to a device upon which ARP is
19631a32280SBill Fennerrequired, but ARP was unable to allocate a routing table entry in which
1970cc7c160SBruce M Simpsonto store the host's MAC address.
1980cc7c160SBruce M SimpsonThis usually points to a misconfigured routing table.
1990cc7c160SBruce M SimpsonIt can also occur if the kernel cannot allocate memory.
200bc84aa4bSRuslan Ermilov.It "arp: %d.%d.%d.%d is on if0 but got reply from %x:%x:%x:%x:%x:%x on if1"
2014cd8d8d5SBruce M SimpsonPhysical connections exist to the same logical IP network on both if0 and if1.
2024cd8d8d5SBruce M SimpsonIt can also occur if an entry already exists in the ARP cache for the IP
2034cd8d8d5SBruce M Simpsonaddress above, and the cable has been disconnected from if0, then reconnected
2044cd8d8d5SBruce M Simpsonto if1.
2054cd8d8d5SBruce M SimpsonThis message can only be issued if the sysctl
20643039b7dSBruce M Simpson.Va net.link.ether.inet.log_arp_wrong_iface
2074cd8d8d5SBruce M Simpsonis set to 1, which is the system's default behaviour.
208bc84aa4bSRuslan Ermilov.It "arp: %x:%x:%x:%x:%x:%x attempts to modify permanent entry for %d.%d.%d.%d on %s"
20939393906SGleb SmirnoffARP has received an ARP reply that attempts to overwrite a permanent
210bc84aa4bSRuslan Ermiloventry in the local ARP table.
211bc84aa4bSRuslan ErmilovThis error will only be logged if the sysctl
21239393906SGleb Smirnoff.Va net.link.ether.inet.log_arp_permanent_modify
21339393906SGleb Smirnoffis set to 1, which is the system's default behaviour.
214478df1d5SGleb Smirnoff.It "arp: %x:%x:%x:%x:%x:%x is multicast"
215478df1d5SGleb SmirnoffKernel refused to install an entry with multicast hardware address.
216478df1d5SGleb SmirnoffIf you really want such addresses being installed, set the sysctl
217478df1d5SGleb Smirnoff.Va net.link.ether.inet.allow_multicast
218478df1d5SGleb Smirnoffto a positive value.
219bc84aa4bSRuslan Ermilov.El
22084e59eb5SGarrett Wollman.Sh SEE ALSO
22184e59eb5SGarrett Wollman.Xr inet 4 ,
22284e59eb5SGarrett Wollman.Xr route 4 ,
22384e59eb5SGarrett Wollman.Xr arp 8 ,
22484e59eb5SGarrett Wollman.Xr ifconfig 8 ,
2251e709b6fSBruce M Simpson.Xr route 8 ,
2261e709b6fSBruce M Simpson.Xr sysctl 8
22784e59eb5SGarrett Wollman.Rs
22884e59eb5SGarrett Wollman.%A Plummer, D.
22984e59eb5SGarrett Wollman.%B "An Ethernet Address Resolution Protocol"
23084e59eb5SGarrett Wollman.%T RFC826
23184e59eb5SGarrett Wollman.Re
23284e59eb5SGarrett Wollman.Rs
23384e59eb5SGarrett Wollman.%A Leffler, S.J.
23484e59eb5SGarrett Wollman.%A Karels, M.J.
235c2965cd1SJoel Dahl.%B "Trailer Encapsulations"
23684e59eb5SGarrett Wollman.%T RFC893
23784e59eb5SGarrett Wollman.Re
238