xref: /freebsd/usr.sbin/arp/arp.4 (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
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 addresses.
44It is used by all the Ethernet interface drivers.
45.Pp
46ARP caches Internet-Ethernet address mappings.
47When an interface requests a mapping for an address not in the cache,
48ARP queues the message which requires the mapping and broadcasts
49a message on the associated network requesting the address mapping.
50If a response is provided, the new mapping is cached and any pending
51message is transmitted.
52ARP will queue at most
53.Va net.link.ether.inet.maxhold
54packets while waiting for a response to a mapping request;
55only the most recently ``transmitted'' packets are kept.
56If the target host does not respond after several requests,
57the host is considered to be down allowing an error to be returned to
58transmission attempts.
59Further demand for this mapping causes ARP request retransmissions, that
60are ratelimited to one packet per second.
61The error is
62.Er EHOSTDOWN
63for a non-responding destination host, and
64.Er EHOSTUNREACH
65for a non-responding router.
66.Pp
67The ARP cache is stored in per-interface link-level table.
68.Pp
69ARP entries may be added, deleted or changed with the
70.Xr arp 8
71utility.
72Manually-added entries may be temporary or permanent,
73and may be
74.Dq published ,
75in which case the system will respond to ARP requests for that host
76as if it were the target of the request.
77.Pp
78In the past,
79ARP was used to negotiate the use of a trailer encapsulation.
80This is no longer supported.
81.Pp
82ARP watches passively for hosts impersonating the local host (i.e., a host
83which responds to an ARP mapping request for the local host's address).
84.Pp
85Proxy ARP is a feature whereby the local host will respond to requests
86for addresses other than itself, with its own address.
87Normally, proxy ARP in
88.Fx
89is set up on a host-by-host basis using the
90.Xr arp 8
91utility, by adding an entry for each host inside a given subnet for
92which proxying of ARP requests is desired.
93However, the
94.Dq "proxy all"
95feature causes the local host to act as a proxy for
96.Em all
97hosts reachable through some other network interface,
98different from the one the request came in from.
99It may be enabled by setting the
100.Xr sysctl 8
101MIB variable
102.Va net.link.ether.inet.proxyall
103to 1.
104.Sh MIB Variables
105The ARP protocol implements a number of configurable variables in
106.Va net.link.ether.inet
107branch
108of the
109.Xr sysctl 3
110MIB.
111.Bl -tag -width "log_arp_permanent_modify"
112.It Va allow_multicast
113Install ARP entries with the multicast bit set in the hardware address.
114Installing such entries is an RFC 1812 violation, but some proprietary load
115balancing techniques require routers to do so.
116Turned off by default.
117.It Va garp_rexmit_count
118Retransmit gratuitous ARP (GARP) packets when an IPv4 address is added to an
119interface.
120A GARP is always transmitted when an IPv4 address is added to an interface.
121A non-zero value causes the GARP packet to be retransmitted the stated number
122of times.
123The interval between retransmissions is doubled each time, so the
124retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds).
125The default value of zero means only the initial GARP is sent; no
126additional GARP packets are retransmitted.
127The maximum value is sixteen.
128.Pp
129The default behavior of a single GARP packet is usually sufficient.
130However, a single GARP might be dropped or lost in some circumstances.
131This is particularly harmful when a shared address is passed between cluster
132nodes.
133Neighbors on the network link might then work with a stale ARP cache and send
134packets destined for that address to the node that previously owned the
135address, which might not respond.
136.It Va log_arp_movements
137Log movements of IP addresses from one hardware address to another.
138See
139.Sx DIAGNOSTICS
140below.
141Turned on by default.
142.It Va log_arp_permanent_modify
143Log attempts by a remote host to modify a permanent ARP entry.
144See
145.Sx DIAGNOSTICS
146below.
147Turned on by default.
148.It Va log_arp_wrong_iface
149Log attempts to insert an ARP entry on an interface when the IP network to
150which the address belongs is connected to another interface.
151See
152.Sx DIAGNOSTICS
153below.
154Turned on by default.
155.It Va max_log_per_second
156Limit the number of remotely triggered logging events to a configured value per
157second.
158Default is 1 log message per second.
159.It Va max_age
160How long an ARP entry is held in the cache until it needs to be refreshed.
161Default is 1200 seconds.
162.It Va maxhold
163How many packets to hold in the per-entry output queue while the entry
164is being resolved.
165Default is 16 packets.
166.It Va maxtries
167Number of retransmits before a host is considered down and an error is
168returned.
169Default is 5 tries.
170.It Va proxyall
171Enables ARP proxying.
172Turned off by default.
173.It Va wait
174Lifetime of an incomplete ARP entry.
175Default is 20 seconds.
176.El
177.Sh DIAGNOSTICS
178.Bl -diag
179.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d on %s!"
180ARP has discovered another host on the local network which responds to
181mapping requests for its own Internet address with a different Ethernet
182address, generally indicating that two hosts are attempting to use the
183same Internet address.
184.It "arp: link address is broadcast for IP address %d.%d.%d.%d!"
185ARP requested information for a host, and received an answer indicating
186that the host's ethernet address is the ethernet broadcast address.
187This indicates a misconfigured or broken device.
188.It "arp: %d.%d.%d.%d moved from %x:%x:%x:%x:%x:%x to %x:%x:%x:%x:%x:%x on %s"
189ARP had a cached value for the ethernet address of the referenced host,
190but received a reply indicating that the host is at a new address.
191This can happen normally when host hardware addresses change,
192or when a mobile node arrives or leaves the local subnet.
193It can also indicate a problem with proxy ARP.
194This message can only be issued if the sysctl
195.Va net.link.ether.inet.log_arp_movements
196is set to 1, which is the system's default behaviour.
197.It "arpresolve: can't allocate llinfo for %d.%d.%d.%d"
198The route for the referenced host points to a device upon which ARP is
199required, but ARP was unable to allocate a routing table entry in which
200to store the host's MAC address.
201This usually points to a misconfigured routing table.
202It can also occur if the kernel cannot allocate memory.
203.It "arp: %d.%d.%d.%d is on if0 but got reply from %x:%x:%x:%x:%x:%x on if1"
204Physical connections exist to the same logical IP network on both if0 and if1.
205It can also occur if an entry already exists in the ARP cache for the IP
206address above, and the cable has been disconnected from if0, then reconnected
207to if1.
208This message can only be issued if the sysctl
209.Va net.link.ether.inet.log_arp_wrong_iface
210is set to 1, which is the system's default behaviour.
211.It "arp: %x:%x:%x:%x:%x:%x attempts to modify permanent entry for %d.%d.%d.%d on %s"
212ARP has received an ARP reply that attempts to overwrite a permanent
213entry in the local ARP table.
214This error will only be logged if the sysctl
215.Va net.link.ether.inet.log_arp_permanent_modify
216is set to 1, which is the system's default behaviour.
217.It "arp: %x:%x:%x:%x:%x:%x is multicast"
218Kernel refused to install an entry with multicast hardware address.
219If you really want such addresses being installed, set the sysctl
220.Va net.link.ether.inet.allow_multicast
221to a positive value.
222.El
223.Sh SEE ALSO
224.Xr inet 4 ,
225.Xr route 4 ,
226.Xr arp 8 ,
227.Xr ifconfig 8 ,
228.Xr route 8 ,
229.Xr sysctl 8
230.Rs
231.%A Plummer, D.
232.%B "An Ethernet Address Resolution Protocol"
233.%T RFC826
234.Re
235.Rs
236.%A Leffler, S.J.
237.%A Karels, M.J.
238.%B "Trailer Encapsulations"
239.%T RFC893
240.Re
241