xref: /openbsd-src/usr.sbin/arp/arp.8 (revision bf1f2a6a5061d27184fb96f80565bf75477186c1)
1*bf1f2a6aSkn.\"	$OpenBSD: arp.8,v 1.40 2019/08/27 20:50:36 kn Exp $
2df930be7Sderaadt.\"	$NetBSD: arp.8,v 1.7 1995/03/01 11:50:59 chopps Exp $
3df930be7Sderaadt.\"
4df930be7Sderaadt.\" Copyright (c) 1985, 1991, 1993
5df930be7Sderaadt.\"	The Regents of the University of California.  All rights reserved.
6df930be7Sderaadt.\"
7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without
8df930be7Sderaadt.\" modification, are permitted provided that the following conditions
9df930be7Sderaadt.\" are met:
10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright
11df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer.
12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
13df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
14df930be7Sderaadt.\"    documentation and/or other materials provided with the distribution.
1529295d1cSmillert.\" 3. Neither the name of the University nor the names of its contributors
16df930be7Sderaadt.\"    may be used to endorse or promote products derived from this software
17df930be7Sderaadt.\"    without specific prior written permission.
18df930be7Sderaadt.\"
19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22df930be7Sderaadt.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29df930be7Sderaadt.\" SUCH DAMAGE.
30df930be7Sderaadt.\"
31df930be7Sderaadt.\"	from: @(#)arp.8	8.1 (Berkeley) 6/6/93
32df930be7Sderaadt.\"
33*bf1f2a6aSkn.Dd $Mdocdate: August 27 2019 $
34df930be7Sderaadt.Dt ARP 8
35fc8533a3Saaron.Os
36df930be7Sderaadt.Sh NAME
37df930be7Sderaadt.Nm arp
38df930be7Sderaadt.Nd address resolution display and control
39df930be7Sderaadt.Sh SYNOPSIS
40df930be7Sderaadt.Nm arp
41d13fc9d9Sjmc.Op Fl adn
42cc0444d0Sclaudio.Op Fl V Ar rdomain
43df930be7Sderaadt.Ar hostname
44df930be7Sderaadt.Nm arp
45f4619fa8Shenning.Op Fl F
46d13fc9d9Sjmc.Op Fl f Ar file
47cc0444d0Sclaudio.Op Fl V Ar rdomain
48df930be7Sderaadt.Fl s Ar hostname ether_addr
49a61997d9Sjaredy.Op Cm temp | permanent
50a61997d9Sjaredy.Op Cm pub
51bc878e5dSjasper.Nm
52be531289Sjmc.Fl W Ar ether_addr Op Ar iface
53df930be7Sderaadt.Sh DESCRIPTION
54df930be7SderaadtThe
556931a8aaSaaron.Nm
56df930be7Sderaadtprogram displays and modifies the Internet-to-Ethernet address translation
57df8e2a83Sthibtables used by the address resolution protocol (ARP).
58df930be7Sderaadt.Pp
59df8e2a83Sthib.Nm
60df8e2a83Sthibdisplays the current ARP entry for
61df8e2a83Sthib.Ar hostname
62df8e2a83Sthibwhen no optional parameters are supplied.
63df8e2a83Sthib.Ar hostname
64df8e2a83Sthibmay be specified by name or by number,
65df8e2a83Sthibusing Internet dot notation.
66df8e2a83Sthib.Pp
67bc878e5dSjasper.Nm
68679dc73cSjmccan also be used to send Wake on LAN (WoL) frames over a local
69bc878e5dSjasperEthernet network to one or more hosts using their link layer (hardware)
70bc878e5dSjasperaddresses.
71bc878e5dSjasperWoL functionality is generally enabled in a machine's BIOS
72bc878e5dSjasperand can be used to power on machines from a remote system without
73bc878e5dSjasperhaving physical access to them.
74bc878e5dSjasper.Pp
75df8e2a83SthibThe options are as follows:
76df930be7Sderaadt.Bl -tag -width Ds
77df930be7Sderaadt.It Fl a
78df8e2a83SthibDisplay all of the current ARP entries.
79a61997d9SjaredySee also the
80df930be7Sderaadt.Fl d
81a61997d9Sjaredyoption below.
82e1ee6c49SmpiThe following information will be printed:
83e1ee6c49Smpi.Bl -tag -width Ds -offset 3n
84e1ee6c49Smpi.It Host
85e1ee6c49SmpiThe network address of the host.
86e1ee6c49Smpi.It Ethernet Address
87e1ee6c49SmpiThe Ethernet address of the host.
88e1ee6c49SmpiIf the address is not available,
89e1ee6c49Smpiit will be displayed as
90e1ee6c49Smpi.Dq (incomplete) .
91e1ee6c49Smpi.It Netif
92e1ee6c49SmpiThe network interface associated with the ARP entry.
93e1ee6c49Smpi.It Expire
94e1ee6c49SmpiThe time until expiry of the entry.
95e1ee6c49SmpiIf the entry is marked
96e1ee6c49Smpi.Dq permanent
97e1ee6c49Smpior
98e1ee6c49Smpi.Dq static ,
99e1ee6c49Smpiit will never expire.
100e1ee6c49Smpi.It Flags
101e1ee6c49SmpiFlags on the ARP entry, in a single letter.
10248ccdf10SmpiThey are: local
103bf66b9d9Sjmc.Pq Sq l
104e1ee6c49Smpiand published
105e1ee6c49Smpi.Pq Sq p .
106e1ee6c49Smpi.El
107a61997d9Sjaredy.It Fl d
108a61997d9SjaredyDelete an entry for the host called
109a61997d9Sjaredy.Ar hostname .
11022bb042bSdugsongAlternatively, the
11122bb042bSdugsong.Fl d
11222bb042bSdugsongflag may be combined with the
11322bb042bSdugsong.Fl a
11422bb042bSdugsongflag to delete all entries, with hostname lookups automatically
11522bb042bSdugsongdisabled.
116a61997d9SjaredyOnly the superuser may delete entries.
117f4619fa8Shenning.It Fl F
118f4619fa8ShenningForce existing entries for the given host to be overwritten
119f4619fa8Shenning(only relevant to the
120f4619fa8Shenning.Fl f
121f4619fa8Shenningand
122f4619fa8Shenning.Fl s
123f4619fa8Shenningoptions).
124d13fc9d9Sjmc.It Fl f Ar file
125a61997d9SjaredyProcess entries from
126d13fc9d9Sjmc.Ar file
127df8e2a83Sthibto be set in the ARP tables.
1281273c74cSjcaSee the
1291273c74cSjca.Fl s
1301273c74cSjcaoption for a description of the file format and the effect of the
131f4619fa8Shenning.Fl F
1321273c74cSjcaoption.
1331273c74cSjca.It Fl n
134*bf1f2a6aSknDo not perform domain name resolution.
135*bf1f2a6aSknIf a name cannot be resolved without DNS, an error will be reported.
1361273c74cSjca.It Xo
1371273c74cSjca.Fl s Ar hostname ether_addr
138a61997d9Sjaredy.Op Cm temp | permanent
139a61997d9Sjaredy.Op Cm pub
1401273c74cSjca.Xc
1411273c74cSjcaCreate an ARP entry for the host called
1421273c74cSjca.Ar hostname
1431273c74cSjcawith the Ethernet address
1441273c74cSjca.Ar ether_addr .
1451273c74cSjcaThe Ethernet address is given as six hexadecimal bytes separated by
1461273c74cSjcacolons.
147df8e2a83SthibThe entry will be static (will not time out) unless the word
148a61997d9Sjaredy.Cm temp
149a61997d9Sjaredyis given in the command.
150df8e2a83SthibA static ARP entry can be overwritten by network traffic, unless the word
151a61997d9Sjaredy.Cm permanent
152a61997d9Sjaredyis given.
153a61997d9SjaredyIf the word
154a61997d9Sjaredy.Cm pub
155a61997d9Sjaredyis given, the entry will be
156a61997d9Sjaredy.Dq published ;
157df8e2a83Sthibthat is, this system will act as an ARP server,
158a61997d9Sjaredyresponding to requests for
159a61997d9Sjaredy.Ar hostname
160a61997d9Sjaredyeven though the host address is not its own.
161a61997d9SjaredyThis behavior has traditionally been called
162a61997d9Sjaredy.Em proxy ARP .
163f4619fa8Shenning.Pp
164f4619fa8ShenningIf the entry already exists for the given host, it will not
165f4619fa8Shenningbe replaced unless
166f4619fa8Shenning.Fl F
167f4619fa8Shenningis given.
168cc0444d0Sclaudio.It Fl V Ar rdomain
16915d649f2SjmcSelect the routing domain.
170bc878e5dSjasper.It Fl W Ar ether_addr Op Ar iface
1714632a258SjmcSend the Wake on LAN frame from all interfaces on the local machine
172bc878e5dSjasperthat are up, if
173bc878e5dSjasper.Ar iface
174bc878e5dSjasperhas not been specified.
175bc878e5dSjasperOtherwise the frame will be sent from
176bc878e5dSjasper.Ar iface .
177bc878e5dSjasper.Ar ether_addr
178bc878e5dSjasperis the Ethernet address of the remote machine or a hostname entry in
179bc878e5dSjasper.Pa /etc/ethers .
180bc878e5dSjasperThis option cannot be used in combination with any other option.
181bc878e5dSjasper.El
182bc878e5dSjasper.Sh FILES
183bc878e5dSjasper.Bl -tag -width "/etc/ethers" -compact
184b9170857Ssobrado.It Pa /etc/ethers
185bc878e5dSjasperEthernet host name database.
186df930be7Sderaadt.El
1870e67c9bbSkjell.Sh EXAMPLES
1881c77d49cSjmcView the current
189a61997d9Sjaredy.Xr arp 4
190fb7253efSjmctable,
191fb7253efSjmcshowing network addresses symbolically:
1920e67c9bbSkjell.Pp
193fb7253efSjmc.Dl $ arp -a
1940e67c9bbSkjell.Pp
1951c77d49cSjmcCreate a permanent
196a61997d9Sjaredyentry (one that cannot be overwritten by other network traffic):
1970e67c9bbSkjell.Pp
1988be06979Smpech.Dl # arp -s 10.0.0.2 00:90:27:bb:cc:dd permanent
1990e67c9bbSkjell.Pp
2001c77d49cSjmcCreate proxy ARP
2011c77d49cSjmcentries on interface fxp0
2021c77d49cSjmc(MAC address 00:90:27:bb:cc:dd),
2031c77d49cSjmcfor IP addresses 204.1.2.3 and 204.1.2.4:
204f4619fa8Shenning.Bd -literal -offset indent
205a61997d9Sjaredy# arp -s 204.1.2.3 00:90:27:bb:cc:dd pub
206a61997d9Sjaredy# arp -s 204.1.2.4 00:90:27:bb:cc:dd pub
2070e67c9bbSkjell.Ed
208df930be7Sderaadt.Sh SEE ALSO
209dba0cf44Sjmc.Xr inet_addr 3 ,
210df930be7Sderaadt.Xr arp 4 ,
211bc878e5dSjasper.Xr ethers 5 ,
2121f4d1341Sjmc.Xr ifconfig 8 ,
2131f4d1341Sjmc.Xr ndp 8
214df930be7Sderaadt.Sh HISTORY
215df930be7SderaadtThe
216df930be7Sderaadt.Nm
217df930be7Sderaadtcommand appeared in
218df930be7Sderaadt.Bx 4.3 .
2194632a258SjmcWake on LAN functionality was added in
220bc878e5dSjasper.Ox 4.9 .
221