xref: /openbsd/usr.sbin/arp/arp.8 (revision 404b540a)
1.\"	$OpenBSD: arp.8,v 1.26 2009/06/05 06:47:12 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: June 5 2009 $
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.Sh DESCRIPTION
52The
53.Nm
54program displays and modifies the Internet-to-Ethernet address translation
55tables used by the address resolution protocol (ARP).
56.Pp
57.Nm
58displays the current ARP entry for
59.Ar hostname
60when no optional parameters are supplied.
61.Ar hostname
62may be specified by name or by number,
63using Internet dot notation.
64.Pp
65The options are as follows:
66.Bl -tag -width Ds
67.It Fl a
68Display all of the current ARP entries.
69See also the
70.Fl d
71option below.
72.It Fl d
73Delete an entry for the host called
74.Ar hostname .
75Alternatively, the
76.Fl d
77flag may be combined with the
78.Fl a
79flag to delete all entries, with hostname lookups automatically
80disabled.
81Only the superuser may delete entries.
82.It Fl F
83Force existing entries for the given host to be overwritten
84(only relevant to the
85.Fl f
86and
87.Fl s
88options).
89.It Fl f Ar file
90Process entries from
91.Ar file
92to be set in the ARP tables.
93Any entries in the file that already exist for a given host
94will not be overwritten unless
95.Fl F
96is given.
97Entries in the file should be of the form:
98.Bd -filled -offset indent
99.Ar hostname ether_addr
100.Op Cm temp | permanent
101.Op Cm pub
102.Ed
103.Pp
104The entry will be static (will not time out) unless the word
105.Cm temp
106is given in the command.
107A static ARP entry can be overwritten by network traffic, unless the word
108.Cm permanent
109is given.
110If the word
111.Cm pub
112is given, the entry will be
113.Dq published ;
114that is, this system will act as an ARP server,
115responding to requests for
116.Ar hostname
117even though the host address is not its own.
118This behavior has traditionally been called
119.Em proxy ARP .
120.It Fl n
121Show network addresses as numbers (normally
122.Nm
123attempts to display addresses symbolically).
124.It Xo
125.Fl s Ar hostname ether_addr
126.Op Cm temp | permanent
127.Op Cm pub
128.Xc
129Create an ARP entry for the host called
130.Ar hostname
131with the Ethernet address
132.Ar ether_addr .
133The Ethernet address is given as six hexadecimal bytes separated by
134colons.
135.Pp
136The
137.Cm permanent , pub ,
138or
139.Cm temp
140modifiers may be specified with meanings as given above.
141.Pp
142If the entry already exists for the given host, it will not
143be replaced unless
144.Fl F
145is given.
146.It Fl V Ar rdomain
147Select the routing domain.
148The default is 0.
149.El
150.Sh EXAMPLES
151View the current
152.Xr arp 4
153table,
154showing network addresses symbolically:
155.Pp
156.Dl $ arp -a
157.Pp
158Create a permanent
159entry (one that cannot be overwritten by other network traffic):
160.Pp
161.Dl # arp -s 10.0.0.2 00:90:27:bb:cc:dd permanent
162.Pp
163Create proxy ARP
164entries on interface fxp0
165(MAC address 00:90:27:bb:cc:dd),
166for IP addresses 204.1.2.3 and 204.1.2.4:
167.Bd -literal -offset indent
168# arp -s 204.1.2.3 00:90:27:bb:cc:dd pub
169# arp -s 204.1.2.4 00:90:27:bb:cc:dd pub
170.Ed
171.Sh SEE ALSO
172.Xr inet 3 ,
173.Xr arp 4 ,
174.Xr ifconfig 8 ,
175.Xr ndp 8
176.Sh HISTORY
177The
178.Nm
179command appeared in
180.Bx 4.3 .
181