| 1 |
.TH ARP 8 "2008\-10\-03" "net\-tools" "Linux System Administrator's Manual" |
| 2 |
.SH NAME |
| 3 |
arp \- manipulate the system ARP cache |
| 4 |
.SH SYNOPSIS |
| 5 |
.B arp |
| 6 |
.RB [ \-vn ] |
| 7 |
.RB [ \-H |
| 8 |
.IR type ] |
| 9 |
.RB [ \-i |
| 10 |
.IR if ] |
| 11 |
.RB [ \-ae ] |
| 12 |
.RI [ hostname ] |
| 13 |
.PP |
| 14 |
.B arp |
| 15 |
.RB [ \-v ] |
| 16 |
.RB [ \-i |
| 17 |
.IR if ] |
| 18 |
.B \-d |
| 19 |
.I hostname |
| 20 |
.RB [ pub ] |
| 21 |
.PP |
| 22 |
.B arp |
| 23 |
.RB [ \-v ] |
| 24 |
.RB [ \-H |
| 25 |
.IR type ] |
| 26 |
.RB [ \-i |
| 27 |
.IR if ] |
| 28 |
.B \-s |
| 29 |
.I hostname hw_addr |
| 30 |
.RB [ temp ] |
| 31 |
.PP |
| 32 |
.B arp |
| 33 |
.RB [ \-v ] |
| 34 |
.RB [ \-H |
| 35 |
.IR type ] |
| 36 |
.RB [ \-i |
| 37 |
.IR if ] |
| 38 |
.B \-s |
| 39 |
.I hostname hw_addr |
| 40 |
.RB [ netmask |
| 41 |
.IR nm ] |
| 42 |
.B pub |
| 43 |
.PP |
| 44 |
.B arp |
| 45 |
.RB [ \-v ] |
| 46 |
.RB [ \-H |
| 47 |
.IR type ] |
| 48 |
.RB [ \-i |
| 49 |
.IR if ] |
| 50 |
.B \-Ds |
| 51 |
.I hostname |
| 52 |
.I ifname |
| 53 |
.RB [ netmask |
| 54 |
.IR nm ] |
| 55 |
.B pub |
| 56 |
.PP |
| 57 |
.B arp |
| 58 |
.RB [ \-vnD ] |
| 59 |
.RB [ \-H |
| 60 |
.IR type ] |
| 61 |
.RB [ \-i |
| 62 |
.IR if ] |
| 63 |
.B \-f |
| 64 |
.RI [ filename ] |
| 65 |
|
| 66 |
.SH DESCRIPTION |
| 67 |
.B Arp |
| 68 |
manipulates or displays the kernel's IPv4 network neighbour cache. It can add |
| 69 |
entries to the table, delete one or display the current content. |
| 70 |
|
| 71 |
.B ARP |
| 72 |
stands for Address Resolution Protocol, which is used to find the media |
| 73 |
access control address of a network neighbour for a given IPv4 Address. |
| 74 |
.SH MODES |
| 75 |
.B arp |
| 76 |
with no mode specifier will print the current content of the table. It is |
| 77 |
possible to limit the number of entries printed, by specifying an hardware |
| 78 |
address type, interface name or host address. |
| 79 |
|
| 80 |
.B arp -d |
| 81 |
.I address |
| 82 |
will delete a ARP table entry. Root or netadmin privilege is required to do |
| 83 |
this. The entry is found by IP address. If a hostname is given, it will be |
| 84 |
resolved before looking up the entry in the ARP table. |
| 85 |
|
| 86 |
.B arp -s |
| 87 |
.I address hw_addr |
| 88 |
is used to set up a new table entry. The format of the |
| 89 |
.I hw_addr |
| 90 |
parameter is dependent on the hardware class, but for most classes one can |
| 91 |
assume that the usual presentation can be used. For the Ethernet class, |
| 92 |
this is 6 bytes in hexadecimal, separated by colons. When adding proxy arp |
| 93 |
entries (that is those with the |
| 94 |
.BR pub lish |
| 95 |
flag set) a |
| 96 |
.B netmask |
| 97 |
may be specified to proxy arp for entire subnets. This is not good |
| 98 |
practice, but is supported by older kernels because it can be |
| 99 |
useful. If the |
| 100 |
.B temp |
| 101 |
flag is not supplied entries will be permanent stored into the ARP |
| 102 |
cache. To simplify setting up entries for one of your own network interfaces, you can use the |
| 103 |
.B "arp \-Ds" |
| 104 |
.I address ifname |
| 105 |
form. In that case the hardware address is taken from the interface with the |
| 106 |
specified name. |
| 107 |
|
| 108 |
.br |
| 109 |
.SH OPTIONS |
| 110 |
.TP |
| 111 |
.B "\-v, \-\-verbose" |
| 112 |
Tell the user what is going on by being verbose. |
| 113 |
.TP |
| 114 |
.B "\-n, \-\-numeric" |
| 115 |
shows numerical addresses instead of trying to determine symbolic host, port |
| 116 |
or user names. |
| 117 |
.TP |
| 118 |
\fB\-H\fI type\fR, \fB\-\-hw\-type\fI type\fR, \fB\-t\fI type\fR |
| 119 |
When setting or reading the ARP cache, this optional parameter tells |
| 120 |
.B arp |
| 121 |
which class of entries it should check for. The default value of |
| 122 |
this parameter is |
| 123 |
.B ether |
| 124 |
(i.e. hardware code 0x01 for IEEE 802.3 10Mbps Ethernet). |
| 125 |
Other values might include network technologies such as |
| 126 |
.RB "ARCnet (" arcnet ")" |
| 127 |
, |
| 128 |
.RB "PROnet (" pronet ")" |
| 129 |
, |
| 130 |
.RB "AX.25 (" ax25 ")" |
| 131 |
and |
| 132 |
.RB "NET/ROM (" netrom ")." |
| 133 |
.TP |
| 134 |
.B \-a |
| 135 |
Use alternate BSD style output format (with no fixed columns). |
| 136 |
.TP |
| 137 |
.B \-e |
| 138 |
Use default Linux style output format (with fixed columns). |
| 139 |
.TP |
| 140 |
.B "\-D, \-\-use-device" |
| 141 |
Instead of a hw_addr, the given argument is the name of an interface. |
| 142 |
.B arp |
| 143 |
will use the MAC address of that interface for the table entry. This is usually the best option to set up a proxy ARP entry to yourself. |
| 144 |
.TP |
| 145 |
\fB\-i\fI If\fR, \fB\-\-device\fI If\fR |
| 146 |
Select an interface. When dumping the ARP cache only entries matching |
| 147 |
the specified interface will be printed. When setting a permanent or |
| 148 |
.B temp |
| 149 |
ARP entry this interface will be associated with the entry; if this |
| 150 |
option is not used, the kernel will guess based on the routing |
| 151 |
table. For |
| 152 |
.B pub |
| 153 |
entries the specified interface is the interface on which ARP requests will |
| 154 |
be answered. |
| 155 |
.br |
| 156 |
.B NOTE: |
| 157 |
This has to be different from the interface to which the IP |
| 158 |
datagrams will be routed. |
| 159 |
.B NOTE: |
| 160 |
As of kernel 2.2.0 it is no longer possible to set an ARP entry for an |
| 161 |
entire subnet. Linux instead does automagic proxy arp when a route |
| 162 |
exists and it is forwarding. See |
| 163 |
.BR arp (7) |
| 164 |
for details. Also the |
| 165 |
.B dontpub |
| 166 |
option which is available for delete and set operations cannot be |
| 167 |
used with 2.4 and newer kernels. |
| 168 |
.TP |
| 169 |
\fB\-f\fI filename\fR, \fB\-\-file\fI filename\fR |
| 170 |
Similar to the |
| 171 |
.B \-s |
| 172 |
option, only this time the address info is taken from file |
| 173 |
.IR filename . |
| 174 |
This can be used if ARP entries for a lot of hosts have to be |
| 175 |
set up. The name of the data file is very often |
| 176 |
.IR /etc/ethers , |
| 177 |
but this is not official. If no filename is specified |
| 178 |
.I /etc/ethers |
| 179 |
is used as default. |
| 180 |
.sp 1 |
| 181 |
The format of the file is simple; it |
| 182 |
only contains ASCII text lines with a hostname, and a hardware |
| 183 |
address separated by whitespace. Additionally the |
| 184 |
.BR "pub" , " temp" " and" " netmask" |
| 185 |
flags can be used. |
| 186 |
.LP |
| 187 |
In all places where a |
| 188 |
.B hostname |
| 189 |
is expected, one can also enter an |
| 190 |
.B "IP address" |
| 191 |
in dotted-decimal notation. |
| 192 |
.P |
| 193 |
As a special case for compatibility the order of the hostname and |
| 194 |
the hardware address can be exchanged. |
| 195 |
.LP |
| 196 |
Each complete entry in the ARP cache will be marked with the |
| 197 |
.B C |
| 198 |
flag. Permanent entries are marked with |
| 199 |
.B M |
| 200 |
and published entries have the |
| 201 |
.B P |
| 202 |
flag. |
| 203 |
.SH EXAMPLES |
| 204 |
.B /usr/sbin/arp -i eth0 -Ds 10.0.0.2 eth1 pub |
| 205 |
|
| 206 |
This will answer ARP requests for 10.0.0.2 on eth0 with the MAC address for |
| 207 |
eth1. |
| 208 |
|
| 209 |
.B /usr/sbin/arp -i eth1 -d 10.0.0.1 |
| 210 |
|
| 211 |
Delete the ARP table entry for 10.0.0.1 on interface eth1. This will match |
| 212 |
published proxy ARP entries and permanent entries. |
| 213 |
.SH FILES |
| 214 |
.I /proc/net/arp |
| 215 |
.br |
| 216 |
.I /etc/networks |
| 217 |
.br |
| 218 |
.I /etc/hosts |
| 219 |
.br |
| 220 |
.I /etc/ethers |
| 221 |
.SH SEE ALSO |
| 222 |
.BR ethers (5), |
| 223 |
.BR rarp (8), |
| 224 |
.BR route (8), |
| 225 |
.BR ifconfig (8), |
| 226 |
.BR netstat (8) |
| 227 |
.SH AUTHORS |
| 228 |
Fred N. van Kempen <[email protected]>, Bernd Eckenfels <net\[email protected]>. |