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