184e59eb5SGarrett Wollman.\" Copyright (c) 1985, 1986, 1988, 1994 284e59eb5SGarrett Wollman.\" The Regents of the University of California. All rights reserved. 384e59eb5SGarrett Wollman.\" 484e59eb5SGarrett Wollman.\" Redistribution and use in source and binary forms, with or without 584e59eb5SGarrett Wollman.\" modification, are permitted provided that the following conditions 684e59eb5SGarrett Wollman.\" are met: 784e59eb5SGarrett Wollman.\" 1. Redistributions of source code must retain the above copyright 884e59eb5SGarrett Wollman.\" notice, this list of conditions and the following disclaimer. 984e59eb5SGarrett Wollman.\" 2. Redistributions in binary form must reproduce the above copyright 1084e59eb5SGarrett Wollman.\" notice, this list of conditions and the following disclaimer in the 1184e59eb5SGarrett Wollman.\" documentation and/or other materials provided with the distribution. 1284e59eb5SGarrett Wollman.\" 4. Neither the name of the University nor the names of its contributors 1384e59eb5SGarrett Wollman.\" may be used to endorse or promote products derived from this software 1484e59eb5SGarrett Wollman.\" without specific prior written permission. 1584e59eb5SGarrett Wollman.\" 1684e59eb5SGarrett Wollman.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1784e59eb5SGarrett Wollman.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1884e59eb5SGarrett Wollman.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1984e59eb5SGarrett Wollman.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2084e59eb5SGarrett Wollman.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2184e59eb5SGarrett Wollman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2284e59eb5SGarrett Wollman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2384e59eb5SGarrett Wollman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2484e59eb5SGarrett Wollman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2584e59eb5SGarrett Wollman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2684e59eb5SGarrett Wollman.\" SUCH DAMAGE. 2784e59eb5SGarrett Wollman.\" 2884e59eb5SGarrett Wollman.\" @(#)arp4.4 6.5 (Berkeley) 4/18/94 2997d92980SPeter Wemm.\" $FreeBSD$ 3084e59eb5SGarrett Wollman.\" 31*35ef77a2SEric van Gyzen.Dd October 3, 2016 3284e59eb5SGarrett Wollman.Dt ARP 4 33a4c37c81SRuslan Ermilov.Os 3484e59eb5SGarrett Wollman.Sh NAME 3584e59eb5SGarrett Wollman.Nm arp 3684e59eb5SGarrett Wollman.Nd Address Resolution Protocol 3784e59eb5SGarrett Wollman.Sh SYNOPSIS 382dab76f7SRuslan Ermilov.Cd "device ether" 3984e59eb5SGarrett Wollman.Sh DESCRIPTION 408a4e4849SJeroen Ruigrok van der WervenThe Address Resolution Protocol (ARP) is used to dynamically 418a4e4849SJeroen Ruigrok van der Wervenmap between Protocol Addresses (such as IP addresses) and 428a4e4849SJeroen Ruigrok van der WervenLocal Network Addresses (such as Ethernet addresses). 438a4e4849SJeroen Ruigrok van der WervenThis implementation maps IP addresses to Ethernet, 448a4e4849SJeroen Ruigrok van der WervenARCnet, 458a4e4849SJeroen Ruigrok van der Wervenor Token Ring addresses. 468a4e4849SJeroen Ruigrok van der WervenIt is used by all the Ethernet interface drivers. 4784e59eb5SGarrett Wollman.Pp 4884e59eb5SGarrett WollmanARP caches Internet-Ethernet address mappings. 4984e59eb5SGarrett WollmanWhen an interface requests a mapping for an address not in the cache, 5084e59eb5SGarrett WollmanARP queues the message which requires the mapping and broadcasts 5184e59eb5SGarrett Wollmana message on the associated network requesting the address mapping. 5284e59eb5SGarrett WollmanIf a response is provided, the new mapping is cached and any pending 5384e59eb5SGarrett Wollmanmessage is transmitted. 5484e59eb5SGarrett WollmanARP will queue at most one packet while waiting for a response to a 5584e59eb5SGarrett Wollmanmapping request; 5684e59eb5SGarrett Wollmanonly the most recently ``transmitted'' packet is kept. 5784e59eb5SGarrett WollmanIf the target host does not respond after several requests, 581a5d3a92SGleb Smirnoffthe host is considered to be down allowing an error to be returned to 591a5d3a92SGleb Smirnofftransmission attempts. 601a5d3a92SGleb SmirnoffFurther demand for this mapping causes ARP request retransmissions, that 611a5d3a92SGleb Smirnoffare ratelimited to one packet per second. 6284e59eb5SGarrett WollmanThe error is 63b92a189eSRuslan Ermilov.Er EHOSTDOWN 6484e59eb5SGarrett Wollmanfor a non-responding destination host, and 65b92a189eSRuslan Ermilov.Er EHOSTUNREACH 6684e59eb5SGarrett Wollmanfor a non-responding router. 6784e59eb5SGarrett Wollman.Pp 6884e59eb5SGarrett WollmanThe ARP cache is stored in the system routing table as 6984e59eb5SGarrett Wollmandynamically-created host routes. 7084e59eb5SGarrett WollmanThe route to a directly-attached Ethernet network is installed as a 7184e59eb5SGarrett Wollman.Dq cloning 7284e59eb5SGarrett Wollmanroute (one with the 7384e59eb5SGarrett Wollman.Li RTF_CLONING 7484e59eb5SGarrett Wollmanflag set), 7584e59eb5SGarrett Wollmancausing routes to individual hosts on that network to be created on 7684e59eb5SGarrett Wollmandemand. 7784e59eb5SGarrett WollmanThese routes time out periodically (normally 20 minutes after validated; 7884e59eb5SGarrett Wollmanentries are not validated when not in use). 7984e59eb5SGarrett Wollman.Pp 8084e59eb5SGarrett WollmanARP entries may be added, deleted or changed with the 8184e59eb5SGarrett Wollman.Xr arp 8 8284e59eb5SGarrett Wollmanutility. 8384e59eb5SGarrett WollmanManually-added entries may be temporary or permanent, 8484e59eb5SGarrett Wollmanand may be 8584e59eb5SGarrett Wollman.Dq published , 8684e59eb5SGarrett Wollmanin which case the system will respond to ARP requests for that host 8784e59eb5SGarrett Wollmanas if it were the target of the request. 8884e59eb5SGarrett Wollman.Pp 8984e59eb5SGarrett WollmanIn the past, 9084e59eb5SGarrett WollmanARP was used to negotiate the use of a trailer encapsulation. 9184e59eb5SGarrett WollmanThis is no longer supported. 9284e59eb5SGarrett Wollman.Pp 9307bfccd7SRuslan ErmilovARP watches passively for hosts impersonating the local host (i.e., a host 9484e59eb5SGarrett Wollmanwhich responds to an ARP mapping request for the local host's address). 95cc090be0SBruce M Simpson.Pp 96cc090be0SBruce M SimpsonProxy ARP is a feature whereby the local host will respond to requests 97cc090be0SBruce M Simpsonfor addresses other than itself, with its own address. 98cc090be0SBruce M SimpsonNormally, proxy ARP in 99cc090be0SBruce M Simpson.Fx 100cc090be0SBruce M Simpsonis set up on a host-by-host basis using the 1016311b38fSBruce M Simpson.Xr arp 8 102cc090be0SBruce M Simpsonutility, by adding an entry for each host inside a given subnet for 103cc090be0SBruce M Simpsonwhich proxying of ARP requests is desired. 104cc090be0SBruce M SimpsonHowever, the 105cc090be0SBruce M Simpson.Dq "proxy all" 106cc090be0SBruce M Simpsonfeature causes the local host to act as a proxy for 107cc090be0SBruce M Simpson.Em all 10834c96b56SRuslan Ermilovhosts reachable through some other network interface, 10934c96b56SRuslan Ermilovdifferent from the one the request came in from. 110cc090be0SBruce M SimpsonIt may be enabled by setting the 111cc090be0SBruce M Simpson.Xr sysctl 8 112cc090be0SBruce M SimpsonMIB variable 113cc090be0SBruce M Simpson.Va net.link.ether.inet.proxyall 114cc090be0SBruce M Simpsonto 1. 1151a5d3a92SGleb Smirnoff.Sh MIB Variables 1168972c8b6SJoel DahlThe ARP protocol implements a number of configurable variables in 1171a5d3a92SGleb Smirnoff.Va net.link.ether.inet 1181a5d3a92SGleb Smirnoffbranch 1191a5d3a92SGleb Smirnoffof the 1201a5d3a92SGleb Smirnoff.Xr sysctl 3 1211a5d3a92SGleb SmirnoffMIB. 1225610c8a7SGleb Smirnoff.Bl -tag -width "log_arp_permanent_modify" 123478df1d5SGleb Smirnoff.It Va allow_multicast 124478df1d5SGleb SmirnoffShould the kernel install ARP entries with multicast bit set in 125478df1d5SGleb Smirnoffthe hardware address. 126478df1d5SGleb SmirnoffInstalling such entries is RFC 1812 violation, but some prorietary 127478df1d5SGleb Smirnoffload balancing techniques require routers on network to do so. 128478df1d5SGleb SmirnoffTurned off by default. 129*35ef77a2SEric van Gyzen.It Va garp_rexmit_count 130*35ef77a2SEric van GyzenShould the kernel retransmit gratuitous ARP (GARP) packets when an IPv4 address 131*35ef77a2SEric van Gyzenis added to an interface. 132*35ef77a2SEric van GyzenA GARP is always transmitted when an IPv4 address is added to an interface. 133*35ef77a2SEric van GyzenA non-zero value of this sysctl will cause the GARP packet to be retransmitted 134*35ef77a2SEric van Gyzenthe stated number of times. 135*35ef77a2SEric van GyzenThe interval between retransmissions is doubled each time, so the 136*35ef77a2SEric van Gyzenretransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). 137*35ef77a2SEric van GyzenThe default value of zero means only the initial GARP is sent; no 138*35ef77a2SEric van Gyzenadditional GARP packets are retransmitted. 139*35ef77a2SEric van GyzenThe maximum value is sixteen. 140*35ef77a2SEric van Gyzen.Pp 141*35ef77a2SEric van GyzenAlthough a single GARP packet (the default behavior) is usually sufficient, in 142*35ef77a2SEric van Gyzensome circumstances, such as when a shared address is passed between cluster 143*35ef77a2SEric van Gyzennodes, this single GARP may be dropped or lost. 144*35ef77a2SEric van GyzenThis can lead to neighbors on the network link working with a stale ARP cache 145*35ef77a2SEric van Gyzenand sending packets destined for that address to the node that previously owned 146*35ef77a2SEric van Gyzenthe address, which may not respond. 1475610c8a7SGleb Smirnoff.It Va log_arp_movements 1485610c8a7SGleb SmirnoffShould the kernel log movements of IP addresses from one hardware 1495610c8a7SGleb Smirnoffaddress to an other. 1505610c8a7SGleb SmirnoffSee 1515610c8a7SGleb Smirnoff.Sx DIAGNOSTICS 1525610c8a7SGleb Smirnoffbelow. 1535610c8a7SGleb SmirnoffTurned on by default. 1545610c8a7SGleb Smirnoff.It Va log_arp_permanent_modify 1555610c8a7SGleb SmirnoffShould the kernel log attempts of remote host on network to modify a 1565610c8a7SGleb Smirnoffpermanent ARP entry. 1575610c8a7SGleb SmirnoffSee 1585610c8a7SGleb Smirnoff.Sx DIAGNOSTICS 1595610c8a7SGleb Smirnoffbelow. 1605610c8a7SGleb SmirnoffTurned on by default. 1615610c8a7SGleb Smirnoff.It Va log_arp_wrong_iface 1625610c8a7SGleb SmirnoffShould the kernel log attempts to insert an ARP entry on an interface 1635610c8a7SGleb Smirnoffwhen the IP network the address belongs to is connected to an other 1645610c8a7SGleb Smirnoffinterface. 1655610c8a7SGleb SmirnoffSee 1665610c8a7SGleb Smirnoff.Sx DIAGNOSTICS 1675610c8a7SGleb Smirnoffbelow. 1685610c8a7SGleb SmirnoffTurned on by default. 1695d81d095SGleb Smirnoff.It Va max_log_per_second 1705d81d095SGleb SmirnoffLimit number of remotely triggered logging events to a configured value 1715d81d095SGleb Smirnoffper second. 1725d81d095SGleb SmirnoffDefault is 1 log message per second. 17344ec3c8cSGleb Smirnoff.It Va max_age 17444ec3c8cSGleb SmirnoffHow long an ARP entry is held in the cache until it needs to be refreshed. 1755610c8a7SGleb SmirnoffDefault is 1200 seconds. 1765610c8a7SGleb Smirnoff.It Va maxhold 1775610c8a7SGleb SmirnoffHow many packets hold in the per-entry output queue while the entry 1785610c8a7SGleb Smirnoffis being resolved. 1795610c8a7SGleb SmirnoffDefault is one packet. 18044ec3c8cSGleb Smirnoff.It Va maxtries 1811a5d3a92SGleb SmirnoffNumber of retransmits before host is considered down and error is returned. 1825610c8a7SGleb SmirnoffDefault is 5 tries. 1835610c8a7SGleb Smirnoff.It Va proxyall 1845610c8a7SGleb SmirnoffEnables ARP proxying for all hosts on net. 1855610c8a7SGleb SmirnoffTurned off by default. 1865610c8a7SGleb Smirnoff.It Va wait 1875610c8a7SGleb SmirnoffLifetime of an incomplete ARP entry. 1885610c8a7SGleb SmirnoffDefault is 20 seconds. 1891a5d3a92SGleb Smirnoff.El 19084e59eb5SGarrett Wollman.Sh DIAGNOSTICS 191bc84aa4bSRuslan Ermilov.Bl -diag 1925610c8a7SGleb Smirnoff.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d on %s!" 19384e59eb5SGarrett WollmanARP has discovered another host on the local network which responds to 19484e59eb5SGarrett Wollmanmapping requests for its own Internet address with a different Ethernet 19584e59eb5SGarrett Wollmanaddress, generally indicating that two hosts are attempting to use the 19684e59eb5SGarrett Wollmansame Internet address. 197bc84aa4bSRuslan Ermilov.It "arp: link address is broadcast for IP address %d.%d.%d.%d!" 19831a32280SBill FennerARP requested information for a host, and received an answer indicating 19931a32280SBill Fennerthat the host's ethernet address is the ethernet broadcast address. 20031a32280SBill FennerThis indicates a misconfigured or broken device. 201bc84aa4bSRuslan Ermilov.It "arp: %d.%d.%d.%d moved from %x:%x:%x:%x:%x:%x to %x:%x:%x:%x:%x:%x on %s" 20231a32280SBill FennerARP had a cached value for the ethernet address of the referenced host, 2030cc7c160SBruce M Simpsonbut received a reply indicating that the host is at a new address. 2040cc7c160SBruce M SimpsonThis can happen normally when host hardware addresses change, 2050cc7c160SBruce M Simpsonor when a mobile node arrives or leaves the local subnet. 2060cc7c160SBruce M SimpsonIt can also indicate a problem with proxy ARP. 2071e709b6fSBruce M SimpsonThis message can only be issued if the sysctl 20843039b7dSBruce M Simpson.Va net.link.ether.inet.log_arp_movements 2091e709b6fSBruce M Simpsonis set to 1, which is the system's default behaviour. 210bc84aa4bSRuslan Ermilov.It "arpresolve: can't allocate llinfo for %d.%d.%d.%d" 21131a32280SBill FennerThe route for the referenced host points to a device upon which ARP is 21231a32280SBill Fennerrequired, but ARP was unable to allocate a routing table entry in which 2130cc7c160SBruce M Simpsonto store the host's MAC address. 2140cc7c160SBruce M SimpsonThis usually points to a misconfigured routing table. 2150cc7c160SBruce M SimpsonIt can also occur if the kernel cannot allocate memory. 216bc84aa4bSRuslan Ermilov.It "arp: %d.%d.%d.%d is on if0 but got reply from %x:%x:%x:%x:%x:%x on if1" 2174cd8d8d5SBruce M SimpsonPhysical connections exist to the same logical IP network on both if0 and if1. 2184cd8d8d5SBruce M SimpsonIt can also occur if an entry already exists in the ARP cache for the IP 2194cd8d8d5SBruce M Simpsonaddress above, and the cable has been disconnected from if0, then reconnected 2204cd8d8d5SBruce M Simpsonto if1. 2214cd8d8d5SBruce M SimpsonThis message can only be issued if the sysctl 22243039b7dSBruce M Simpson.Va net.link.ether.inet.log_arp_wrong_iface 2234cd8d8d5SBruce M Simpsonis set to 1, which is the system's default behaviour. 224bc84aa4bSRuslan Ermilov.It "arp: %x:%x:%x:%x:%x:%x attempts to modify permanent entry for %d.%d.%d.%d on %s" 22539393906SGleb SmirnoffARP has received an ARP reply that attempts to overwrite a permanent 226bc84aa4bSRuslan Ermiloventry in the local ARP table. 227bc84aa4bSRuslan ErmilovThis error will only be logged if the sysctl 22839393906SGleb Smirnoff.Va net.link.ether.inet.log_arp_permanent_modify 22939393906SGleb Smirnoffis set to 1, which is the system's default behaviour. 230478df1d5SGleb Smirnoff.It "arp: %x:%x:%x:%x:%x:%x is multicast" 231478df1d5SGleb SmirnoffKernel refused to install an entry with multicast hardware address. 232478df1d5SGleb SmirnoffIf you really want such addresses being installed, set the sysctl 233478df1d5SGleb Smirnoff.Va net.link.ether.inet.allow_multicast 234478df1d5SGleb Smirnoffto a positive value. 235bc84aa4bSRuslan Ermilov.El 23684e59eb5SGarrett Wollman.Sh SEE ALSO 23784e59eb5SGarrett Wollman.Xr inet 4 , 23884e59eb5SGarrett Wollman.Xr route 4 , 23984e59eb5SGarrett Wollman.Xr arp 8 , 24084e59eb5SGarrett Wollman.Xr ifconfig 8 , 2411e709b6fSBruce M Simpson.Xr route 8 , 2421e709b6fSBruce M Simpson.Xr sysctl 8 24384e59eb5SGarrett Wollman.Rs 24484e59eb5SGarrett Wollman.%A Plummer, D. 24584e59eb5SGarrett Wollman.%B "An Ethernet Address Resolution Protocol" 24684e59eb5SGarrett Wollman.%T RFC826 24784e59eb5SGarrett Wollman.Re 24884e59eb5SGarrett Wollman.Rs 24984e59eb5SGarrett Wollman.%A Leffler, S.J. 25084e59eb5SGarrett Wollman.%A Karels, M.J. 251c2965cd1SJoel Dahl.%B "Trailer Encapsulations" 25284e59eb5SGarrett Wollman.%T RFC893 25384e59eb5SGarrett Wollman.Re 254