xref: /freebsd/usr.sbin/arp/arp.4 (revision 41059135ce931c0f1014a999ffabc6bc470ce856)
1.\" Copyright (c) 1985, 1986, 1988, 1994
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)arp4.4	6.5 (Berkeley) 4/18/94
29.\" $FreeBSD$
30.\"
31.Dd October 7, 2016
32.Dt ARP 4
33.Os
34.Sh NAME
35.Nm arp
36.Nd Address Resolution Protocol
37.Sh SYNOPSIS
38.Cd "device ether"
39.Sh DESCRIPTION
40The Address Resolution Protocol (ARP) is used to dynamically
41map between Protocol Addresses (such as IP addresses) and
42Local Network Addresses (such as Ethernet addresses).
43This implementation maps IP addresses to Ethernet,
44ARCnet,
45or Token Ring addresses.
46It is used by all the Ethernet interface drivers.
47.Pp
48ARP caches Internet-Ethernet address mappings.
49When an interface requests a mapping for an address not in the cache,
50ARP queues the message which requires the mapping and broadcasts
51a message on the associated network requesting the address mapping.
52If a response is provided, the new mapping is cached and any pending
53message is transmitted.
54ARP will queue at most one packet while waiting for a response to a
55mapping request;
56only the most recently ``transmitted'' packet is kept.
57If the target host does not respond after several requests,
58the host is considered to be down allowing an error to be returned to
59transmission attempts.
60Further demand for this mapping causes ARP request retransmissions, that
61are ratelimited to one packet per second.
62The error is
63.Er EHOSTDOWN
64for a non-responding destination host, and
65.Er EHOSTUNREACH
66for a non-responding router.
67.Pp
68The ARP cache is stored in the system routing table as
69dynamically-created host routes.
70The route to a directly-attached Ethernet network is installed as a
71.Dq cloning
72route (one with the
73.Li RTF_CLONING
74flag set),
75causing routes to individual hosts on that network to be created on
76demand.
77These routes time out periodically (normally 20 minutes after validated;
78entries are not validated when not in use).
79.Pp
80ARP entries may be added, deleted or changed with the
81.Xr arp 8
82utility.
83Manually-added entries may be temporary or permanent,
84and may be
85.Dq published ,
86in which case the system will respond to ARP requests for that host
87as if it were the target of the request.
88.Pp
89In the past,
90ARP was used to negotiate the use of a trailer encapsulation.
91This is no longer supported.
92.Pp
93ARP watches passively for hosts impersonating the local host (i.e., a host
94which responds to an ARP mapping request for the local host's address).
95.Pp
96Proxy ARP is a feature whereby the local host will respond to requests
97for addresses other than itself, with its own address.
98Normally, proxy ARP in
99.Fx
100is set up on a host-by-host basis using the
101.Xr arp 8
102utility, by adding an entry for each host inside a given subnet for
103which proxying of ARP requests is desired.
104However, the
105.Dq "proxy all"
106feature causes the local host to act as a proxy for
107.Em all
108hosts reachable through some other network interface,
109different from the one the request came in from.
110It may be enabled by setting the
111.Xr sysctl 8
112MIB variable
113.Va net.link.ether.inet.proxyall
114to 1.
115.Sh MIB Variables
116The ARP protocol implements a number of configurable variables in
117.Va net.link.ether.inet
118branch
119of the
120.Xr sysctl 3
121MIB.
122.Bl -tag -width "log_arp_permanent_modify"
123.It Va allow_multicast
124Install ARP entries with the multicast bit set in the hardware address.
125Installing such entries is an RFC 1812 violation, but some proprietary load
126balancing techniques require routers to do so.
127Turned off by default.
128.It Va garp_rexmit_count
129Retransmit gratuitous ARP (GARP) packets when an IPv4 address is added to an
130interface.
131A GARP is always transmitted when an IPv4 address is added to an interface.
132A non-zero value causes the GARP packet to be retransmitted the stated number
133of times.
134The interval between retransmissions is doubled each time, so the
135retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds).
136The default value of zero means only the initial GARP is sent; no
137additional GARP packets are retransmitted.
138The maximum value is sixteen.
139.Pp
140The default behavior of a single GARP packet is usually sufficient.
141However, a single GARP might be dropped or lost in some circumstances.
142This is particularly harmful when a shared address is passed between cluster
143nodes.
144Neighbors on the network link might then work with a stale ARP cache and send
145packets destined for that address to the node that previously owned the
146address, which might not respond.
147.It Va log_arp_movements
148Log movements of IP addresses from one hardware address to another.
149See
150.Sx DIAGNOSTICS
151below.
152Turned on by default.
153.It Va log_arp_permanent_modify
154Log attempts by a remote host to modify a permanent ARP entry.
155See
156.Sx DIAGNOSTICS
157below.
158Turned on by default.
159.It Va log_arp_wrong_iface
160Log attempts to insert an ARP entry on an interface when the IP network to
161which the address belongs is connected to another interface.
162See
163.Sx DIAGNOSTICS
164below.
165Turned on by default.
166.It Va max_log_per_second
167Limit the number of remotely triggered logging events to a configured value per
168second.
169Default is 1 log message per second.
170.It Va max_age
171How long an ARP entry is held in the cache until it needs to be refreshed.
172Default is 1200 seconds.
173.It Va maxhold
174How many packets to hold in the per-entry output queue while the entry
175is being resolved.
176Default is one packet.
177.It Va maxtries
178Number of retransmits before a host is considered down and an error is
179returned.
180Default is 5 tries.
181.It Va proxyall
182Enables ARP proxying.
183Turned off by default.
184.It Va wait
185Lifetime of an incomplete ARP entry.
186Default is 20 seconds.
187.El
188.Sh DIAGNOSTICS
189.Bl -diag
190.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d on %s!"
191ARP has discovered another host on the local network which responds to
192mapping requests for its own Internet address with a different Ethernet
193address, generally indicating that two hosts are attempting to use the
194same Internet address.
195.It "arp: link address is broadcast for IP address %d.%d.%d.%d!"
196ARP requested information for a host, and received an answer indicating
197that the host's ethernet address is the ethernet broadcast address.
198This indicates a misconfigured or broken device.
199.It "arp: %d.%d.%d.%d moved from %x:%x:%x:%x:%x:%x to %x:%x:%x:%x:%x:%x on %s"
200ARP had a cached value for the ethernet address of the referenced host,
201but received a reply indicating that the host is at a new address.
202This can happen normally when host hardware addresses change,
203or when a mobile node arrives or leaves the local subnet.
204It can also indicate a problem with proxy ARP.
205This message can only be issued if the sysctl
206.Va net.link.ether.inet.log_arp_movements
207is set to 1, which is the system's default behaviour.
208.It "arpresolve: can't allocate llinfo for %d.%d.%d.%d"
209The route for the referenced host points to a device upon which ARP is
210required, but ARP was unable to allocate a routing table entry in which
211to store the host's MAC address.
212This usually points to a misconfigured routing table.
213It can also occur if the kernel cannot allocate memory.
214.It "arp: %d.%d.%d.%d is on if0 but got reply from %x:%x:%x:%x:%x:%x on if1"
215Physical connections exist to the same logical IP network on both if0 and if1.
216It can also occur if an entry already exists in the ARP cache for the IP
217address above, and the cable has been disconnected from if0, then reconnected
218to if1.
219This message can only be issued if the sysctl
220.Va net.link.ether.inet.log_arp_wrong_iface
221is set to 1, which is the system's default behaviour.
222.It "arp: %x:%x:%x:%x:%x:%x attempts to modify permanent entry for %d.%d.%d.%d on %s"
223ARP has received an ARP reply that attempts to overwrite a permanent
224entry in the local ARP table.
225This error will only be logged if the sysctl
226.Va net.link.ether.inet.log_arp_permanent_modify
227is set to 1, which is the system's default behaviour.
228.It "arp: %x:%x:%x:%x:%x:%x is multicast"
229Kernel refused to install an entry with multicast hardware address.
230If you really want such addresses being installed, set the sysctl
231.Va net.link.ether.inet.allow_multicast
232to a positive value.
233.El
234.Sh SEE ALSO
235.Xr inet 4 ,
236.Xr route 4 ,
237.Xr arp 8 ,
238.Xr ifconfig 8 ,
239.Xr route 8 ,
240.Xr sysctl 8
241.Rs
242.%A Plummer, D.
243.%B "An Ethernet Address Resolution Protocol"
244.%T RFC826
245.Re
246.Rs
247.%A Leffler, S.J.
248.%A Karels, M.J.
249.%B "Trailer Encapsulations"
250.%T RFC893
251.Re
252