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