xref: /openbsd-src/usr.sbin/arp/arp.8 (revision bf1f2a6a5061d27184fb96f80565bf75477186c1)
1.\"	$OpenBSD: arp.8,v 1.40 2019/08/27 20:50:36 kn Exp $
2.\"	$NetBSD: arp.8,v 1.7 1995/03/01 11:50:59 chopps Exp $
3.\"
4.\" Copyright (c) 1985, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	from: @(#)arp.8	8.1 (Berkeley) 6/6/93
32.\"
33.Dd $Mdocdate: August 27 2019 $
34.Dt ARP 8
35.Os
36.Sh NAME
37.Nm arp
38.Nd address resolution display and control
39.Sh SYNOPSIS
40.Nm arp
41.Op Fl adn
42.Op Fl V Ar rdomain
43.Ar hostname
44.Nm arp
45.Op Fl F
46.Op Fl f Ar file
47.Op Fl V Ar rdomain
48.Fl s Ar hostname ether_addr
49.Op Cm temp | permanent
50.Op Cm pub
51.Nm
52.Fl W Ar ether_addr Op Ar iface
53.Sh DESCRIPTION
54The
55.Nm
56program displays and modifies the Internet-to-Ethernet address translation
57tables used by the address resolution protocol (ARP).
58.Pp
59.Nm
60displays the current ARP entry for
61.Ar hostname
62when no optional parameters are supplied.
63.Ar hostname
64may be specified by name or by number,
65using Internet dot notation.
66.Pp
67.Nm
68can also be used to send Wake on LAN (WoL) frames over a local
69Ethernet network to one or more hosts using their link layer (hardware)
70addresses.
71WoL functionality is generally enabled in a machine's BIOS
72and can be used to power on machines from a remote system without
73having physical access to them.
74.Pp
75The options are as follows:
76.Bl -tag -width Ds
77.It Fl a
78Display all of the current ARP entries.
79See also the
80.Fl d
81option below.
82The following information will be printed:
83.Bl -tag -width Ds -offset 3n
84.It Host
85The network address of the host.
86.It Ethernet Address
87The Ethernet address of the host.
88If the address is not available,
89it will be displayed as
90.Dq (incomplete) .
91.It Netif
92The network interface associated with the ARP entry.
93.It Expire
94The time until expiry of the entry.
95If the entry is marked
96.Dq permanent
97or
98.Dq static ,
99it will never expire.
100.It Flags
101Flags on the ARP entry, in a single letter.
102They are: local
103.Pq Sq l
104and published
105.Pq Sq p .
106.El
107.It Fl d
108Delete an entry for the host called
109.Ar hostname .
110Alternatively, the
111.Fl d
112flag may be combined with the
113.Fl a
114flag to delete all entries, with hostname lookups automatically
115disabled.
116Only the superuser may delete entries.
117.It Fl F
118Force existing entries for the given host to be overwritten
119(only relevant to the
120.Fl f
121and
122.Fl s
123options).
124.It Fl f Ar file
125Process entries from
126.Ar file
127to be set in the ARP tables.
128See the
129.Fl s
130option for a description of the file format and the effect of the
131.Fl F
132option.
133.It Fl n
134Do not perform domain name resolution.
135If a name cannot be resolved without DNS, an error will be reported.
136.It Xo
137.Fl s Ar hostname ether_addr
138.Op Cm temp | permanent
139.Op Cm pub
140.Xc
141Create an ARP entry for the host called
142.Ar hostname
143with the Ethernet address
144.Ar ether_addr .
145The Ethernet address is given as six hexadecimal bytes separated by
146colons.
147The entry will be static (will not time out) unless the word
148.Cm temp
149is given in the command.
150A static ARP entry can be overwritten by network traffic, unless the word
151.Cm permanent
152is given.
153If the word
154.Cm pub
155is given, the entry will be
156.Dq published ;
157that is, this system will act as an ARP server,
158responding to requests for
159.Ar hostname
160even though the host address is not its own.
161This behavior has traditionally been called
162.Em proxy ARP .
163.Pp
164If the entry already exists for the given host, it will not
165be replaced unless
166.Fl F
167is given.
168.It Fl V Ar rdomain
169Select the routing domain.
170.It Fl W Ar ether_addr Op Ar iface
171Send the Wake on LAN frame from all interfaces on the local machine
172that are up, if
173.Ar iface
174has not been specified.
175Otherwise the frame will be sent from
176.Ar iface .
177.Ar ether_addr
178is the Ethernet address of the remote machine or a hostname entry in
179.Pa /etc/ethers .
180This option cannot be used in combination with any other option.
181.El
182.Sh FILES
183.Bl -tag -width "/etc/ethers" -compact
184.It Pa /etc/ethers
185Ethernet host name database.
186.El
187.Sh EXAMPLES
188View the current
189.Xr arp 4
190table,
191showing network addresses symbolically:
192.Pp
193.Dl $ arp -a
194.Pp
195Create a permanent
196entry (one that cannot be overwritten by other network traffic):
197.Pp
198.Dl # arp -s 10.0.0.2 00:90:27:bb:cc:dd permanent
199.Pp
200Create proxy ARP
201entries on interface fxp0
202(MAC address 00:90:27:bb:cc:dd),
203for IP addresses 204.1.2.3 and 204.1.2.4:
204.Bd -literal -offset indent
205# arp -s 204.1.2.3 00:90:27:bb:cc:dd pub
206# arp -s 204.1.2.4 00:90:27:bb:cc:dd pub
207.Ed
208.Sh SEE ALSO
209.Xr inet_addr 3 ,
210.Xr arp 4 ,
211.Xr ethers 5 ,
212.Xr ifconfig 8 ,
213.Xr ndp 8
214.Sh HISTORY
215The
216.Nm
217command appeared in
218.Bx 4.3 .
219Wake on LAN functionality was added in
220.Ox 4.9 .
221