Blame SOURCES/arptables.8

8cce6c
.TH ARPTABLES 8  "November 2011"
8cce6c
.\"
8cce6c
.\" Man page originally written by Jochen Friedrich <jochen@scram.de>,
8cce6c
.\" maintained by Bart De Schuymer.
8cce6c
.\" It is based on the iptables man page.
8cce6c
.\"
8cce6c
.\" Iptables page by Herve Eychenne March 2000.
8cce6c
.\"
8cce6c
.\"     This program is free software; you can redistribute it and/or modify
8cce6c
.\"     it under the terms of the GNU General Public License as published by
8cce6c
.\"     the Free Software Foundation; either version 2 of the License, or
8cce6c
.\"     (at your option) any later version.
8cce6c
.\"
8cce6c
.\"     This program is distributed in the hope that it will be useful,
8cce6c
.\"     but WITHOUT ANY WARRANTY; without even the implied warranty of
8cce6c
.\"     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8cce6c
.\"     GNU General Public License for more details.
8cce6c
.\"
8cce6c
.\"     You should have received a copy of the GNU General Public License
8cce6c
.\"     along with this program; if not, write to the Free Software
8cce6c
.\"     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
8cce6c
.\"
8cce6c
.\"
8cce6c
.SH NAME
8cce6c
arptables \- ARP table administration
8cce6c
.SH SYNOPSIS
8cce6c
.BR "arptables " [ "-t table" ] " -" [ AD ] " chain rule-specification " [ options ]
8cce6c
.br
8cce6c
.BR "arptables " [ "-t table" ] " -" [ RI ] " chain rulenum rule-specification " [ options ]
8cce6c
.br
8cce6c
.BR "arptables " [ "-t table" ] " -D chain rulenum " [ options ]
8cce6c
.br
8cce6c
.BR "arptables " [ "-t table" ] " -" [ "LFZ" ] " " [ chain ] " " [ options ]
8cce6c
.br
8cce6c
.BR "arptables " [ "-t table" ] " -" [ "NX" ] " chain"
8cce6c
.br
8cce6c
.BR "arptables " [ "-t table" ] " -E old-chain-name new-chain-name"
8cce6c
.br
8cce6c
.BR "arptables " [ "-t table" ] " -P chain target " [ options ]
8cce6c
.SH DESCRIPTION
8cce6c
.B arptables
8cce6c
is a user space tool, it is used to set up and maintain the
8cce6c
tables of ARP rules in the Linux kernel. These rules inspect
8cce6c
the ARP frames which they see.
8cce6c
.B arptables
8cce6c
is analogous to the
8cce6c
.B iptables
8cce6c
user space tool, but
8cce6c
.B arptables
8cce6c
is less complicated.
8cce6c
8cce6c
.SS CHAINS
8cce6c
The kernel table is used to divide functionality into
8cce6c
different sets of rules. Each set of rules is called a chain.
8cce6c
Each chain is an ordered list of rules that can match ARP frames. If a
8cce6c
rule matches an ARP frame, then a processing specification tells
8cce6c
what to do with that matching frame. The processing specification is
8cce6c
called a 'target'. However, if the frame does not match the current
8cce6c
rule in the chain, then the next rule in the chain is examined and so forth.
8cce6c
The user can create new (user-defined) chains which can be used as the 'target' of a rule.
8cce6c
8cce6c
.SS TARGETS
8cce6c
A firewall rule specifies criteria for an ARP frame and a frame
8cce6c
processing specification called a target.  When a frame matches a rule,
8cce6c
then the next action performed by the kernel is specified by the target.
8cce6c
The target can be one of these values:
8cce6c
.IR ACCEPT ,
8cce6c
.IR DROP ,
8cce6c
.IR CONTINUE ,
8cce6c
.IR RETURN ,
8cce6c
an 'extension' (see below) or a user-defined chain.
8cce6c
.PP
8cce6c
.I ACCEPT
8cce6c
means to let the frame through.
8cce6c
.I DROP
8cce6c
means the frame has to be dropped.
8cce6c
.I CONTINUE
8cce6c
means the next rule has to be checked. This can be handy to know how many
8cce6c
frames pass a certain point in the chain or to log those frames.
8cce6c
.I RETURN
8cce6c
means stop traversing this chain and resume at the next rule in the
8cce6c
previous (calling) chain.
8cce6c
For the extension targets please see the
8cce6c
.B "TARGET EXTENSIONS"
8cce6c
section of this man page.
8cce6c
.SS TABLES
8cce6c
There is only one ARP table in the Linux
8cce6c
kernel.  The table is
8cce6c
.BR filter.
8cce6c
You can drop the '-t filter' argument to the arptables command.
8cce6c
The -t argument must be the
8cce6c
first argument on the arptables command line, if used.
8cce6c
.TP
8cce6c
.B "-t, --table"
8cce6c
.br
8cce6c
.BR filter ,
8cce6c
is the only table and contains two built-in chains:
8cce6c
.B INPUT 
8cce6c
(for frames destined for the host) and
8cce6c
.B OUTPUT 
8cce6c
(for locally-generated frames).
8cce6c
.br
8cce6c
.br
8cce6c
.SH ARPTABLES COMMAND LINE ARGUMENTS
8cce6c
After the initial arptables command line argument, the remaining
8cce6c
arguments can be divided into several different groups.  These groups
8cce6c
are commands, miscellaneous commands, rule-specifications, match-extensions,
8cce6c
and watcher-extensions.
8cce6c
.SS COMMANDS
8cce6c
The arptables command arguments specify the actions to perform on the table
8cce6c
defined with the -t argument.  If you do not use the -t argument to name
8cce6c
a table, the commands apply to the default filter table.
8cce6c
With the exception of the
8cce6c
.B "-Z"
8cce6c
command, only one command may be used on the command line at a time.
8cce6c
.TP
8cce6c
.B "-A, --append"
8cce6c
Append a rule to the end of the selected chain.
8cce6c
.TP
8cce6c
.B "-D, --delete"
8cce6c
Delete the specified rule from the selected chain. There are two ways to
8cce6c
use this command. The first is by specifying an interval of rule numbers
8cce6c
to delete, syntax: start_nr[:end_nr]. Using negative numbers is allowed, for more
8cce6c
details about using negative numbers, see the -I command. The second usage is by
8cce6c
specifying the complete rule as it would have been specified when it was added.
8cce6c
.TP
8cce6c
.B "-I, --insert"
8cce6c
Insert the specified rule into the selected chain at the specified rule number.
8cce6c
If the current number of rules equals N, then the specified number can be
8cce6c
between -N and N+1. For a positive number i, it holds that i and i-N-1 specify the
8cce6c
same place in the chain where the rule should be inserted. The number 0 specifies
8cce6c
the place past the last rule in the chain and using this number is therefore
8cce6c
equivalent with using the -A command.
8cce6c
.TP
8cce6c
.B "-R, --replace"
8cce6c
Replaces the specified rule into the selected chain at the specified rule number.
8cce6c
If the current number of rules equals N, then the specified number can be
8cce6c
between 1 and N. i specifies the place in the chain where the rule should be replaced.
8cce6c
.TP
8cce6c
.B "-P, --policy"
8cce6c
Set the policy for the chain to the given target. The policy can be
8cce6c
.BR ACCEPT ", " DROP " or " RETURN .
8cce6c
.TP
8cce6c
.B "-F, --flush"
8cce6c
Flush the selected chain. If no chain is selected, then every chain will be
8cce6c
flushed. Flushing the chain does not change the policy of the
8cce6c
chain, however.
8cce6c
.TP
8cce6c
.B "-Z, --zero"
8cce6c
Set the counters of the selected chain to zero. If no chain is selected, all the counters
8cce6c
are set to zero. The
8cce6c
.B "-Z"
8cce6c
command can be used in conjunction with the 
8cce6c
.B "-L"
8cce6c
command.
8cce6c
When both the
8cce6c
.B "-Z"
8cce6c
and
8cce6c
.B "-L"
8cce6c
commands are used together in this way, the rule counters are printed on the screen
8cce6c
before they are set to zero.
8cce6c
.TP
8cce6c
.B "-L, --list"
8cce6c
List all rules in the selected chain. If no chain is selected, all chains
8cce6c
are listed.
8cce6c
.TP
8cce6c
.B "-N, --new-chain"
8cce6c
Create a new user-defined chain with the given name. The number of
8cce6c
user-defined chains is unlimited. A user-defined chain name has maximum
8cce6c
length of 31 characters.
8cce6c
.TP
8cce6c
.B "-X, --delete-chain"
8cce6c
Delete the specified user-defined chain. There must be no remaining references
8cce6c
to the specified chain, otherwise
8cce6c
.B arptables
8cce6c
will refuse to delete it. If no chain is specified, all user-defined
8cce6c
chains that aren't referenced will be removed.
8cce6c
.TP
8cce6c
.B "-E, --rename-chain"
8cce6c
Rename the specified chain to a new name.  Besides renaming a user-defined
8cce6c
chain, you may rename a standard chain name to a name that suits your
8cce6c
taste. For example, if you like PREBRIDGING more than PREROUTING,
8cce6c
then you can use the -E command to rename the PREROUTING chain. If you do
8cce6c
rename one of the standard
8cce6c
.B arptables
8cce6c
chain names, please be sure to mention
8cce6c
this fact should you post a question on the
8cce6c
.B arptables
8cce6c
mailing lists.
8cce6c
It would be wise to use the standard name in your post. Renaming a standard
8cce6c
.B arptables
8cce6c
chain in this fashion has no effect on the structure or function
8cce6c
of the
8cce6c
.B arptables
8cce6c
kernel table.
8cce6c
8cce6c
.SS MISCELLANOUS COMMANDS
8cce6c
.TP
8cce6c
.B "-V, --version"
8cce6c
Show the version of the arptables userspace program.
8cce6c
.TP
8cce6c
.B "-h, --help"
8cce6c
Give a brief description of the command syntax.
8cce6c
.TP
8cce6c
.BR "-j, --jump " "\fItarget\fP"
8cce6c
The target of the rule. This is one of the following values:
8cce6c
.BR ACCEPT ,
8cce6c
.BR DROP ,
8cce6c
.BR CONTINUE ,
8cce6c
.BR RETURN ,
8cce6c
a target extension (see
8cce6c
.BR "TARGET EXTENSIONS" ")"
8cce6c
or a user-defined chain name.
8cce6c
.TP
8cce6c
.BI "-c, --set-counters " "PKTS BYTES"
8cce6c
This enables the administrator to initialize the packet and byte
8cce6c
counters of a rule (during
8cce6c
.B INSERT,
8cce6c
.B APPEND,
8cce6c
.B REPLACE
8cce6c
operations).
8cce6c
8cce6c
.SS RULE-SPECIFICATIONS
8cce6c
The following command line arguments make up a rule specification (as used 
8cce6c
in the add and delete commands). A "!" option before the specification 
8cce6c
inverts the test for that specification. Apart from these standard rule 
8cce6c
specifications there are some other command line arguments of interest.
8cce6c
.TP
8cce6c
.BR "-s, --source-ip " "[!] \fIaddress\fP[/\fImask]\fP"
8cce6c
The Source IP specification.
8cce6c
.TP 
8cce6c
.BR "-d, --destination-ip " "[!] \fIaddress\fP[/\fImask]\fP"
8cce6c
The Destination IP specification.
8cce6c
.TP 
8cce6c
.BR "--source-mac " "[!] \fIaddress\fP[/\fImask\fP]"
8cce6c
The source mac address. Both mask and address are written as 6 hexadecimal
8cce6c
numbers separated by colons.
8cce6c
.TP
8cce6c
.BR "--destination-mac " "[!] \fIaddress\fP[/\fImask\fP]"
8cce6c
The destination mac address. Both mask and address are written as 6 hexadecimal
8cce6c
numbers separated by colons.
8cce6c
.TP 
8cce6c
.BR "-i, --in-interface " "[!] \fIname\fP"
8cce6c
The interface via which a frame is received (for the
8cce6c
.B INPUT
8cce6c
chain). The flag
8cce6c
.B --in-if
8cce6c
is an alias for this option.
8cce6c
.TP
8cce6c
.BR "-o, --out-interface " "[!] \fIname\fP"
8cce6c
The interface via which a frame is going to be sent (for the
8cce6c
.B OUTPUT
8cce6c
chain). The flag
8cce6c
.B --out-if
8cce6c
is an alias for this option.
8cce6c
.TP
8cce6c
.BR "-l, --h-length " "\fIlength\fP[/\fImask\fP]"
8cce6c
The hardware length (nr of bytes)
8cce6c
.TP
8cce6c
.BR "--opcode " "\fIcode\fP[/\fImask\fP]
8cce6c
The operation code (2 bytes). Available values are:
8cce6c
.BR 1 = Request
8cce6c
.BR 2 = Reply
8cce6c
.BR 3 = Request_Reverse
8cce6c
.BR 4 = Reply_Reverse
8cce6c
.BR 5 = DRARP_Request
8cce6c
.BR 6 = DRARP_Reply
8cce6c
.BR 7 = DRARP_Error
8cce6c
.BR 8 = InARP_Request
8cce6c
.BR 9 = ARP_NAK .
8cce6c
.TP
8cce6c
.BR "--h-type " "\fItype\fP[/\fImask\fP]"
8cce6c
The hardware type (2 bytes, hexadecimal). Available values are:
8cce6c
.BR 1 = Ethernet .
8cce6c
.TP
8cce6c
.BR "--proto-type " "\fItype\fP[/\fImask\fP]"
8cce6c
The protocol type (2 bytes). Available values are:
8cce6c
.BR 0x800 = IPv4 .
8cce6c
8cce6c
.SS TARGET-EXTENSIONS
8cce6c
.B arptables
8cce6c
extensions are precompiled into the userspace tool. So there is no need
8cce6c
to explicitly load them with a -m option like in
8cce6c
.BR iptables .
8cce6c
However, these
8cce6c
extensions deal with functionality supported by supplemental kernel modules.
8cce6c
.SS mangle
8cce6c
.TP
8cce6c
.BR "--mangle-ip-s IP address"
8cce6c
Mangles Source IP Address to given value.
8cce6c
.TP
8cce6c
.BR "--mangle-ip-d IP address"
8cce6c
Mangles Destination IP Address to given value.
8cce6c
.TP
8cce6c
.BR "--mangle-mac-s MAC address"
8cce6c
Mangles Source MAC Address to given value.
8cce6c
.TP
8cce6c
.BR "--mangle-mac-d MAC address"
8cce6c
Mangles Destination MAC Address to given value.
8cce6c
.TP
8cce6c
.BR "--mangle-target target "
8cce6c
Target of ARP mangle operation
8cce6c
.BR "" ( DROP ", " CONTINUE " or " ACCEPT " -- default is " ACCEPT ).
8cce6c
.SS CLASSIFY
8cce6c
This  module  allows you to set the skb->priority value (and thus clas-
8cce6c
sify the packet into a specific CBQ class).
8cce6c
8cce6c
.TP
8cce6c
.BR "--set-class major:minor"
8cce6c
8cce6c
Set the major and minor  class  value.  The  values  are  always
8cce6c
interpreted as hexadecimal even if no 0x prefix is given.
8cce6c
8cce6c
.SH NOTES
8cce6c
In this nft-based version of
8cce6c
.BR arptables ,
8cce6c
support for
8cce6c
.B FORWARD
8cce6c
chain has not been implemented. Since ARP packets are "forwarded" only by Linux
8cce6c
bridges, the same may be achieved using
8cce6c
.B FORWARD
8cce6c
chain in
8cce6c
.BR ebtables .
8cce6c
8cce6c
.SH MAILINGLISTS
8cce6c
.BR "" "See " http://netfilter.org/mailinglists.html
8cce6c
.SH SEE ALSO
8cce6c
.BR xtables-nft "(8), " iptables "(8), " ebtables "(8), " arp "(8), " rarp "(8), " ifconfig "(8), " route (8)
8cce6c
.PP
8cce6c
.BR "" "See " http://ebtables.sf.net