Blame iptables/ebtables-nft.8

Packit Service d1fe03
.TH EBTABLES 8  "December 2011"
Packit Service d1fe03
.\"
Packit Service d1fe03
.\" Man page written by Bart De Schuymer <bdschuym@pandora.be>
Packit Service d1fe03
.\" It is based on the iptables man page.
Packit Service d1fe03
.\"
Packit Service d1fe03
.\" The man page was edited, February 25th 2003, by 
Packit Service d1fe03
.\"      Greg Morgan <" dr_kludge_at_users_sourceforge_net >
Packit Service d1fe03
.\"
Packit Service d1fe03
.\" Iptables page by Herve Eychenne March 2000.
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"     This program is free software; you can redistribute it and/or modify
Packit Service d1fe03
.\"     it under the terms of the GNU General Public License as published by
Packit Service d1fe03
.\"     the Free Software Foundation; either version 2 of the License, or
Packit Service d1fe03
.\"     (at your option) any later version.
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"     This program is distributed in the hope that it will be useful,
Packit Service d1fe03
.\"     but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service d1fe03
.\"     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service d1fe03
.\"     GNU General Public License for more details.
Packit Service d1fe03
.\"
Packit Service d1fe03
.\"     You should have received a copy of the GNU General Public License
Packit Service d1fe03
.\"     along with this program; if not, write to the Free Software
Packit Service d1fe03
.\"     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Packit Service d1fe03
.\"     
Packit Service d1fe03
.\"
Packit Service d1fe03
.SH NAME
Packit Service d1fe03
ebtables \- Ethernet bridge frame table administration (nft-based)
Packit Service d1fe03
.SH SYNOPSIS
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " - [ ACDI "] chain rule specification [match extensions] [watcher extensions] target"
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " -P " chain " ACCEPT " | " DROP " | " RETURN
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " -F " [chain]"
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " -Z " [chain]"
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " -L " [" -Z "] [chain] [ [" --Ln "] | [" --Lx "] ] [" --Lc "] [" --Lmac2 ]
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " -N " chain [" "-P ACCEPT " | " DROP " | " RETURN" ]
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " -X " [chain]"
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " -E " old-chain-name new-chain-name"
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] " --init-table
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] [" --atomic-file " file] " --atomic-commit
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] [" --atomic-file " file] " --atomic-init
Packit Service d1fe03
.br
Packit Service d1fe03
.BR "ebtables " [ -t " table ] [" --atomic-file " file] " --atomic-save
Packit Service d1fe03
.br
Packit Service d1fe03
Packit Service d1fe03
.SH DESCRIPTION
Packit Service d1fe03
.B ebtables
Packit Service d1fe03
is an application program used to set up and maintain the
Packit Service d1fe03
tables of rules (inside the Linux kernel) that inspect
Packit Service d1fe03
Ethernet frames.
Packit Service d1fe03
It is analogous to the
Packit Service d1fe03
.B iptables
Packit Service d1fe03
application, but less complicated, due to the fact that the Ethernet protocol
Packit Service d1fe03
is much simpler than the IP protocol.
Packit Service d1fe03
.SS CHAINS
Packit Service d1fe03
There are two ebtables tables with built-in chains in the
Packit Service d1fe03
Linux kernel. These tables are used to divide functionality into
Packit Service d1fe03
different sets of rules. Each set of rules is called a chain.
Packit Service d1fe03
Each chain is an ordered list of rules that can match Ethernet frames. If a
Packit Service d1fe03
rule matches an Ethernet frame, then a processing specification tells
Packit Service d1fe03
what to do with that matching frame. The processing specification is
Packit Service d1fe03
called a 'target'. However, if the frame does not match the current
Packit Service d1fe03
rule in the chain, then the next rule in the chain is examined and so forth.
Packit Service d1fe03
The user can create new (user-defined) chains that can be used as the 'target'
Packit Service d1fe03
of a rule. User-defined chains are very useful to get better performance
Packit Service d1fe03
over the linear traversal of the rules and are also essential for structuring
Packit Service d1fe03
the filtering rules into well-organized and maintainable sets of rules.
Packit Service d1fe03
.SS TARGETS
Packit Service d1fe03
A firewall rule specifies criteria for an Ethernet frame and a frame
Packit Service d1fe03
processing specification called a target.  When a frame matches a rule,
Packit Service d1fe03
then the next action performed by the kernel is specified by the target.
Packit Service d1fe03
The target can be one of these values:
Packit Service d1fe03
.BR ACCEPT ,
Packit Service d1fe03
.BR DROP ,
Packit Service d1fe03
.BR CONTINUE ,
Packit Service d1fe03
.BR RETURN ,
Packit Service d1fe03
an 'extension' (see below) or a jump to a user-defined chain.
Packit Service d1fe03
.PP
Packit Service d1fe03
.B ACCEPT
Packit Service d1fe03
means to let the frame through.
Packit Service d1fe03
.B DROP
Packit Service d1fe03
means the frame has to be dropped.
Packit Service d1fe03
.B CONTINUE
Packit Service d1fe03
means the next rule has to be checked. This can be handy, f.e., to know how many
Packit Service d1fe03
frames pass a certain point in the chain, to log those frames or to apply multiple
Packit Service d1fe03
targets on a frame.
Packit Service d1fe03
.B RETURN
Packit Service d1fe03
means stop traversing this chain and resume at the next rule in the
Packit Service d1fe03
previous (calling) chain.
Packit Service d1fe03
For the extension targets please refer to the
Packit Service d1fe03
.B "TARGET EXTENSIONS"
Packit Service d1fe03
section of this man page.
Packit Service d1fe03
.SS TABLES
Packit Service d1fe03
As stated earlier, there are two ebtables tables in the Linux
Packit Service d1fe03
kernel.  The table names are
Packit Service d1fe03
.BR filter " and " nat .
Packit Service d1fe03
Of these two tables,
Packit Service d1fe03
the filter table is the default table that the command operates on.
Packit Service d1fe03
If you are working with the filter table, then you can drop the '-t filter'
Packit Service d1fe03
argument to the ebtables command.  However, you will need to provide
Packit Service d1fe03
the -t argument for
Packit Service d1fe03
.B nat
Packit Service d1fe03
table.  Moreover, the -t argument must be the
Packit Service d1fe03
first argument on the ebtables command line, if used. 
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-t, --table"
Packit Service d1fe03
.br
Packit Service d1fe03
.B filter
Packit Service d1fe03
is the default table and contains three built-in chains:
Packit Service d1fe03
.B INPUT 
Packit Service d1fe03
(for frames destined for the bridge itself, on the level of the MAC destination address), 
Packit Service d1fe03
.B OUTPUT 
Packit Service d1fe03
(for locally-generated or (b)routed frames) and
Packit Service d1fe03
.B FORWARD 
Packit Service d1fe03
(for frames being forwarded by the bridge).
Packit Service d1fe03
.br
Packit Service d1fe03
.br
Packit Service d1fe03
.B nat
Packit Service d1fe03
is mostly used to change the mac addresses and contains three built-in chains:
Packit Service d1fe03
.B PREROUTING 
Packit Service d1fe03
(for altering frames as soon as they come in), 
Packit Service d1fe03
.B OUTPUT 
Packit Service d1fe03
(for altering locally generated or (b)routed frames before they are bridged) and 
Packit Service d1fe03
.B POSTROUTING
Packit Service d1fe03
(for altering frames as they are about to go out). A small note on the naming
Packit Service d1fe03
of chains PREROUTING and POSTROUTING: it would be more accurate to call them
Packit Service d1fe03
PREFORWARDING and POSTFORWARDING, but for all those who come from the
Packit Service d1fe03
iptables world to ebtables it is easier to have the same names. Note that you
Packit Service d1fe03
can change the name
Packit Service d1fe03
.BR "" ( -E )
Packit Service d1fe03
if you don't like the default.
Packit Service d1fe03
.SH EBTABLES COMMAND LINE ARGUMENTS
Packit Service d1fe03
After the initial ebtables '-t table' command line argument, the remaining
Packit Service d1fe03
arguments can be divided into several groups.  These groups
Packit Service d1fe03
are commands, miscellaneous commands, rule specifications, match extensions,
Packit Service d1fe03
watcher extensions and target extensions.
Packit Service d1fe03
.SS COMMANDS
Packit Service d1fe03
The ebtables command arguments specify the actions to perform on the table
Packit Service d1fe03
defined with the -t argument.  If you do not use the -t argument to name
Packit Service d1fe03
a table, the commands apply to the default filter table.
Packit Service d1fe03
Only one command may be used on the command line at a time, except when
Packit Service d1fe03
the commands
Packit Service d1fe03
.BR -L " and " -Z
Packit Service d1fe03
are combined, the commands
Packit Service d1fe03
.BR -N " and " -P
Packit Service d1fe03
are combined, or when
Packit Service d1fe03
.B --atomic-file
Packit Service d1fe03
is used.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-A, --append"
Packit Service d1fe03
Append a rule to the end of the selected chain.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-D, --delete"
Packit Service d1fe03
Delete the specified rule or rules from the selected chain. There are two ways to
Packit Service d1fe03
use this command. The first is by specifying an interval of rule numbers
Packit Service d1fe03
to delete (directly after
Packit Service d1fe03
.BR -D ).
Packit Service d1fe03
Syntax: \fIstart_nr\fP[\fI:end_nr\fP] (use
Packit Service d1fe03
.B -L --Ln
Packit Service d1fe03
to list the rules with their rule number). When \fIend_nr\fP is omitted, all rules starting
Packit Service d1fe03
from \fIstart_nr\fP are deleted. Using negative numbers is allowed, for more
Packit Service d1fe03
details about using negative numbers, see the
Packit Service d1fe03
.B -I
Packit Service d1fe03
command. The second usage is by
Packit Service d1fe03
specifying the complete rule as it would have been specified when it was added. Only
Packit Service d1fe03
the first encountered rule that is the same as this specified rule, in other
Packit Service d1fe03
words the matching rule with the lowest (positive) rule number, is deleted.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-C, --change-counters"
Packit Service d1fe03
Change the counters of the specified rule or rules from the selected chain. There are two ways to
Packit Service d1fe03
use this command. The first is by specifying an interval of rule numbers
Packit Service d1fe03
to do the changes on (directly after
Packit Service d1fe03
.BR -C ).
Packit Service d1fe03
Syntax: \fIstart_nr\fP[\fI:end_nr\fP] (use
Packit Service d1fe03
.B -L --Ln
Packit Service d1fe03
to list the rules with their rule number). The details are the same as for the
Packit Service d1fe03
.BR -D " command. The second usage is by"
Packit Service d1fe03
specifying the complete rule as it would have been specified when it was added. Only
Packit Service d1fe03
the counters of the first encountered rule that is the same as this specified rule, in other
Packit Service d1fe03
words the matching rule with the lowest (positive) rule number, are changed.
Packit Service d1fe03
In the first usage, the counters are specified directly after the interval specification,
Packit Service d1fe03
in the second usage directly after
Packit Service d1fe03
.BR -C .
Packit Service d1fe03
First the packet counter is specified, then the byte counter. If the specified counters start
Packit Service d1fe03
with a '+', the counter values are added to the respective current counter values.
Packit Service d1fe03
If the specified counters start with a '-', the counter values are decreased from the respective
Packit Service d1fe03
current counter values. No bounds checking is done. If the counters don't start with '+' or '-',
Packit Service d1fe03
the current counters are changed to the specified counters.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-I, --insert"
Packit Service d1fe03
Insert the specified rule into the selected chain at the specified rule number. If the
Packit Service d1fe03
rule number is not specified, the rule is added at the head of the chain.
Packit Service d1fe03
If the current number of rules equals
Packit Service d1fe03
.IR N ,
Packit Service d1fe03
then the specified number can be
Packit Service d1fe03
between
Packit Service d1fe03
.IR -N " and " N+1 .
Packit Service d1fe03
For a positive number
Packit Service d1fe03
.IR i ,
Packit Service d1fe03
it holds that
Packit Service d1fe03
.IR i " and " i-N-1
Packit Service d1fe03
specify the same place in the chain where the rule should be inserted. The rule number
Packit Service d1fe03
0 specifies the place past the last rule in the chain and using this number is therefore
Packit Service d1fe03
equivalent to using the
Packit Service d1fe03
.BR -A " command."
Packit Service d1fe03
Rule numbers structly smaller than 0 can be useful when more than one rule needs to be inserted
Packit Service d1fe03
in a chain.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-P, --policy"
Packit Service d1fe03
Set the policy for the chain to the given target. The policy can be
Packit Service d1fe03
.BR ACCEPT ", " DROP " or " RETURN .
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-F, --flush"
Packit Service d1fe03
Flush the selected chain. If no chain is selected, then every chain will be
Packit Service d1fe03
flushed. Flushing a chain does not change the policy of the
Packit Service d1fe03
chain, however.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-Z, --zero"
Packit Service d1fe03
Set the counters of the selected chain to zero. If no chain is selected, all the counters
Packit Service d1fe03
are set to zero. The
Packit Service d1fe03
.B "-Z"
Packit Service d1fe03
command can be used in conjunction with the 
Packit Service d1fe03
.B "-L"
Packit Service d1fe03
command.
Packit Service d1fe03
When both the
Packit Service d1fe03
.B "-Z"
Packit Service d1fe03
and
Packit Service d1fe03
.B "-L"
Packit Service d1fe03
commands are used together in this way, the rule counters are printed on the screen
Packit Service d1fe03
before they are set to zero.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-L, --list"
Packit Service d1fe03
List all rules in the selected chain. If no chain is selected, all chains
Packit Service d1fe03
are listed.
Packit Service d1fe03
.br
Packit Service d1fe03
The following options change the output of the
Packit Service d1fe03
.B "-L"
Packit Service d1fe03
command.
Packit Service d1fe03
.br
Packit Service d1fe03
.B "--Ln"
Packit Service d1fe03
.br
Packit Service d1fe03
Places the rule number in front of every rule. This option is incompatible with the
Packit Service d1fe03
.BR --Lx " option."
Packit Service d1fe03
.br
Packit Service d1fe03
.B "--Lc"
Packit Service d1fe03
.br
Packit Service d1fe03
Shows the counters at the end of each rule displayed by the
Packit Service d1fe03
.B "-L"
Packit Service d1fe03
command. Both a frame counter (pcnt) and a byte counter (bcnt) are displayed.
Packit Service d1fe03
The frame counter shows how many frames have matched the specific rule, the byte
Packit Service d1fe03
counter shows the sum of the frame sizes of these matching frames. Using this option
Packit Service d1fe03
.BR "" "in combination with the " --Lx " option causes the counters to be written out"
Packit Service d1fe03
.BR "" "in the '" -c " <pcnt> <bcnt>' option format."
Packit Service d1fe03
.br
Packit Service d1fe03
.B "--Lx"
Packit Service d1fe03
.br
Packit Service d1fe03
Changes the output so that it produces a set of ebtables commands that construct
Packit Service d1fe03
the contents of the chain, when specified.
Packit Service d1fe03
If no chain is specified, ebtables commands to construct the contents of the
Packit Service d1fe03
table are given, including commands for creating the user-defined chains (if any).
Packit Service d1fe03
You can use this set of commands in an ebtables boot or reload
Packit Service d1fe03
script.  For example the output could be used at system startup.
Packit Service d1fe03
The 
Packit Service d1fe03
.B "--Lx"
Packit Service d1fe03
option is incompatible with the
Packit Service d1fe03
.B "--Ln"
Packit Service d1fe03
listing option. Using the
Packit Service d1fe03
.BR --Lx " option together with the " --Lc " option will cause the counters to be written out"
Packit Service d1fe03
.BR "" "in the '" -c " <pcnt> <bcnt>' option format."
Packit Service d1fe03
.br
Packit Service d1fe03
.B "--Lmac2"
Packit Service d1fe03
.br
Packit Service d1fe03
Shows all MAC addresses with the same length, adding leading zeroes
Packit Service d1fe03
if necessary. The default representation omits leading zeroes in the addresses.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-N, --new-chain"
Packit Service d1fe03
Create a new user-defined chain with the given name. The number of
Packit Service d1fe03
user-defined chains is limited only by the number of possible chain names.
Packit Service d1fe03
A user-defined chain name has a maximum
Packit Service d1fe03
length of 31 characters. The standard policy of the user-defined chain is
Packit Service d1fe03
ACCEPT. The policy of the new chain can be initialized to a different standard
Packit Service d1fe03
target by using the
Packit Service d1fe03
.B -P
Packit Service d1fe03
command together with the
Packit Service d1fe03
.B -N
Packit Service d1fe03
command. In this case, the chain name does not have to be specified for the
Packit Service d1fe03
.B -P
Packit Service d1fe03
command.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-X, --delete-chain"
Packit Service d1fe03
Delete the specified user-defined chain. There must be no remaining references (jumps)
Packit Service d1fe03
to the specified chain, otherwise ebtables will refuse to delete it. If no chain is
Packit Service d1fe03
specified, all user-defined chains that aren't referenced will be removed.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-E, --rename-chain"
Packit Service d1fe03
Rename the specified chain to a new name.  Besides renaming a user-defined
Packit Service d1fe03
chain, you can rename a standard chain to a name that suits your
Packit Service d1fe03
taste. For example, if you like PREFORWARDING more than PREROUTING,
Packit Service d1fe03
then you can use the -E command to rename the PREROUTING chain. If you do
Packit Service d1fe03
rename one of the standard ebtables chain names, please be sure to mention
Packit Service d1fe03
this fact should you post a question on the ebtables mailing lists.
Packit Service d1fe03
It would be wise to use the standard name in your post. Renaming a standard
Packit Service d1fe03
ebtables chain in this fashion has no effect on the structure or functioning
Packit Service d1fe03
of the ebtables kernel table.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "--init-table"
Packit Service d1fe03
Replace the current table data by the initial table data.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "--atomic-init"
Packit Service d1fe03
Copy the kernel's initial data of the table to the specified
Packit Service d1fe03
file. This can be used as the first action, after which rules are added
Packit Service d1fe03
to the file. The file can be specified using the
Packit Service d1fe03
.B --atomic-file
Packit Service d1fe03
command or through the
Packit Service d1fe03
.IR EBTABLES_ATOMIC_FILE " environment variable."
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "--atomic-save"
Packit Service d1fe03
Copy the kernel's current data of the table to the specified
Packit Service d1fe03
file. This can be used as the first action, after which rules are added
Packit Service d1fe03
to the file. The file can be specified using the
Packit Service d1fe03
.B --atomic-file
Packit Service d1fe03
command or through the
Packit Service d1fe03
.IR EBTABLES_ATOMIC_FILE " environment variable."
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "--atomic-commit"
Packit Service d1fe03
Replace the kernel table data with the data contained in the specified
Packit Service d1fe03
file. This is a useful command that allows you to load all your rules of a
Packit Service d1fe03
certain table into the kernel at once, saving the kernel a lot of precious
Packit Service d1fe03
time and allowing atomic updates of the tables. The file which contains
Packit Service d1fe03
the table data is constructed by using either the
Packit Service d1fe03
.B "--atomic-init"
Packit Service d1fe03
or the
Packit Service d1fe03
.B "--atomic-save"
Packit Service d1fe03
command to generate a starting file. After that, using the
Packit Service d1fe03
.B "--atomic-file"
Packit Service d1fe03
command when constructing rules or setting the
Packit Service d1fe03
.IR EBTABLES_ATOMIC_FILE " environment variable"
Packit Service d1fe03
allows you to extend the file and build the complete table before
Packit Service d1fe03
committing it to the kernel. This command can be very useful in boot scripts
Packit Service d1fe03
to populate the ebtables tables in a fast way.
Packit Service d1fe03
.SS MISCELLANOUS COMMANDS
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "-V, --version"
Packit Service d1fe03
Show the version of the ebtables userspace program.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "-h, --help " "[\fIlist of module names\fP]"
Packit Service d1fe03
Give a brief description of the command syntax. Here you can also specify
Packit Service d1fe03
names of extensions and ebtables will try to write help about those
Packit Service d1fe03
extensions. E.g.
Packit Service d1fe03
.IR "ebtables -h snat log ip arp" .
Packit Service d1fe03
Specify
Packit Service d1fe03
.I list_extensions
Packit Service d1fe03
to list all extensions supported by the userspace
Packit Service d1fe03
utility.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "-j, --jump " "\fItarget\fP"
Packit Service d1fe03
The target of the rule. This is one of the following values:
Packit Service d1fe03
.BR ACCEPT ,
Packit Service d1fe03
.BR DROP ,
Packit Service d1fe03
.BR CONTINUE ,
Packit Service d1fe03
.BR RETURN ,
Packit Service d1fe03
a target extension (see
Packit Service d1fe03
.BR "TARGET EXTENSIONS" ")"
Packit Service d1fe03
or a user-defined chain name.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --atomic-file "\fIfile\fP"
Packit Service d1fe03
Let the command operate on the specified
Packit Service d1fe03
.IR file .
Packit Service d1fe03
The data of the table to
Packit Service d1fe03
operate on will be extracted from the file and the result of the operation
Packit Service d1fe03
will be saved back into the file. If specified, this option should come
Packit Service d1fe03
before the command specification. An alternative that should be preferred,
Packit Service d1fe03
is setting the
Packit Service d1fe03
.IR EBTABLES_ATOMIC_FILE " environment variable."
Packit Service d1fe03
.TP
Packit Service d1fe03
.B -M, --modprobe "\fIprogram\fP"
Packit Service d1fe03
When talking to the kernel, use this
Packit Service d1fe03
.I program
Packit Service d1fe03
to try to automatically load missing kernel modules.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --concurrent
Packit Service d1fe03
Use a file lock to support concurrent scripts updating the ebtables kernel tables.
Packit Service d1fe03
Packit Service d1fe03
.SS
Packit Service d1fe03
RULE SPECIFICATIONS
Packit Service d1fe03
The following command line arguments make up a rule specification (as used 
Packit Service d1fe03
in the add and delete commands). A "!" option before the specification 
Packit Service d1fe03
inverts the test for that specification. Apart from these standard rule 
Packit Service d1fe03
specifications there are some other command line arguments of interest.
Packit Service d1fe03
See both the 
Packit Service d1fe03
.BR "MATCH EXTENSIONS" 
Packit Service d1fe03
and the
Packit Service d1fe03
.BR "WATCHER EXTENSIONS" 
Packit Service d1fe03
below.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "-p, --protocol " "[!] \fIprotocol\fP"
Packit Service d1fe03
The protocol that was responsible for creating the frame. This can be a
Packit Service d1fe03
hexadecimal number, above 
Packit Service d1fe03
.IR 0x0600 ,
Packit Service d1fe03
a name (e.g.
Packit Service d1fe03
.I ARP
Packit Service d1fe03
) or
Packit Service d1fe03
.BR LENGTH .
Packit Service d1fe03
The protocol field of the Ethernet frame can be used to denote the
Packit Service d1fe03
length of the header (802.2/802.3 networks). When the value of that field is
Packit Service d1fe03
below or equals
Packit Service d1fe03
.IR 0x0600 ,
Packit Service d1fe03
the value equals the size of the header and shouldn't be used as a
Packit Service d1fe03
protocol number. Instead, all frames where the protocol field is used as
Packit Service d1fe03
the length field are assumed to be of the same 'protocol'. The protocol
Packit Service d1fe03
name used in ebtables for these frames is
Packit Service d1fe03
.BR LENGTH .
Packit Service d1fe03
.br
Packit Service d1fe03
The file
Packit Service d1fe03
.B /etc/ethertypes
Packit Service d1fe03
can be used to show readable
Packit Service d1fe03
characters instead of hexadecimal numbers for the protocols. For example,
Packit Service d1fe03
.I 0x0800
Packit Service d1fe03
will be represented by 
Packit Service d1fe03
.IR IPV4 .
Packit Service d1fe03
The use of this file is not case sensitive. 
Packit Service d1fe03
See that file for more information. The flag 
Packit Service d1fe03
.B --proto
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP 
Packit Service d1fe03
.BR "-i, --in-interface " "[!] \fIname\fP"
Packit Service d1fe03
The interface (bridge port) via which a frame is received (this option is useful in the
Packit Service d1fe03
.BR INPUT ,
Packit Service d1fe03
.BR FORWARD ,
Packit Service d1fe03
.BR PREROUTING " and " BROUTING
Packit Service d1fe03
chains). If the interface name ends with '+', then
Packit Service d1fe03
any interface name that begins with this name (disregarding '+') will match.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --in-if
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--logical-in " "[!] \fIname\fP"
Packit Service d1fe03
The (logical) bridge interface via which a frame is received (this option is useful in the
Packit Service d1fe03
.BR INPUT ,
Packit Service d1fe03
.BR FORWARD ,
Packit Service d1fe03
.BR PREROUTING " and " BROUTING
Packit Service d1fe03
chains).
Packit Service d1fe03
If the interface name ends with '+', then
Packit Service d1fe03
any interface name that begins with this name (disregarding '+') will match.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "-o, --out-interface " "[!] \fIname\fP"
Packit Service d1fe03
The interface (bridge port) via which a frame is going to be sent (this option is useful in the
Packit Service d1fe03
.BR OUTPUT ,
Packit Service d1fe03
.B FORWARD
Packit Service d1fe03
and
Packit Service d1fe03
.B POSTROUTING
Packit Service d1fe03
chains). If the interface name ends with '+', then
Packit Service d1fe03
any interface name that begins with this name (disregarding '+') will match.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --out-if
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--logical-out " "[!] \fIname\fP"
Packit Service d1fe03
The (logical) bridge interface via which a frame is going to be sent (this option
Packit Service d1fe03
is useful in the
Packit Service d1fe03
.BR OUTPUT ,
Packit Service d1fe03
.B FORWARD
Packit Service d1fe03
and
Packit Service d1fe03
.B POSTROUTING
Packit Service d1fe03
chains).
Packit Service d1fe03
If the interface name ends with '+', then
Packit Service d1fe03
any interface name that begins with this name (disregarding '+') will match.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The source MAC address. Both mask and address are written as 6 hexadecimal
Packit Service d1fe03
numbers separated by colons. Alternatively one can specify Unicast,
Packit Service d1fe03
Multicast, Broadcast or BGA (Bridge Group Address):
Packit Service d1fe03
.br
Packit Service d1fe03
.IR "Unicast" "=00:00:00:00:00:00/01:00:00:00:00:00,"
Packit Service d1fe03
.IR "Multicast" "=01:00:00:00:00:00/01:00:00:00:00:00,"
Packit Service d1fe03
.IR "Broadcast" "=ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff or"
Packit Service d1fe03
.IR "BGA" "=01:80:c2:00:00:00/ff:ff:ff:ff:ff:ff."
Packit Service d1fe03
Note that a broadcast
Packit Service d1fe03
address will also match the multicast specification. The flag
Packit Service d1fe03
.B --src
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The destination MAC address. See
Packit Service d1fe03
.B -s
Packit Service d1fe03
(above) for more details on MAC addresses. The flag
Packit Service d1fe03
.B --dst
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "-c, --set-counter " "\fIpcnt bcnt\fP"
Packit Service d1fe03
If used with
Packit Service d1fe03
.BR -A " or " -I ", then the packet and byte counters of the new rule will be set to
Packit Service d1fe03
.IR pcnt ", resp. " bcnt ".
Packit Service d1fe03
If used with the
Packit Service d1fe03
.BR -C " or " -D " commands, only rules with a packet and byte count equal to"
Packit Service d1fe03
.IR pcnt ", resp. " bcnt " will match."
Packit Service d1fe03
Packit Service d1fe03
.SS MATCH EXTENSIONS
Packit Service d1fe03
Ebtables extensions are dynamically loaded into the userspace tool,
Packit Service d1fe03
there is therefore no need to explicitly load them with a
Packit Service d1fe03
-m option like is done in iptables.
Packit Service d1fe03
These extensions deal with functionality supported by kernel modules supplemental to
Packit Service d1fe03
the core ebtables code.
Packit Service d1fe03
.SS 802_3
Packit Service d1fe03
Specify 802.3 DSAP/SSAP fields or SNAP type.  The protocol must be specified as
Packit Service d1fe03
.IR "LENGTH " "(see the option " " -p " above).
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--802_3-sap " "[!] \fIsap\fP"
Packit Service d1fe03
DSAP and SSAP are two one byte 802.3 fields.  The bytes are always
Packit Service d1fe03
equal, so only one byte (hexadecimal) is needed as an argument.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--802_3-type " "[!] \fItype\fP"
Packit Service d1fe03
If the 802.3 DSAP and SSAP values are 0xaa then the SNAP type field must
Packit Service d1fe03
be consulted to determine the payload protocol.  This is a two byte
Packit Service d1fe03
(hexadecimal) argument.  Only 802.3 frames with DSAP/SSAP 0xaa are
Packit Service d1fe03
checked for type.
Packit Service d1fe03
.SS among
Packit Service d1fe03
Match a MAC address or MAC/IP address pair versus a list of MAC addresses
Packit Service d1fe03
and MAC/IP address pairs.
Packit Service d1fe03
A list entry has the following format:
Packit Service d1fe03
.IR xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip][,] ". Multiple"
Packit Service d1fe03
list entries are separated by a comma, specifying an IP address corresponding to
Packit Service d1fe03
the MAC address is optional. Multiple MAC/IP address pairs with the same MAC address
Packit Service d1fe03
but different IP address (and vice versa) can be specified. If the MAC address doesn't
Packit Service d1fe03
match any entry from the list, the frame doesn't match the rule (unless "!" was used).
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--among-dst " "[!] \fIlist\fP"
Packit Service d1fe03
Compare the MAC destination to the given list. If the Ethernet frame has type
Packit Service d1fe03
.IR IPv4 " or " ARP ,
Packit Service d1fe03
then comparison with MAC/IP destination address pairs from the
Packit Service d1fe03
list is possible.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--among-src " "[!] \fIlist\fP"
Packit Service d1fe03
Compare the MAC source to the given list. If the Ethernet frame has type
Packit Service d1fe03
.IR IPv4 " or " ARP ,
Packit Service d1fe03
then comparison with MAC/IP source address pairs from the list
Packit Service d1fe03
is possible.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--among-dst-file " "[!] \fIfile\fP"
Packit Service d1fe03
Same as
Packit Service d1fe03
.BR --among-dst " but the list is read in from the specified file."
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--among-src-file " "[!] \fIfile\fP"
Packit Service d1fe03
Same as
Packit Service d1fe03
.BR --among-src " but the list is read in from the specified file."
Packit Service d1fe03
.SS arp
Packit Service d1fe03
Specify (R)ARP fields. The protocol must be specified as
Packit Service d1fe03
.IR ARP " or " RARP .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arp-opcode " "[!] \fIopcode\fP"
Packit Service d1fe03
The (R)ARP opcode (decimal or a string, for more details see
Packit Service d1fe03
.BR "ebtables -h arp" ).
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arp-htype " "[!] \fIhardware type\fP"
Packit Service d1fe03
The hardware type, this can be a decimal or the string
Packit Service d1fe03
.I Ethernet
Packit Service d1fe03
(which sets
Packit Service d1fe03
.I type
Packit Service d1fe03
to 1). Most (R)ARP packets have Eternet as hardware type.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arp-ptype " "[!] \fIprotocol type\fP"
Packit Service d1fe03
The protocol type for which the (r)arp is used (hexadecimal or the string
Packit Service d1fe03
.IR IPv4 ,
Packit Service d1fe03
denoting 0x0800).
Packit Service d1fe03
Most (R)ARP packets have protocol type IPv4.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arp-ip-src " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The (R)ARP IP source address specification.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arp-ip-dst " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The (R)ARP IP destination address specification.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arp-mac-src " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The (R)ARP MAC source address specification.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arp-mac-dst " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The (R)ARP MAC destination address specification.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "" "[!]" " --arp-gratuitous"
Packit Service d1fe03
Checks for ARP gratuitous packets: checks equality of IPv4 source
Packit Service d1fe03
address and IPv4 destination address inside the ARP header.
Packit Service d1fe03
.SS ip
Packit Service d1fe03
Specify IPv4 fields. The protocol must be specified as
Packit Service d1fe03
.IR IPv4 .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip-source " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The source IP address.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip-src
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip-destination " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The destination IP address.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip-dst
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip-tos " "[!] \fItos\fP"
Packit Service d1fe03
The IP type of service, in hexadecimal numbers.
Packit Service d1fe03
.BR IPv4 .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip-protocol " "[!] \fIprotocol\fP"
Packit Service d1fe03
The IP protocol.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip-proto
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip-source-port " "[!] \fIport1\fP[:\fIport2\fP]"
Packit Service d1fe03
The source port or port range for the IP protocols 6 (TCP), 17
Packit Service d1fe03
(UDP), 33 (DCCP) or 132 (SCTP). The
Packit Service d1fe03
.B --ip-protocol
Packit Service d1fe03
option must be specified as
Packit Service d1fe03
.IR TCP ", " UDP ", " DCCP " or " SCTP .
Packit Service d1fe03
If
Packit Service d1fe03
.IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used."
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip-sport
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip-destination-port " "[!] \fIport1\fP[:\fIport2\fP]"
Packit Service d1fe03
The destination port or port range for ip protocols 6 (TCP), 17
Packit Service d1fe03
(UDP), 33 (DCCP) or 132 (SCTP). The
Packit Service d1fe03
.B --ip-protocol
Packit Service d1fe03
option must be specified as
Packit Service d1fe03
.IR TCP ", " UDP ", " DCCP " or " SCTP .
Packit Service d1fe03
If
Packit Service d1fe03
.IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used."
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip-dport
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.SS ip6
Packit Service d1fe03
Specify IPv6 fields. The protocol must be specified as
Packit Service d1fe03
.IR IPv6 .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip6-source " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The source IPv6 address.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip6-src
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip6-destination " "[!] \fIaddress\fP[/\fImask\fP]"
Packit Service d1fe03
The destination IPv6 address.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip6-dst
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip6-tclass " "[!] \fItclass\fP"
Packit Service d1fe03
The IPv6 traffic class, in hexadecimal numbers.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip6-protocol " "[!] \fIprotocol\fP"
Packit Service d1fe03
The IP protocol.
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip6-proto
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip6-source-port " "[!] \fIport1\fP[:\fIport2\fP]"
Packit Service d1fe03
The source port or port range for the IPv6 protocols 6 (TCP), 17
Packit Service d1fe03
(UDP), 33 (DCCP) or 132 (SCTP). The
Packit Service d1fe03
.B --ip6-protocol
Packit Service d1fe03
option must be specified as
Packit Service d1fe03
.IR TCP ", " UDP ", " DCCP " or " SCTP .
Packit Service d1fe03
If
Packit Service d1fe03
.IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used."
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip6-sport
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip6-destination-port " "[!] \fIport1\fP[:\fIport2\fP]"
Packit Service d1fe03
The destination port or port range for IPv6 protocols 6 (TCP), 17
Packit Service d1fe03
(UDP), 33 (DCCP) or 132 (SCTP). The
Packit Service d1fe03
.B --ip6-protocol
Packit Service d1fe03
option must be specified as
Packit Service d1fe03
.IR TCP ", " UDP ", " DCCP " or " SCTP .
Packit Service d1fe03
If
Packit Service d1fe03
.IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used."
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --ip6-dport
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--ip6-icmp-type " "[!] {\fItype\fP[:\fItype\fP]/\fIcode\fP[:\fIcode\fP]|\fItypename\fP}"
Packit Service d1fe03
Specify ipv6\-icmp type and code to match.
Packit Service d1fe03
Ranges for both type and code are supported. Type and code are
Packit Service d1fe03
separated by a slash. Valid numbers for type and range are 0 to 255.
Packit Service d1fe03
To match a single type including all valid codes, symbolic names can
Packit Service d1fe03
be used instead of numbers. The list of known type names is shown by the command
Packit Service d1fe03
.nf
Packit Service d1fe03
  ebtables \-\-help ip6
Packit Service d1fe03
.fi
Packit Service d1fe03
This option is only valid for \-\-ip6-prococol ipv6-icmp.
Packit Service d1fe03
.SS limit
Packit Service d1fe03
This module matches at a limited rate using a token bucket filter.
Packit Service d1fe03
A rule using this extension will match until this limit is reached.
Packit Service d1fe03
It can be used with the
Packit Service d1fe03
.B --log
Packit Service d1fe03
watcher to give limited logging, for example. Its use is the same
Packit Service d1fe03
as the limit match of iptables.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--limit " "[\fIvalue\fP]"
Packit Service d1fe03
Maximum average matching rate: specified as a number, with an optional
Packit Service d1fe03
.IR /second ", " /minute ", " /hour ", or " /day " suffix; the default is " 3/hour .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--limit-burst " "[\fInumber\fP]"
Packit Service d1fe03
Maximum initial number of packets to match: this number gets recharged by
Packit Service d1fe03
one every time the limit specified above is not reached, up to this
Packit Service d1fe03
number; the default is
Packit Service d1fe03
.IR 5 .
Packit Service d1fe03
.SS mark_m
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--mark " "[!] [\fIvalue\fP][/\fImask\fP]"
Packit Service d1fe03
Matches frames with the given unsigned mark value. If a
Packit Service d1fe03
.IR value " and " mask " are specified, the logical AND of the mark value of the frame and"
Packit Service d1fe03
the user-specified
Packit Service d1fe03
.IR mask " is taken before comparing it with the"
Packit Service d1fe03
user-specified mark
Packit Service d1fe03
.IR value ". When only a mark "
Packit Service d1fe03
.IR value " is specified, the packet"
Packit Service d1fe03
only matches when the mark value of the frame equals the user-specified
Packit Service d1fe03
mark
Packit Service d1fe03
.IR value .
Packit Service d1fe03
If only a
Packit Service d1fe03
.IR mask " is specified, the logical"
Packit Service d1fe03
AND of the mark value of the frame and the user-specified
Packit Service d1fe03
.IR mask " is taken and the frame matches when the result of this logical AND is"
Packit Service d1fe03
non-zero. Only specifying a
Packit Service d1fe03
.IR mask " is useful to match multiple mark values."
Packit Service d1fe03
.SS pkttype
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--pkttype-type " "[!] \fItype\fP"
Packit Service d1fe03
Matches on the Ethernet "class" of the frame, which is determined by the
Packit Service d1fe03
generic networking code. Possible values:
Packit Service d1fe03
.IR broadcast " (MAC destination is the broadcast address),"
Packit Service d1fe03
.IR multicast " (MAC destination is a multicast address),"
Packit Service d1fe03
.IR host " (MAC destination is the receiving network device), or "
Packit Service d1fe03
.IR otherhost " (none of the above)."
Packit Service d1fe03
.SS stp
Packit Service d1fe03
Specify stp BPDU (bridge protocol data unit) fields. The destination
Packit Service d1fe03
address
Packit Service d1fe03
.BR "" ( -d ") must be specified as the bridge group address"
Packit Service d1fe03
.IR "" ( BGA ).
Packit Service d1fe03
For all options for which a range of values can be specified, it holds that
Packit Service d1fe03
if the lower bound is omitted (but the colon is not), then the lowest possible lower bound
Packit Service d1fe03
for that option is used, while if the upper bound is omitted (but the colon again is not), the
Packit Service d1fe03
highest possible upper bound for that option is used.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-type " "[!] \fItype\fP"
Packit Service d1fe03
The BPDU type (0-255), recognized non-numerical types are
Packit Service d1fe03
.IR config ", denoting a configuration BPDU (=0), and"
Packit Service d1fe03
.IR tcn ", denothing a topology change notification BPDU (=128)."
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-flags " "[!] \fIflag\fP"
Packit Service d1fe03
The BPDU flag (0-255), recognized non-numerical flags are
Packit Service d1fe03
.IR topology-change ", denoting the topology change flag (=1), and"
Packit Service d1fe03
.IR topology-change-ack ", denoting the topology change acknowledgement flag (=128)."
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-root-prio " "[!] [\fIprio\fP][:\fIprio\fP]"
Packit Service d1fe03
The root priority (0-65535) range.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-root-addr " "[!] [\fIaddress\fP][/\fImask\fP]"
Packit Service d1fe03
The root mac address, see the option
Packit Service d1fe03
.BR -s " for more details."
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-root-cost " "[!] [\fIcost\fP][:\fIcost\fP]"
Packit Service d1fe03
The root path cost (0-4294967295) range.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-sender-prio " "[!] [\fIprio\fP][:\fIprio\fP]"
Packit Service d1fe03
The BPDU's sender priority (0-65535) range.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-sender-addr " "[!] [\fIaddress\fP][/\fImask\fP]"
Packit Service d1fe03
The BPDU's sender mac address, see the option
Packit Service d1fe03
.BR -s " for more details."
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-port " "[!] [\fIport\fP][:\fIport\fP]"
Packit Service d1fe03
The port identifier (0-65535) range.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-msg-age " "[!] [\fIage\fP][:\fIage\fP]"
Packit Service d1fe03
The message age timer (0-65535) range.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-max-age " "[!] [\fIage\fP][:\fIage\fP]"
Packit Service d1fe03
The max age timer (0-65535) range.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-hello-time " "[!] [\fItime\fP][:\fItime\fP]"
Packit Service d1fe03
The hello time timer (0-65535) range.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--stp-forward-delay " "[!] [\fIdelay\fP][:\fIdelay\fP]"
Packit Service d1fe03
The forward delay timer (0-65535) range.
Packit Service d1fe03
.\" .SS string
Packit Service d1fe03
.\" This module matches on a given string using some pattern matching strategy.
Packit Service d1fe03
.\" .TP
Packit Service d1fe03
.\" .BR "--string-algo " "\fIalgorithm\fP"
Packit Service d1fe03
.\" The pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris)
Packit Service d1fe03
.\" .TP
Packit Service d1fe03
.\" .BR "--string-from " "\fIoffset\fP"
Packit Service d1fe03
.\" The lowest offset from which a match can start. (default: 0)
Packit Service d1fe03
.\" .TP
Packit Service d1fe03
.\" .BR "--string-to " "\fIoffset\fP"
Packit Service d1fe03
.\" The highest offset from which a match can start. (default: size of frame)
Packit Service d1fe03
.\" .TP
Packit Service d1fe03
.\" .BR "--string " "[!] \fIpattern\fP"
Packit Service d1fe03
.\" Matches the given pattern.
Packit Service d1fe03
.\" .TP
Packit Service d1fe03
.\" .BR "--string-hex " "[!] \fIpattern\fP"
Packit Service d1fe03
.\" Matches the given pattern in hex notation, e.g. '|0D 0A|', '|0D0A|', 'www|09|netfilter|03|org|00|'
Packit Service d1fe03
.\" .TP
Packit Service d1fe03
.\" .BR "--string-icase"
Packit Service d1fe03
.\" Ignore case when searching.
Packit Service d1fe03
.SS vlan
Packit Service d1fe03
Specify 802.1Q Tag Control Information fields.
Packit Service d1fe03
The protocol must be specified as
Packit Service d1fe03
.IR 802_1Q " (0x8100)."
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--vlan-id " "[!] \fIid\fP"
Packit Service d1fe03
The VLAN identifier field (VID). Decimal number from 0 to 4095.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--vlan-prio " "[!] \fIprio\fP"
Packit Service d1fe03
The user priority field, a decimal number from 0 to 7.
Packit Service d1fe03
The VID should be set to 0 ("null VID") or unspecified
Packit Service d1fe03
(in the latter case the VID is deliberately set to 0).
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--vlan-encap " "[!] \fItype\fP"
Packit Service d1fe03
The encapsulated Ethernet frame type/length.
Packit Service d1fe03
Specified as a hexadecimal
Packit Service d1fe03
number from 0x0000 to 0xFFFF or as a symbolic name
Packit Service d1fe03
from
Packit Service d1fe03
.BR /etc/ethertypes .
Packit Service d1fe03
Packit Service d1fe03
.SS WATCHER EXTENSIONS
Packit Service d1fe03
Watchers only look at frames passing by, they don't modify them nor decide
Packit Service d1fe03
to accept the frames or not. These watchers only
Packit Service d1fe03
see the frame if the frame matches the rule, and they see it before the
Packit Service d1fe03
target is executed.
Packit Service d1fe03
.SS log
Packit Service d1fe03
The log watcher writes descriptive data about a frame to the syslog.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "--log"
Packit Service d1fe03
.br
Packit Service d1fe03
Log with the default loggin options: log-level=
Packit Service d1fe03
.IR info ,
Packit Service d1fe03
log-prefix="", no ip logging, no arp logging.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --log-level "\fIlevel\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Defines the logging level. For the possible values, see
Packit Service d1fe03
.BR "ebtables -h log" .
Packit Service d1fe03
The default level is 
Packit Service d1fe03
.IR info .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR --log-prefix " \fItext\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Defines the prefix
Packit Service d1fe03
.I text
Packit Service d1fe03
to be printed at the beginning of the line with the logging information.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --log-ip 
Packit Service d1fe03
.br
Packit Service d1fe03
Will log the ip information when a frame made by the ip protocol matches 
Packit Service d1fe03
the rule. The default is no ip information logging.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --log-ip6 
Packit Service d1fe03
.br
Packit Service d1fe03
Will log the ipv6 information when a frame made by the ipv6 protocol matches 
Packit Service d1fe03
the rule. The default is no ipv6 information logging.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --log-arp
Packit Service d1fe03
.br
Packit Service d1fe03
Will log the (r)arp information when a frame made by the (r)arp protocols
Packit Service d1fe03
matches the rule. The default is no (r)arp information logging.
Packit Service d1fe03
.SS nflog
Packit Service d1fe03
The nflog watcher passes the packet to the loaded logging backend
Packit Service d1fe03
in order to log the packet. This is usually used in combination with
Packit Service d1fe03
nfnetlink_log as logging backend, which will multicast the packet
Packit Service d1fe03
through a
Packit Service d1fe03
.IR netlink
Packit Service d1fe03
socket to the specified multicast group. One or more userspace processes
Packit Service d1fe03
may subscribe to the group to receive the packets.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "--nflog"
Packit Service d1fe03
.br
Packit Service d1fe03
Log with the default logging options
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --nflog-group "\fInlgroup\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
The netlink group (1 - 2^32-1) to which packets are (only applicable for
Packit Service d1fe03
nfnetlink_log). The default value is 1.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --nflog-prefix "\fIprefix\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
A prefix string to include in the log message, up to 30 characters
Packit Service d1fe03
long, useful for distinguishing messages in the logs.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --nflog-range "\fIsize\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
The number of bytes to be copied to userspace (only applicable for
Packit Service d1fe03
nfnetlink_log). nfnetlink_log instances may specify their own
Packit Service d1fe03
range, this option overrides it.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --nflog-threshold "\fIsize\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Number of packets to queue inside the kernel before sending them
Packit Service d1fe03
to userspace (only applicable for nfnetlink_log). Higher values
Packit Service d1fe03
result in less overhead per packet, but increase delay until the
Packit Service d1fe03
packets reach userspace. The default value is 1.
Packit Service d1fe03
.SS ulog
Packit Service d1fe03
The ulog watcher passes the packet to a userspace
Packit Service d1fe03
logging daemon using netlink multicast sockets. This differs
Packit Service d1fe03
from the log watcher in the sense that the complete packet is
Packit Service d1fe03
sent to userspace instead of a descriptive text and that
Packit Service d1fe03
netlink multicast sockets are used instead of the syslog.
Packit Service d1fe03
This watcher enables parsing of packets with userspace programs, the
Packit Service d1fe03
physical bridge in and out ports are also included in the netlink messages.
Packit Service d1fe03
The ulog watcher module accepts 2 parameters when the module is loaded
Packit Service d1fe03
into the kernel (e.g. with modprobe):
Packit Service d1fe03
.B nlbufsiz
Packit Service d1fe03
specifies how big the buffer for each netlink multicast
Packit Service d1fe03
group is. If you say
Packit Service d1fe03
.IR nlbufsiz=8192 ,
Packit Service d1fe03
for example, up to eight kB of packets will
Packit Service d1fe03
get accumulated in the kernel until they are sent to userspace. It is
Packit Service d1fe03
not possible to allocate more than 128kB. Please also keep in mind that
Packit Service d1fe03
this buffer size is allocated for each nlgroup you are using, so the
Packit Service d1fe03
total kernel memory usage increases by that factor. The default is 4096.
Packit Service d1fe03
.B flushtimeout
Packit Service d1fe03
specifies after how many hundredths of a second the queue should be
Packit Service d1fe03
flushed, even if it is not full yet. The default is 10 (one tenth of
Packit Service d1fe03
a second).
Packit Service d1fe03
.TP
Packit Service d1fe03
.B "--ulog"
Packit Service d1fe03
.br
Packit Service d1fe03
Use the default settings: ulog-prefix="", ulog-nlgroup=1,
Packit Service d1fe03
ulog-cprange=4096, ulog-qthreshold=1.
Packit Service d1fe03
.TP
Packit Service d1fe03
.B --ulog-prefix "\fItext\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Defines the prefix included with the packets sent to userspace.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR --ulog-nlgroup " \fIgroup\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Defines which netlink group number to use (a number from 1 to 32).
Packit Service d1fe03
Make sure the netlink group numbers used for the iptables ULOG
Packit Service d1fe03
target differ from those used for the ebtables ulog watcher.
Packit Service d1fe03
The default group number is 1.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR --ulog-cprange " \fIrange\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Defines the maximum copy range to userspace, for packets matching the
Packit Service d1fe03
rule. The default range is 0, which means the maximum copy range is
Packit Service d1fe03
given by
Packit Service d1fe03
.BR nlbufsiz .
Packit Service d1fe03
A maximum copy range larger than
Packit Service d1fe03
128*1024 is meaningless as the packets sent to userspace have an upper
Packit Service d1fe03
size limit of 128*1024.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR --ulog-qthreshold " \fIthreshold\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Queue at most
Packit Service d1fe03
.I threshold
Packit Service d1fe03
number of packets before sending them to
Packit Service d1fe03
userspace with a netlink socket. Note that packets can be sent to
Packit Service d1fe03
userspace before the queue is full, this happens when the ulog
Packit Service d1fe03
kernel timer goes off (the frequency of this timer depends on
Packit Service d1fe03
.BR flushtimeout ).
Packit Service d1fe03
.SS TARGET EXTENSIONS
Packit Service d1fe03
.SS arpreply
Packit Service d1fe03
The
Packit Service d1fe03
.B arpreply
Packit Service d1fe03
target can be used in the
Packit Service d1fe03
.BR PREROUTING " chain of the " nat " table."
Packit Service d1fe03
If this target sees an ARP request it will automatically reply
Packit Service d1fe03
with an ARP reply. The used MAC address for the reply can be specified.
Packit Service d1fe03
The protocol must be specified as
Packit Service d1fe03
.IR ARP .
Packit Service d1fe03
When the ARP message is not an ARP request or when the ARP request isn't
Packit Service d1fe03
for an IP address on an Ethernet network, it is ignored by this target
Packit Service d1fe03
.BR "" ( CONTINUE ).
Packit Service d1fe03
When the ARP request is malformed, it is dropped
Packit Service d1fe03
.BR "" ( DROP ).
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arpreply-mac " "\fIaddress\fP"
Packit Service d1fe03
Specifies the MAC address to reply with: the Ethernet source MAC and the
Packit Service d1fe03
ARP payload source MAC will be filled in with this address.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--arpreply-target " "\fItarget\fP"
Packit Service d1fe03
Specifies the standard target. After sending the ARP reply, the rule still
Packit Service d1fe03
has to give a standard target so ebtables knows what to do with the ARP request.
Packit Service d1fe03
The default target
Packit Service d1fe03
.BR "" "is " DROP .
Packit Service d1fe03
.SS dnat
Packit Service d1fe03
The
Packit Service d1fe03
.B dnat
Packit Service d1fe03
target can only be used in the
Packit Service d1fe03
.BR PREROUTING " and " OUTPUT " chains of the " nat " table."
Packit Service d1fe03
It specifies that the destination MAC address has to be changed.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--to-destination " "\fIaddress\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Change the destination MAC address to the specified
Packit Service d1fe03
.IR address .
Packit Service d1fe03
The flag
Packit Service d1fe03
.B --to-dst
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--dnat-target " "\fItarget\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Specifies the standard target. After doing the dnat, the rule still has to
Packit Service d1fe03
give a standard target so ebtables knows what to do with the dnated frame.
Packit Service d1fe03
The default target is
Packit Service d1fe03
.BR ACCEPT .
Packit Service d1fe03
Making it
Packit Service d1fe03
.BR CONTINUE " could let you use"
Packit Service d1fe03
multiple target extensions on the same frame. Making it
Packit Service d1fe03
.BR DROP " only makes"
Packit Service d1fe03
sense in the
Packit Service d1fe03
.BR BROUTING " chain but using the " redirect " target is more logical there. " RETURN " is also allowed. Note that using " RETURN
Packit Service d1fe03
in a base chain is not allowed (for obvious reasons).
Packit Service d1fe03
.SS mark
Packit Service d1fe03
.BR "" "The " mark " target can be used in every chain of every table. It is possible"
Packit Service d1fe03
to use the marking of a frame/packet in both ebtables and iptables,
Packit Service d1fe03
if the bridge-nf code is compiled into the kernel. Both put the marking at the
Packit Service d1fe03
same place. This allows for a form of communication between ebtables and iptables.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--mark-set " "\fIvalue\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Mark the frame with the specified non-negative
Packit Service d1fe03
.IR value .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--mark-or " "\fIvalue\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Or the frame with the specified non-negative
Packit Service d1fe03
.IR value .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--mark-and " "\fIvalue\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
And the frame with the specified non-negative
Packit Service d1fe03
.IR value .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--mark-xor " "\fIvalue\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Xor the frame with the specified non-negative
Packit Service d1fe03
.IR value .
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--mark-target " "\fItarget\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Specifies the standard target. After marking the frame, the rule
Packit Service d1fe03
still has to give a standard target so ebtables knows what to do.
Packit Service d1fe03
The default target is
Packit Service d1fe03
.BR ACCEPT ". Making it " CONTINUE " can let you do other"
Packit Service d1fe03
things with the frame in subsequent rules of the chain.
Packit Service d1fe03
.SS redirect
Packit Service d1fe03
The
Packit Service d1fe03
.B redirect
Packit Service d1fe03
target will change the MAC target address to that of the bridge device the
Packit Service d1fe03
frame arrived on. This target can only be used in the
Packit Service d1fe03
.BR PREROUTING " chain of the " nat " table."
Packit Service d1fe03
The MAC address of the bridge is used as destination address."
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--redirect-target " "\fItarget\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Specifies the standard target. After doing the MAC redirect, the rule
Packit Service d1fe03
still has to give a standard target so ebtables knows what to do.
Packit Service d1fe03
The default target is
Packit Service d1fe03
.BR ACCEPT ". Making it " CONTINUE " could let you use"
Packit Service d1fe03
multiple target extensions on the same frame. Making it
Packit Service d1fe03
.BR DROP " in the " BROUTING " chain will let the frames be routed. " RETURN " is also allowed. Note"
Packit Service d1fe03
.BR "" "that using " RETURN " in a base chain is not allowed."
Packit Service d1fe03
.SS snat
Packit Service d1fe03
The
Packit Service d1fe03
.B snat
Packit Service d1fe03
target can only be used in the
Packit Service d1fe03
.BR POSTROUTING " chain of the " nat " table."
Packit Service d1fe03
It specifies that the source MAC address has to be changed.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--to-source " "\fIaddress\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Changes the source MAC address to the specified
Packit Service d1fe03
.IR address ". The flag"
Packit Service d1fe03
.B --to-src
Packit Service d1fe03
is an alias for this option.
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--snat-target " "\fItarget\fP"
Packit Service d1fe03
.br
Packit Service d1fe03
Specifies the standard target. After doing the snat, the rule still has 
Packit Service d1fe03
to give a standard target so ebtables knows what to do.
Packit Service d1fe03
.BR "" "The default target is " ACCEPT ". Making it " CONTINUE " could let you use"
Packit Service d1fe03
.BR "" "multiple target extensions on the same frame. Making it " DROP " doesn't"
Packit Service d1fe03
.BR "" "make sense, but you could do that too. " RETURN " is also allowed. Note"
Packit Service d1fe03
.BR "" "that using " RETURN " in a base chain is not allowed."
Packit Service d1fe03
.br
Packit Service d1fe03
.TP
Packit Service d1fe03
.BR "--snat-arp "
Packit Service d1fe03
.br
Packit Service d1fe03
Also change the hardware source address inside the arp header if the packet is an
Packit Service d1fe03
arp message and the hardware address length in the arp header is 6 bytes.
Packit Service d1fe03
.br
Packit Service d1fe03
.SH FILES
Packit Service d1fe03
.I /etc/ethertypes
Packit Service d1fe03
.SH ENVIRONMENT VARIABLES
Packit Service d1fe03
.I EBTABLES_ATOMIC_FILE
Packit Service d1fe03
.SH MAILINGLISTS
Packit Service d1fe03
.BR "" "See " http://netfilter.org/mailinglists.html
Packit Service d1fe03
.SH BUGS
Packit Service d1fe03
The version of ebtables this man page ships with does not support the
Packit Service d1fe03
.B broute
Packit Service d1fe03
table. Also there is no support for
Packit Service d1fe03
.B string
Packit Service d1fe03
match. And finally, this list is probably not complete.
Packit Service d1fe03
.SH SEE ALSO
Packit Service d1fe03
.BR xtables-nft "(8), " iptables "(8), " ip (8)
Packit Service d1fe03
.PP
Packit Service d1fe03
.BR "" "See " https://wiki.nftables.org