1.\" Copyright (c) 1985, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)arp.8 8.1 (Berkeley) 6/6/93 29.\" 30.Dd July 13, 2020 31.Dt ARP 8 32.Os 33.Sh NAME 34.Nm arp 35.Nd address resolution display and control 36.Sh SYNOPSIS 37.Nm 38.Op Fl -libxo Ar options 39.Op Fl n 40.Op Fl i Ar interface 41.Ar hostname 42.Nm 43.Op Fl -libxo Ar options 44.Op Fl n 45.Op Fl i Ar interface 46.Fl a 47.Nm 48.Fl d Ar hostname 49.Op Cm pub 50.Nm 51.Fl d 52.Op Fl i Ar interface 53.Fl a 54.Nm 55.Fl s Ar hostname ether_addr 56.Op Cm temp 57.Op Cm blackhole No \&| Cm reject 58.Op Cm pub 59.Nm 60.Fl S Ar hostname ether_addr 61.Op Cm temp 62.Op Cm blackhole No \&| Cm reject 63.Op Cm pub 64.Nm 65.Fl f Ar filename 66.Sh DESCRIPTION 67The 68.Nm 69utility displays and modifies the Internet-to-Ethernet address translation 70tables used by the address resolution protocol 71.Pq Xr arp 4 . 72With no flags, the program displays the current 73.Tn ARP 74entry for 75.Ar hostname . 76The host may be specified by name or by number, 77using Internet dot notation. 78.Pp 79Available options: 80.Bl -tag -width indent 81.It Fl -libxo 82Generate output via 83.Xr libxo 3 84in a selection of different human and machine readable formats. 85See 86.Xr xo_parse_args 3 87for details on command line arguments. 88.It Fl a 89The program displays or, if it is used with the 90.Fl d 91flag, deletes all of the current 92.Tn ARP 93entries. 94.It Fl d 95A super-user may delete an entry for the host called 96.Ar hostname 97with the 98.Fl d 99flag. 100If the 101.Cm pub 102keyword is specified, only the 103.Dq published 104.Tn ARP 105entry 106for this host will be deleted. 107.Pp 108Alternatively, the 109.Fl d 110flag may be combined with the 111.Fl a 112flag to delete all entries. 113.It Fl i Ar interface 114Limit the operation scope to the 115.Tn ARP 116entries on 117.Ar interface . 118Applicable only to the following operations: 119display one, display all, delete all. 120.It Fl n 121Show network addresses as numbers (normally 122.Nm 123attempts to display addresses symbolically). 124.It Fl s Ar hostname ether_addr 125Create an 126.Tn ARP 127entry for the host called 128.Ar hostname 129with the Ethernet address 130.Ar ether_addr . 131The Ethernet address is given as six hex bytes separated by colons. 132The entry will be permanent unless the word 133.Cm temp 134is given in the command. 135If the word 136.Cm pub 137is given, the entry will be 138.Dq published ; 139i.e., this system will 140act as an 141.Tn ARP 142server, 143responding to requests for 144.Ar hostname 145even though the host address is not its own. 146In this case the 147.Ar ether_addr 148can be given as 149.Cm auto 150in which case the interfaces on this host will be examined, 151and if one of them is found to occupy the same subnet, its 152Ethernet address will be used. 153.Pp 154If the 155.Cm reject 156keyword is specified the entry will be marked so that traffic to 157the host will be discarded and the sender will be notified the 158host is unreachable. 159The 160.Cm blackhole 161keyword is similar in that traffic is discarded but the sender is 162not notified. 163These can be used to block external traffic to a host without 164using a firewall. 165.It Fl S Ar hostname ether_addr 166Is just like 167.Fl s 168except any existing 169.Tn ARP 170entry for this host will be deleted first. 171.It Fl f Ar filename 172Cause the file 173.Ar filename 174to be read and multiple entries to be set in the 175.Tn ARP 176tables. 177Entries 178in the file should be of the form 179.Pp 180.Bd -ragged -offset indent -compact 181.Ar hostname ether_addr 182.Op Cm temp 183.Op Cm blackhole No \&| Cm reject 184.Op Cm pub 185.Ed 186.Pp 187with argument meanings as given above. 188Leading whitespace and empty lines are ignored. 189A 190.Ql # 191character will mark the rest of the line as a comment. 192.El 193.Sh SEE ALSO 194.Xr inet 3 , 195.Xr libxo 3 , 196.Xr xo_parse_args 3 , 197.Xr arp 4 , 198.Xr ifconfig 8 , 199.Xr ndp 8 200.Sh HISTORY 201The 202.Nm 203utility appeared in 204.Bx 4.3 . 205