1fa74a859Slogwang.\" Copyright (c) 1985, 1986, 1988, 1994 2fa74a859Slogwang.\" The Regents of the University of California. All rights reserved. 3fa74a859Slogwang.\" 4fa74a859Slogwang.\" Redistribution and use in source and binary forms, with or without 5fa74a859Slogwang.\" modification, are permitted provided that the following conditions 6fa74a859Slogwang.\" are met: 7fa74a859Slogwang.\" 1. Redistributions of source code must retain the above copyright 8fa74a859Slogwang.\" notice, this list of conditions and the following disclaimer. 9fa74a859Slogwang.\" 2. Redistributions in binary form must reproduce the above copyright 10fa74a859Slogwang.\" notice, this list of conditions and the following disclaimer in the 11fa74a859Slogwang.\" documentation and/or other materials provided with the distribution. 12*22ce4affSfengbojiang.\" 3. Neither the name of the University nor the names of its contributors 13fa74a859Slogwang.\" may be used to endorse or promote products derived from this software 14fa74a859Slogwang.\" without specific prior written permission. 15fa74a859Slogwang.\" 16fa74a859Slogwang.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17fa74a859Slogwang.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18fa74a859Slogwang.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19fa74a859Slogwang.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20fa74a859Slogwang.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21fa74a859Slogwang.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22fa74a859Slogwang.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23fa74a859Slogwang.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24fa74a859Slogwang.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25fa74a859Slogwang.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26fa74a859Slogwang.\" SUCH DAMAGE. 27fa74a859Slogwang.\" 28fa74a859Slogwang.\" @(#)arp4.4 6.5 (Berkeley) 4/18/94 29fa74a859Slogwang.\" $FreeBSD$ 30fa74a859Slogwang.\" 31*22ce4affSfengbojiang.Dd October 7, 2016 32fa74a859Slogwang.Dt ARP 4 33fa74a859Slogwang.Os 34fa74a859Slogwang.Sh NAME 35fa74a859Slogwang.Nm arp 36fa74a859Slogwang.Nd Address Resolution Protocol 37fa74a859Slogwang.Sh SYNOPSIS 38fa74a859Slogwang.Cd "device ether" 39fa74a859Slogwang.Sh DESCRIPTION 40fa74a859SlogwangThe Address Resolution Protocol (ARP) is used to dynamically 41fa74a859Slogwangmap between Protocol Addresses (such as IP addresses) and 42fa74a859SlogwangLocal Network Addresses (such as Ethernet addresses). 43*22ce4affSfengbojiangThis implementation maps IP addresses to Ethernet addresses. 44fa74a859SlogwangIt is used by all the Ethernet interface drivers. 45fa74a859Slogwang.Pp 46fa74a859SlogwangARP caches Internet-Ethernet address mappings. 47fa74a859SlogwangWhen an interface requests a mapping for an address not in the cache, 48fa74a859SlogwangARP queues the message which requires the mapping and broadcasts 49fa74a859Slogwanga message on the associated network requesting the address mapping. 50fa74a859SlogwangIf a response is provided, the new mapping is cached and any pending 51fa74a859Slogwangmessage is transmitted. 52*22ce4affSfengbojiangARP will queue at most 53*22ce4affSfengbojiang.Va net.link.ether.inet.maxhold 54*22ce4affSfengbojiangpackets while waiting for a response to a mapping request; 55*22ce4affSfengbojiangonly the most recently ``transmitted'' packets are kept. 56fa74a859SlogwangIf the target host does not respond after several requests, 57fa74a859Slogwangthe host is considered to be down allowing an error to be returned to 58fa74a859Slogwangtransmission attempts. 59fa74a859SlogwangFurther demand for this mapping causes ARP request retransmissions, that 60fa74a859Slogwangare ratelimited to one packet per second. 61fa74a859SlogwangThe error is 62fa74a859Slogwang.Er EHOSTDOWN 63fa74a859Slogwangfor a non-responding destination host, and 64fa74a859Slogwang.Er EHOSTUNREACH 65fa74a859Slogwangfor a non-responding router. 66fa74a859Slogwang.Pp 67*22ce4affSfengbojiangThe ARP cache is stored in per-interface link-level table. 68fa74a859Slogwang.Pp 69fa74a859SlogwangARP entries may be added, deleted or changed with the 70fa74a859Slogwang.Xr arp 8 71fa74a859Slogwangutility. 72fa74a859SlogwangManually-added entries may be temporary or permanent, 73fa74a859Slogwangand may be 74fa74a859Slogwang.Dq published , 75fa74a859Slogwangin which case the system will respond to ARP requests for that host 76fa74a859Slogwangas if it were the target of the request. 77fa74a859Slogwang.Pp 78fa74a859SlogwangIn the past, 79fa74a859SlogwangARP was used to negotiate the use of a trailer encapsulation. 80fa74a859SlogwangThis is no longer supported. 81fa74a859Slogwang.Pp 82fa74a859SlogwangARP watches passively for hosts impersonating the local host (i.e., a host 83fa74a859Slogwangwhich responds to an ARP mapping request for the local host's address). 84fa74a859Slogwang.Pp 85fa74a859SlogwangProxy ARP is a feature whereby the local host will respond to requests 86fa74a859Slogwangfor addresses other than itself, with its own address. 87fa74a859SlogwangNormally, proxy ARP in 88fa74a859Slogwang.Fx 89fa74a859Slogwangis set up on a host-by-host basis using the 90fa74a859Slogwang.Xr arp 8 91fa74a859Slogwangutility, by adding an entry for each host inside a given subnet for 92fa74a859Slogwangwhich proxying of ARP requests is desired. 93fa74a859SlogwangHowever, the 94fa74a859Slogwang.Dq "proxy all" 95fa74a859Slogwangfeature causes the local host to act as a proxy for 96fa74a859Slogwang.Em all 97fa74a859Slogwanghosts reachable through some other network interface, 98fa74a859Slogwangdifferent from the one the request came in from. 99fa74a859SlogwangIt may be enabled by setting the 100fa74a859Slogwang.Xr sysctl 8 101fa74a859SlogwangMIB variable 102fa74a859Slogwang.Va net.link.ether.inet.proxyall 103fa74a859Slogwangto 1. 104fa74a859Slogwang.Sh MIB Variables 105fa74a859SlogwangThe ARP protocol implements a number of configurable variables in 106fa74a859Slogwang.Va net.link.ether.inet 107fa74a859Slogwangbranch 108fa74a859Slogwangof the 109fa74a859Slogwang.Xr sysctl 3 110fa74a859SlogwangMIB. 111fa74a859Slogwang.Bl -tag -width "log_arp_permanent_modify" 112fa74a859Slogwang.It Va allow_multicast 113*22ce4affSfengbojiangInstall ARP entries with the multicast bit set in the hardware address. 114*22ce4affSfengbojiangInstalling such entries is an RFC 1812 violation, but some proprietary load 115*22ce4affSfengbojiangbalancing techniques require routers to do so. 116fa74a859SlogwangTurned off by default. 117*22ce4affSfengbojiang.It Va garp_rexmit_count 118*22ce4affSfengbojiangRetransmit gratuitous ARP (GARP) packets when an IPv4 address is added to an 119*22ce4affSfengbojianginterface. 120*22ce4affSfengbojiangA GARP is always transmitted when an IPv4 address is added to an interface. 121*22ce4affSfengbojiangA non-zero value causes the GARP packet to be retransmitted the stated number 122*22ce4affSfengbojiangof times. 123*22ce4affSfengbojiangThe interval between retransmissions is doubled each time, so the 124*22ce4affSfengbojiangretransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). 125*22ce4affSfengbojiangThe default value of zero means only the initial GARP is sent; no 126*22ce4affSfengbojiangadditional GARP packets are retransmitted. 127*22ce4affSfengbojiangThe maximum value is sixteen. 128*22ce4affSfengbojiang.Pp 129*22ce4affSfengbojiangThe default behavior of a single GARP packet is usually sufficient. 130*22ce4affSfengbojiangHowever, a single GARP might be dropped or lost in some circumstances. 131*22ce4affSfengbojiangThis is particularly harmful when a shared address is passed between cluster 132*22ce4affSfengbojiangnodes. 133*22ce4affSfengbojiangNeighbors on the network link might then work with a stale ARP cache and send 134*22ce4affSfengbojiangpackets destined for that address to the node that previously owned the 135*22ce4affSfengbojiangaddress, which might not respond. 136fa74a859Slogwang.It Va log_arp_movements 137*22ce4affSfengbojiangLog movements of IP addresses from one hardware address to another. 138fa74a859SlogwangSee 139fa74a859Slogwang.Sx DIAGNOSTICS 140fa74a859Slogwangbelow. 141fa74a859SlogwangTurned on by default. 142fa74a859Slogwang.It Va log_arp_permanent_modify 143*22ce4affSfengbojiangLog attempts by a remote host to modify a permanent ARP entry. 144fa74a859SlogwangSee 145fa74a859Slogwang.Sx DIAGNOSTICS 146fa74a859Slogwangbelow. 147fa74a859SlogwangTurned on by default. 148fa74a859Slogwang.It Va log_arp_wrong_iface 149*22ce4affSfengbojiangLog attempts to insert an ARP entry on an interface when the IP network to 150*22ce4affSfengbojiangwhich the address belongs is connected to another interface. 151fa74a859SlogwangSee 152fa74a859Slogwang.Sx DIAGNOSTICS 153fa74a859Slogwangbelow. 154fa74a859SlogwangTurned on by default. 155fa74a859Slogwang.It Va max_log_per_second 156*22ce4affSfengbojiangLimit the number of remotely triggered logging events to a configured value per 157*22ce4affSfengbojiangsecond. 158fa74a859SlogwangDefault is 1 log message per second. 159fa74a859Slogwang.It Va max_age 160fa74a859SlogwangHow long an ARP entry is held in the cache until it needs to be refreshed. 161fa74a859SlogwangDefault is 1200 seconds. 162fa74a859Slogwang.It Va maxhold 163*22ce4affSfengbojiangHow many packets to hold in the per-entry output queue while the entry 164fa74a859Slogwangis being resolved. 165*22ce4affSfengbojiangDefault is 16 packets. 166fa74a859Slogwang.It Va maxtries 167*22ce4affSfengbojiangNumber of retransmits before a host is considered down and an error is 168*22ce4affSfengbojiangreturned. 169fa74a859SlogwangDefault is 5 tries. 170fa74a859Slogwang.It Va proxyall 171*22ce4affSfengbojiangEnables ARP proxying. 172fa74a859SlogwangTurned off by default. 173fa74a859Slogwang.It Va wait 174fa74a859SlogwangLifetime of an incomplete ARP entry. 175fa74a859SlogwangDefault is 20 seconds. 176fa74a859Slogwang.El 177fa74a859Slogwang.Sh DIAGNOSTICS 178fa74a859Slogwang.Bl -diag 179fa74a859Slogwang.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d on %s!" 180fa74a859SlogwangARP has discovered another host on the local network which responds to 181fa74a859Slogwangmapping requests for its own Internet address with a different Ethernet 182fa74a859Slogwangaddress, generally indicating that two hosts are attempting to use the 183fa74a859Slogwangsame Internet address. 184fa74a859Slogwang.It "arp: link address is broadcast for IP address %d.%d.%d.%d!" 185fa74a859SlogwangARP requested information for a host, and received an answer indicating 186fa74a859Slogwangthat the host's ethernet address is the ethernet broadcast address. 187fa74a859SlogwangThis indicates a misconfigured or broken device. 188fa74a859Slogwang.It "arp: %d.%d.%d.%d moved from %x:%x:%x:%x:%x:%x to %x:%x:%x:%x:%x:%x on %s" 189fa74a859SlogwangARP had a cached value for the ethernet address of the referenced host, 190fa74a859Slogwangbut received a reply indicating that the host is at a new address. 191fa74a859SlogwangThis can happen normally when host hardware addresses change, 192fa74a859Slogwangor when a mobile node arrives or leaves the local subnet. 193fa74a859SlogwangIt can also indicate a problem with proxy ARP. 194fa74a859SlogwangThis message can only be issued if the sysctl 195fa74a859Slogwang.Va net.link.ether.inet.log_arp_movements 196fa74a859Slogwangis set to 1, which is the system's default behaviour. 197fa74a859Slogwang.It "arpresolve: can't allocate llinfo for %d.%d.%d.%d" 198fa74a859SlogwangThe route for the referenced host points to a device upon which ARP is 199fa74a859Slogwangrequired, but ARP was unable to allocate a routing table entry in which 200fa74a859Slogwangto store the host's MAC address. 201fa74a859SlogwangThis usually points to a misconfigured routing table. 202fa74a859SlogwangIt can also occur if the kernel cannot allocate memory. 203fa74a859Slogwang.It "arp: %d.%d.%d.%d is on if0 but got reply from %x:%x:%x:%x:%x:%x on if1" 204fa74a859SlogwangPhysical connections exist to the same logical IP network on both if0 and if1. 205fa74a859SlogwangIt can also occur if an entry already exists in the ARP cache for the IP 206fa74a859Slogwangaddress above, and the cable has been disconnected from if0, then reconnected 207fa74a859Slogwangto if1. 208fa74a859SlogwangThis message can only be issued if the sysctl 209fa74a859Slogwang.Va net.link.ether.inet.log_arp_wrong_iface 210fa74a859Slogwangis set to 1, which is the system's default behaviour. 211fa74a859Slogwang.It "arp: %x:%x:%x:%x:%x:%x attempts to modify permanent entry for %d.%d.%d.%d on %s" 212fa74a859SlogwangARP has received an ARP reply that attempts to overwrite a permanent 213fa74a859Slogwangentry in the local ARP table. 214fa74a859SlogwangThis error will only be logged if the sysctl 215fa74a859Slogwang.Va net.link.ether.inet.log_arp_permanent_modify 216fa74a859Slogwangis set to 1, which is the system's default behaviour. 217fa74a859Slogwang.It "arp: %x:%x:%x:%x:%x:%x is multicast" 218fa74a859SlogwangKernel refused to install an entry with multicast hardware address. 219fa74a859SlogwangIf you really want such addresses being installed, set the sysctl 220fa74a859Slogwang.Va net.link.ether.inet.allow_multicast 221fa74a859Slogwangto a positive value. 222fa74a859Slogwang.El 223fa74a859Slogwang.Sh SEE ALSO 224fa74a859Slogwang.Xr inet 4 , 225fa74a859Slogwang.Xr route 4 , 226fa74a859Slogwang.Xr arp 8 , 227fa74a859Slogwang.Xr ifconfig 8 , 228fa74a859Slogwang.Xr route 8 , 229fa74a859Slogwang.Xr sysctl 8 230fa74a859Slogwang.Rs 231fa74a859Slogwang.%A Plummer, D. 232fa74a859Slogwang.%B "An Ethernet Address Resolution Protocol" 233fa74a859Slogwang.%T RFC826 234fa74a859Slogwang.Re 235fa74a859Slogwang.Rs 236fa74a859Slogwang.%A Leffler, S.J. 237fa74a859Slogwang.%A Karels, M.J. 238fa74a859Slogwang.%B "Trailer Encapsulations" 239fa74a859Slogwang.%T RFC893 240fa74a859Slogwang.Re 241