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