xref: /openbsd-src/usr.sbin/arp/arp.8 (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1.\"	$OpenBSD: arp.8,v 1.30 2011/09/01 21:21:25 jmc 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: September 1 2011 $
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.
82.It Fl d
83Delete an entry for the host called
84.Ar hostname .
85Alternatively, the
86.Fl d
87flag may be combined with the
88.Fl a
89flag to delete all entries, with hostname lookups automatically
90disabled.
91Only the superuser may delete entries.
92.It Fl F
93Force existing entries for the given host to be overwritten
94(only relevant to the
95.Fl f
96and
97.Fl s
98options).
99.It Fl f Ar file
100Process entries from
101.Ar file
102to be set in the ARP tables.
103Any entries in the file that already exist for a given host
104will not be overwritten unless
105.Fl F
106is given.
107Entries in the file should be of the form:
108.Bd -filled -offset indent
109.Ar hostname ether_addr
110.Op Cm temp | permanent
111.Op Cm pub
112.Ed
113.Pp
114The entry will be static (will not time out) unless the word
115.Cm temp
116is given in the command.
117A static ARP entry can be overwritten by network traffic, unless the word
118.Cm permanent
119is given.
120If the word
121.Cm pub
122is given, the entry will be
123.Dq published ;
124that is, this system will act as an ARP server,
125responding to requests for
126.Ar hostname
127even though the host address is not its own.
128This behavior has traditionally been called
129.Em proxy ARP .
130.It Fl n
131Show network addresses as numbers (normally
132.Nm
133attempts to display addresses symbolically).
134.It Xo
135.Fl s Ar hostname ether_addr
136.Op Cm temp | permanent
137.Op Cm pub
138.Xc
139Create an ARP entry for the host called
140.Ar hostname
141with the Ethernet address
142.Ar ether_addr .
143The Ethernet address is given as six hexadecimal bytes separated by
144colons.
145.Pp
146The
147.Cm permanent , pub ,
148or
149.Cm temp
150modifiers may be specified with meanings as given above.
151.Pp
152If the entry already exists for the given host, it will not
153be replaced unless
154.Fl F
155is given.
156.It Fl V Ar rdomain
157Select the routing domain.
158The default is 0.
159.It Fl W Ar ether_addr Op Ar iface
160Send the Wake on LAN frame from all interfaces on the local machine
161that are up, if
162.Ar iface
163has not been specified.
164Otherwise the frame will be sent from
165.Ar iface .
166.Ar ether_addr
167is the Ethernet address of the remote machine or a hostname entry in
168.Pa /etc/ethers .
169This option cannot be used in combination with any other option.
170.El
171.Sh FILES
172.Bl -tag -width "/etc/ethers" -compact
173.It /etc/ethers
174Ethernet host name database.
175.El
176.Sh EXAMPLES
177View the current
178.Xr arp 4
179table,
180showing network addresses symbolically:
181.Pp
182.Dl $ arp -a
183.Pp
184Create a permanent
185entry (one that cannot be overwritten by other network traffic):
186.Pp
187.Dl # arp -s 10.0.0.2 00:90:27:bb:cc:dd permanent
188.Pp
189Create proxy ARP
190entries on interface fxp0
191(MAC address 00:90:27:bb:cc:dd),
192for IP addresses 204.1.2.3 and 204.1.2.4:
193.Bd -literal -offset indent
194# arp -s 204.1.2.3 00:90:27:bb:cc:dd pub
195# arp -s 204.1.2.4 00:90:27:bb:cc:dd pub
196.Ed
197.Sh SEE ALSO
198.Xr inet 3 ,
199.Xr arp 4 ,
200.Xr ethers 5 ,
201.Xr ifconfig 8 ,
202.Xr ndp 8
203.Sh HISTORY
204The
205.Nm
206command appeared in
207.Bx 4.3 .
208Wake on LAN functionality was added in
209.Ox 4.9 .
210