xref: /freebsd/usr.sbin/arp/arp.4 (revision 1e709b6f234efeec3d3a85a89e51ef170c0f8bac)
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.\" 3. All advertising materials mentioning features or use of this software
1384e59eb5SGarrett Wollman.\"    must display the following acknowledgement:
1484e59eb5SGarrett Wollman.\"	This product includes software developed by the University of
1584e59eb5SGarrett Wollman.\"	California, Berkeley and its contributors.
1684e59eb5SGarrett Wollman.\" 4. Neither the name of the University nor the names of its contributors
1784e59eb5SGarrett Wollman.\"    may be used to endorse or promote products derived from this software
1884e59eb5SGarrett Wollman.\"    without specific prior written permission.
1984e59eb5SGarrett Wollman.\"
2084e59eb5SGarrett Wollman.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2184e59eb5SGarrett Wollman.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2284e59eb5SGarrett Wollman.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2384e59eb5SGarrett Wollman.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2484e59eb5SGarrett Wollman.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2584e59eb5SGarrett Wollman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2684e59eb5SGarrett Wollman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2784e59eb5SGarrett Wollman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2884e59eb5SGarrett Wollman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2984e59eb5SGarrett Wollman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3084e59eb5SGarrett Wollman.\" SUCH DAMAGE.
3184e59eb5SGarrett Wollman.\"
3284e59eb5SGarrett Wollman.\"	@(#)arp4.4	6.5 (Berkeley) 4/18/94
3397d92980SPeter Wemm.\" $FreeBSD$
3484e59eb5SGarrett Wollman.\"
3584e59eb5SGarrett Wollman.Dd April 18, 1994
3684e59eb5SGarrett Wollman.Dt ARP 4
37a4c37c81SRuslan Ermilov.Os
3884e59eb5SGarrett Wollman.Sh NAME
3984e59eb5SGarrett Wollman.Nm arp
4084e59eb5SGarrett Wollman.Nd Address Resolution Protocol
4184e59eb5SGarrett Wollman.Sh SYNOPSIS
422dab76f7SRuslan Ermilov.Cd "device ether"
4384e59eb5SGarrett Wollman.Sh DESCRIPTION
448a4e4849SJeroen Ruigrok van der WervenThe Address Resolution Protocol (ARP) is used to dynamically
458a4e4849SJeroen Ruigrok van der Wervenmap between Protocol Addresses (such as IP addresses) and
468a4e4849SJeroen Ruigrok van der WervenLocal Network Addresses (such as Ethernet addresses).
478a4e4849SJeroen Ruigrok van der WervenThis implementation maps IP addresses to Ethernet,
488a4e4849SJeroen Ruigrok van der WervenARCnet,
498a4e4849SJeroen Ruigrok van der Wervenor Token Ring addresses.
508a4e4849SJeroen Ruigrok van der WervenIt is used by all the Ethernet interface drivers.
5184e59eb5SGarrett Wollman.Pp
5284e59eb5SGarrett WollmanARP caches Internet-Ethernet address mappings.
5384e59eb5SGarrett WollmanWhen an interface requests a mapping for an address not in the cache,
5484e59eb5SGarrett WollmanARP queues the message which requires the mapping and broadcasts
5584e59eb5SGarrett Wollmana message on the associated network requesting the address mapping.
5684e59eb5SGarrett WollmanIf a response is provided, the new mapping is cached and any pending
5784e59eb5SGarrett Wollmanmessage is transmitted.
5884e59eb5SGarrett WollmanARP will queue at most one packet while waiting for a response to a
5984e59eb5SGarrett Wollmanmapping request;
6084e59eb5SGarrett Wollmanonly the most recently ``transmitted'' packet is kept.
6184e59eb5SGarrett WollmanIf the target host does not respond after several requests,
6284e59eb5SGarrett Wollmanthe host is considered to be down for a short period (normally 20 seconds),
6384e59eb5SGarrett Wollmanallowing an error to be returned to transmission attempts during this
6484e59eb5SGarrett Wollmaninterval.
6584e59eb5SGarrett WollmanThe error is
66b92a189eSRuslan Ermilov.Er EHOSTDOWN
6784e59eb5SGarrett Wollmanfor a non-responding destination host, and
68b92a189eSRuslan Ermilov.Er EHOSTUNREACH
6984e59eb5SGarrett Wollmanfor a non-responding router.
7084e59eb5SGarrett Wollman.Pp
7184e59eb5SGarrett WollmanThe ARP cache is stored in the system routing table as
7284e59eb5SGarrett Wollmandynamically-created host routes.
7384e59eb5SGarrett WollmanThe route to a directly-attached Ethernet network is installed as a
7484e59eb5SGarrett Wollman.Dq cloning
7584e59eb5SGarrett Wollmanroute (one with the
7684e59eb5SGarrett Wollman.Li RTF_CLONING
7784e59eb5SGarrett Wollmanflag set),
7884e59eb5SGarrett Wollmancausing routes to individual hosts on that network to be created on
7984e59eb5SGarrett Wollmandemand.
8084e59eb5SGarrett WollmanThese routes time out periodically (normally 20 minutes after validated;
8184e59eb5SGarrett Wollmanentries are not validated when not in use).
8284e59eb5SGarrett WollmanAn entry for a host which is not responding is a
8384e59eb5SGarrett Wollman.Dq reject
8484e59eb5SGarrett Wollmanroute (one with the
8584e59eb5SGarrett Wollman.Li RTF_REJECT
8684e59eb5SGarrett Wollmanflag set).
8784e59eb5SGarrett Wollman.Pp
8884e59eb5SGarrett WollmanARP entries may be added, deleted or changed with the
8984e59eb5SGarrett Wollman.Xr arp 8
9084e59eb5SGarrett Wollmanutility.
9184e59eb5SGarrett WollmanManually-added entries may be temporary or permanent,
9284e59eb5SGarrett Wollmanand may be
9384e59eb5SGarrett Wollman.Dq published ,
9484e59eb5SGarrett Wollmanin which case the system will respond to ARP requests for that host
9584e59eb5SGarrett Wollmanas if it were the target of the request.
9684e59eb5SGarrett Wollman.Pp
9784e59eb5SGarrett WollmanIn the past,
9884e59eb5SGarrett WollmanARP was used to negotiate the use of a trailer encapsulation.
9984e59eb5SGarrett WollmanThis is no longer supported.
10084e59eb5SGarrett Wollman.Pp
10184e59eb5SGarrett WollmanARP watches passively for hosts impersonating the local host (i.e. a host
10284e59eb5SGarrett Wollmanwhich responds to an ARP mapping request for the local host's address).
10384e59eb5SGarrett Wollman.Sh DIAGNOSTICS
10431a32280SBill Fenner.Em "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d!" :
10584e59eb5SGarrett WollmanARP has discovered another host on the local network which responds to
10684e59eb5SGarrett Wollmanmapping requests for its own Internet address with a different Ethernet
10784e59eb5SGarrett Wollmanaddress, generally indicating that two hosts are attempting to use the
10884e59eb5SGarrett Wollmansame Internet address.
10931a32280SBill Fenner.Pp
11031a32280SBill Fenner.Em "arp: ether address is broadcast for IP address %d.%d.%d.%d!" :
11131a32280SBill FennerARP requested information for a host, and received an answer indicating
11231a32280SBill Fennerthat the host's ethernet address is the ethernet broadcast address.
11331a32280SBill FennerThis indicates a misconfigured or broken device.
11431a32280SBill Fenner.Pp
11531a32280SBill Fenner.Em "arp: %d.%d.%d.%d moved from %x:%x:%x:%x:%x:%x to %x:%x:%x:%x:%x:%x" :
11631a32280SBill FennerARP had a cached value for the ethernet address of the referenced host,
11731a32280SBill Fennerbut received a reply indicating that the host is at a new address.  This
11831a32280SBill Fennercan happen normally when host hardware addresses change, or when a mobile
11931a32280SBill Fennernode arrives or leaves the local subnet.  It can also indicate a problem
12031a32280SBill Fennerwith proxy ARP.
1211e709b6fSBruce M SimpsonThis message can only be issued if the sysctl
1221e709b6fSBruce M Simpson.Dv net.link.ether.inet.log_arp_movements
1231e709b6fSBruce M Simpsonis set to 1, which is the system's default behaviour.
12431a32280SBill Fenner.Pp
12531a32280SBill Fenner.Em "arpresolve: can't allocate llinfo for %d.%d.%d.%d" :
12631a32280SBill FennerThe route for the referenced host points to a device upon which ARP is
12731a32280SBill Fennerrequired, but ARP was unable to allocate a routing table entry in which
12831a32280SBill Fennerto store the host's MAC address.  This usually points to a misconfigured
12931a32280SBill Fennerrouting table.  It can also occur if the kernel cannot allocate memory.
1304cd8d8d5SBruce M Simpson.Pp
1314cd8d8d5SBruce M Simpson.Em "arp: %d.%d.%d.%d is on if0 but got reply from %x:%x:%x:%x:%x:%x on if1" :
1324cd8d8d5SBruce M SimpsonPhysical connections exist to the same logical IP network on both if0 and if1.
1334cd8d8d5SBruce M SimpsonIt can also occur if an entry already exists in the ARP cache for the IP
1344cd8d8d5SBruce M Simpsonaddress above, and the cable has been disconnected from if0, then reconnected
1354cd8d8d5SBruce M Simpsonto if1.
1364cd8d8d5SBruce M SimpsonThis message can only be issued if the sysctl
1374cd8d8d5SBruce M Simpson.Dv net.link.ether.inet.log_arp_wrong_iface
1384cd8d8d5SBruce M Simpsonis set to 1, which is the system's default behaviour.
13984e59eb5SGarrett Wollman.Sh SEE ALSO
14084e59eb5SGarrett Wollman.Xr inet 4 ,
14184e59eb5SGarrett Wollman.Xr route 4 ,
14284e59eb5SGarrett Wollman.Xr arp 8 ,
14384e59eb5SGarrett Wollman.Xr ifconfig 8 ,
1441e709b6fSBruce M Simpson.Xr route 8 ,
1451e709b6fSBruce M Simpson.Xr sysctl 8
14684e59eb5SGarrett Wollman.Rs
14784e59eb5SGarrett Wollman.%A Plummer, D.
14884e59eb5SGarrett Wollman.%B "An Ethernet Address Resolution Protocol"
14984e59eb5SGarrett Wollman.%T RFC826
15084e59eb5SGarrett Wollman.Re
15184e59eb5SGarrett Wollman.Rs
15284e59eb5SGarrett Wollman.%A Leffler, S.J.
15384e59eb5SGarrett Wollman.%A Karels, M.J.
15484e59eb5SGarrett Wollman.%B "Trailer Encapsulations
15584e59eb5SGarrett Wollman.%T RFC893
15684e59eb5SGarrett Wollman.Re
157