Bart De Schuymer | 592d565 | 2006-12-15 11:36:30 +0000 | [diff] [blame] | 1 | .TH EBTABLES 8 "$(DATE)" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 2 | .\" |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 3 | .\" Man page written by Bart De Schuymer <bdschuym@pandora.be> |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 4 | .\" It is based on the iptables man page. |
| 5 | .\" |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 6 | .\" The man page was edited, February 25th 2003, by |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 7 | .\" Greg Morgan <" dr_kludge_at_users_sourceforge_net > |
| 8 | .\" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 9 | .\" Iptables page by Herve Eychenne March 2000. |
| 10 | .\" |
| 11 | .\" This program is free software; you can redistribute it and/or modify |
| 12 | .\" it under the terms of the GNU General Public License as published by |
| 13 | .\" the Free Software Foundation; either version 2 of the License, or |
| 14 | .\" (at your option) any later version. |
| 15 | .\" |
| 16 | .\" This program is distributed in the hope that it will be useful, |
| 17 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | .\" GNU General Public License for more details. |
| 20 | .\" |
| 21 | .\" You should have received a copy of the GNU General Public License |
| 22 | .\" along with this program; if not, write to the Free Software |
| 23 | .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 24 | .\" |
| 25 | .\" |
| 26 | .SH NAME |
Bart De Schuymer | 592d565 | 2006-12-15 11:36:30 +0000 | [diff] [blame] | 27 | ebtables (v$(VERSION)) \- Ethernet bridge frame table administration |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 28 | .SH SYNOPSIS |
Bart De Schuymer | ab611e2 | 2005-02-14 20:20:03 +0000 | [diff] [blame] | 29 | .BR "ebtables " [ -t " table ] " - [ ACDI "] chain rule specification [match extensions] [watcher extensions] target" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 30 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 31 | .BR "ebtables " [ -t " table ] " -P " chain " ACCEPT " | " DROP " | " RETURN |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 32 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 33 | .BR "ebtables " [ -t " table ] " -F " [chain]" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 34 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 35 | .BR "ebtables " [ -t " table ] " -Z " [chain]" |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 36 | .br |
Bart De Schuymer | b5917d8 | 2005-01-25 21:15:59 +0000 | [diff] [blame] | 37 | .BR "ebtables " [ -t " table ] " -L " [" -Z "] [chain] [ [" --Ln "] | [" --Lx "] ] [" --Lc "] [" --Lmac2 ] |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 38 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 39 | .BR "ebtables " [ -t " table ] " -N " chain [" "-P ACCEPT " | " DROP " | " RETURN" ] |
Bart De Schuymer | 637ecd2 | 2003-07-13 18:53:50 +0000 | [diff] [blame] | 40 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 41 | .BR "ebtables " [ -t " table ] " -X " [chain]" |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 42 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 43 | .BR "ebtables " [ -t " table ] " -E " old-chain-name new-chain-name" |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 44 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 45 | .BR "ebtables " [ -t " table ] " --init-table |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 46 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 47 | .BR "ebtables " [ -t " table ] [" --atomic-file " file] " --atomic-commit |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 48 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 49 | .BR "ebtables " [ -t " table ] [" --atomic-file " file] " --atomic-init |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 50 | .br |
Bart De Schuymer | 6622a01 | 2005-01-19 21:09:05 +0000 | [diff] [blame] | 51 | .BR "ebtables " [ -t " table ] [" --atomic-file " file] " --atomic-save |
| 52 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 53 | .SH DESCRIPTION |
| 54 | .B ebtables |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 55 | is an application program used to set up and maintain the |
| 56 | tables of rules (inside the Linux kernel) that inspect |
| 57 | Ethernet frames. |
| 58 | It is analogous to the |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 59 | .B iptables |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 60 | application, but less complicated, due to the fact that the Ethernet protocol |
| 61 | is much simpler than the IP protocol. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 62 | .SS CHAINS |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 63 | There are three ebtables tables with built-in chains in the |
| 64 | Linux kernel. These tables are used to divide functionality into |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 65 | different sets of rules. Each set of rules is called a chain. |
| 66 | Each chain is an ordered list of rules that can match Ethernet frames. If a |
| 67 | rule matches an Ethernet frame, then a processing specification tells |
| 68 | what to do with that matching frame. The processing specification is |
| 69 | called a 'target'. However, if the frame does not match the current |
| 70 | rule in the chain, then the next rule in the chain is examined and so forth. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 71 | The user can create new (user-defined) chains that can be used as the 'target' |
Bart De Schuymer | 37d520d | 2004-10-24 07:36:15 +0000 | [diff] [blame] | 72 | of a rule. User-defined chains are very useful to get better performance |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 73 | over the linear traversal of the rules and are also essential for structuring |
| 74 | the filtering rules into well-organized and maintainable sets of rules. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 75 | .SS TARGETS |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 76 | A firewall rule specifies criteria for an Ethernet frame and a frame |
| 77 | processing specification called a target. When a frame matches a rule, |
| 78 | then the next action performed by the kernel is specified by the target. |
| 79 | The target can be one of these values: |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 80 | .BR ACCEPT , |
| 81 | .BR DROP , |
| 82 | .BR CONTINUE , |
| 83 | .BR RETURN , |
| 84 | an 'extension' (see below) or a jump to a user-defined chain. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 85 | .PP |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 86 | .B ACCEPT |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 87 | means to let the frame through. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 88 | .B DROP |
Bart De Schuymer | 1902d18 | 2006-01-23 19:02:18 +0000 | [diff] [blame] | 89 | means the frame has to be dropped. In the |
| 90 | .BR BROUTING " chain however, the " ACCEPT " and " DROP " target have different" |
| 91 | meanings (see the info provided for the |
| 92 | .BR -t " option)." |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 93 | .B CONTINUE |
| 94 | means the next rule has to be checked. This can be handy, f.e., to know how many |
| 95 | frames pass a certain point in the chain, to log those frames or to apply multiple |
| 96 | targets on a frame. |
| 97 | .B RETURN |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 98 | means stop traversing this chain and resume at the next rule in the |
| 99 | previous (calling) chain. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 100 | For the extension targets please refer to the |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 101 | .B "TARGET EXTENSIONS" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 102 | section of this man page. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 103 | .SS TABLES |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 104 | As stated earlier, there are three ebtables tables in the Linux |
| 105 | kernel. The table names are |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 106 | .BR filter ", " nat " and " broute . |
| 107 | Of these three tables, |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 108 | the filter table is the default table that the command operates on. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 109 | If you are working with the filter table, then you can drop the '-t filter' |
| 110 | argument to the ebtables command. However, you will need to provide |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 111 | the -t argument for the other two tables. Moreover, the -t argument must be the |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 112 | first argument on the ebtables command line, if used. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 113 | .TP |
| 114 | .B "-t, --table" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 115 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 116 | .B filter |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 117 | is the default table and contains three built-in chains: |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 118 | .B INPUT |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 119 | (for frames destined for the bridge itself, on the level of the MAC destination address), |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 120 | .B OUTPUT |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 121 | (for locally-generated or (b)routed frames) and |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 122 | .B FORWARD |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 123 | (for frames being forwarded by the bridge). |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 124 | .br |
| 125 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 126 | .B nat |
| 127 | is mostly used to change the mac addresses and contains three built-in chains: |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 128 | .B PREROUTING |
| 129 | (for altering frames as soon as they come in), |
| 130 | .B OUTPUT |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 131 | (for altering locally generated or (b)routed frames before they are bridged) and |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 132 | .B POSTROUTING |
| 133 | (for altering frames as they are about to go out). A small note on the naming |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 134 | of chains PREROUTING and POSTROUTING: it would be more accurate to call them |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 135 | PREFORWARDING and POSTFORWARDING, but for all those who come from the |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 136 | iptables world to ebtables it is easier to have the same names. Note that you |
| 137 | can change the name |
| 138 | .BR "" ( -E ) |
| 139 | if you don't like the default. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 140 | .br |
| 141 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 142 | .B broute |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 143 | is used to make a brouter, it has one built-in chain: |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 144 | .BR BROUTING . |
| 145 | The targets |
| 146 | .BR DROP " and " ACCEPT |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 147 | have a special meaning in the broute table (these names are used instead of |
| 148 | more descriptive names to keep the implementation generic). |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 149 | .B DROP |
| 150 | actually means the frame has to be routed, while |
| 151 | .B ACCEPT |
| 152 | means the frame has to be bridged. The |
| 153 | .B BROUTING |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 154 | chain is traversed very early. However, it is only traversed by frames entering on |
| 155 | a bridge port that is in forwarding state. Normally those frames |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 156 | would be bridged, but you can decide otherwise here. The |
| 157 | .B redirect |
| 158 | target is very handy here. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 159 | .SH EBTABLES COMMAND LINE ARGUMENTS |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 160 | After the initial ebtables '-t table' command line argument, the remaining |
| 161 | arguments can be divided into several groups. These groups |
| 162 | are commands, miscellaneous commands, rule specifications, match extensions, |
| 163 | watcher extensions and target extensions. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 164 | .SS COMMANDS |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 165 | The ebtables command arguments specify the actions to perform on the table |
| 166 | defined with the -t argument. If you do not use the -t argument to name |
| 167 | a table, the commands apply to the default filter table. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 168 | Only one command may be used on the command line at a time, except when |
| 169 | the commands |
| 170 | .BR -L " and " -Z |
| 171 | are combined, the commands |
| 172 | .BR -N " and " -P |
| 173 | are combined, or when |
| 174 | .B --atomic-file |
| 175 | is used. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 176 | .TP |
| 177 | .B "-A, --append" |
| 178 | Append a rule to the end of the selected chain. |
| 179 | .TP |
| 180 | .B "-D, --delete" |
Bart De Schuymer | ab611e2 | 2005-02-14 20:20:03 +0000 | [diff] [blame] | 181 | Delete the specified rule or rules from the selected chain. There are two ways to |
Bart De Schuymer | abc8417 | 2002-11-06 21:02:33 +0000 | [diff] [blame] | 182 | use this command. The first is by specifying an interval of rule numbers |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 183 | to delete (directly after |
| 184 | .BR -D ). |
| 185 | Syntax: \fIstart_nr\fP[\fI:end_nr\fP] (use |
| 186 | .B -L --Ln |
Bart De Schuymer | ab611e2 | 2005-02-14 20:20:03 +0000 | [diff] [blame] | 187 | to list the rules with their rule number). When \fIend_nr\fP is omitted, all rules starting |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 188 | from \fIstart_nr\fP are deleted. Using negative numbers is allowed, for more |
| 189 | details about using negative numbers, see the |
| 190 | .B -I |
| 191 | command. The second usage is by |
| 192 | specifying the complete rule as it would have been specified when it was added. Only |
| 193 | the first encountered rule that is the same as this specified rule, in other |
Bart De Schuymer | ab611e2 | 2005-02-14 20:20:03 +0000 | [diff] [blame] | 194 | words the matching rule with the lowest (positive) rule number, is deleted. |
| 195 | .TP |
| 196 | .B "-C, --change-counters" |
| 197 | Change the counters of the specified rule or rules from the selected chain. There are two ways to |
| 198 | use this command. The first is by specifying an interval of rule numbers |
| 199 | to do the changes on (directly after |
| 200 | .BR -C ). |
| 201 | Syntax: \fIstart_nr\fP[\fI:end_nr\fP] (use |
| 202 | .B -L --Ln |
| 203 | to list the rules with their rule number). The details are the same as for the |
| 204 | .BR -D " command. The second usage is by" |
| 205 | specifying the complete rule as it would have been specified when it was added. Only |
| 206 | the counters of the first encountered rule that is the same as this specified rule, in other |
| 207 | words the matching rule with the lowest (positive) rule number, are changed. |
| 208 | In the first usage, the counters are specified directly after the interval specification, |
| 209 | in the second usage directly after |
| 210 | .BR -C . |
| 211 | First the packet counter is specified, then the byte counter. If the specified counters start |
| 212 | with a '+', the counter values are added to the respective current counter values. |
| 213 | If the specified counters start with a '-', the counter values are decreased from the respective |
| 214 | current counter values. No bounds checking is done. If the counters don't start with '+' or '-', |
Bart De Schuymer | c900a01 | 2005-09-29 20:12:22 +0000 | [diff] [blame] | 215 | the current counters are changed to the specified counters. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 216 | .TP |
| 217 | .B "-I, --insert" |
Bart De Schuymer | 0158123 | 2005-07-24 09:46:09 +0000 | [diff] [blame] | 218 | Insert the specified rule into the selected chain at the specified rule number. If the |
| 219 | rule number is not specified, the rule is added at the head of the chain. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 220 | If the current number of rules equals |
| 221 | .IR N , |
| 222 | then the specified number can be |
| 223 | between |
| 224 | .IR -N " and " N+1 . |
| 225 | For a positive number |
| 226 | .IR i , |
| 227 | it holds that |
| 228 | .IR i " and " i-N-1 |
| 229 | specify the same place in the chain where the rule should be inserted. The rule number |
| 230 | 0 specifies the place past the last rule in the chain and using this number is therefore |
| 231 | equivalent to using the |
| 232 | .BR -A " command." |
| 233 | Rule numbers structly smaller than 0 can be useful when more than one rule needs to be inserted |
| 234 | in a chain. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 235 | .TP |
| 236 | .B "-P, --policy" |
Bart De Schuymer | efc3c86 | 2002-12-07 11:36:47 +0000 | [diff] [blame] | 237 | Set the policy for the chain to the given target. The policy can be |
| 238 | .BR ACCEPT ", " DROP " or " RETURN . |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 239 | .TP |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 240 | .B "-F, --flush" |
| 241 | Flush the selected chain. If no chain is selected, then every chain will be |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 242 | flushed. Flushing a chain does not change the policy of the |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 243 | chain, however. |
| 244 | .TP |
| 245 | .B "-Z, --zero" |
| 246 | Set the counters of the selected chain to zero. If no chain is selected, all the counters |
| 247 | are set to zero. The |
| 248 | .B "-Z" |
| 249 | command can be used in conjunction with the |
| 250 | .B "-L" |
| 251 | command. |
| 252 | When both the |
| 253 | .B "-Z" |
| 254 | and |
| 255 | .B "-L" |
| 256 | commands are used together in this way, the rule counters are printed on the screen |
| 257 | before they are set to zero. |
| 258 | .TP |
| 259 | .B "-L, --list" |
| 260 | List all rules in the selected chain. If no chain is selected, all chains |
| 261 | are listed. |
| 262 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 263 | The following options change the output of the |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 264 | .B "-L" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 265 | command. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 266 | .br |
| 267 | .B "--Ln" |
| 268 | .br |
Bart De Schuymer | b5917d8 | 2005-01-25 21:15:59 +0000 | [diff] [blame] | 269 | Places the rule number in front of every rule. This option is incompatible with the |
| 270 | .BR --Lx " option." |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 271 | .br |
| 272 | .B "--Lc" |
| 273 | .br |
| 274 | Shows the counters at the end of each rule displayed by the |
| 275 | .B "-L" |
| 276 | command. Both a frame counter (pcnt) and a byte counter (bcnt) are displayed. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 277 | The frame counter shows how many frames have matched the specific rule, the byte |
Bart De Schuymer | b5917d8 | 2005-01-25 21:15:59 +0000 | [diff] [blame] | 278 | counter shows the sum of the frame sizes of these matching frames. Using this option |
| 279 | .BR "" "in combination with the " --Lx " option causes the counters to be written out" |
| 280 | .BR "" "in the '" -c " <pcnt> <bcnt>' option format." |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 281 | .br |
| 282 | .B "--Lx" |
| 283 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 284 | Changes the output so that it produces a set of ebtables commands that construct |
| 285 | the contents of the chain, when specified. |
| 286 | If no chain is specified, ebtables commands to construct the contents of the |
| 287 | table are given, including commands for creating the user-defined chains (if any). |
| 288 | You can use this set of commands in an ebtables boot or reload |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 289 | script. For example the output could be used at system startup. |
| 290 | The |
| 291 | .B "--Lx" |
Bart De Schuymer | b5917d8 | 2005-01-25 21:15:59 +0000 | [diff] [blame] | 292 | option is incompatible with the |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 293 | .B "--Ln" |
Bart De Schuymer | b5917d8 | 2005-01-25 21:15:59 +0000 | [diff] [blame] | 294 | listing option. Using the |
| 295 | .BR --Lx " option together with the " --Lc " option will cause the counters to be written out" |
| 296 | .BR "" "in the '" -c " <pcnt> <bcnt>' option format." |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 297 | .br |
| 298 | .B "--Lmac2" |
| 299 | .br |
| 300 | Shows all MAC addresses with the same length, adding leading zeroes |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 301 | if necessary. The default representation omits leading zeroes in the addresses. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 302 | .TP |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 303 | .B "-N, --new-chain" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 304 | Create a new user-defined chain with the given name. The number of |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 305 | user-defined chains is limited only by the number of possible chain names. |
| 306 | A user-defined chain name has a maximum |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 307 | length of 31 characters. The standard policy of the user-defined chain is |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 308 | ACCEPT. The policy of the new chain can be initialized to a different standard |
| 309 | target by using the |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 310 | .B -P |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 311 | command together with the |
| 312 | .B -N |
| 313 | command. In this case, the chain name does not have to be specified for the |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 314 | .B -P |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 315 | command. |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 316 | .TP |
| 317 | .B "-X, --delete-chain" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 318 | Delete the specified user-defined chain. There must be no remaining references (jumps) |
| 319 | to the specified chain, otherwise ebtables will refuse to delete it. If no chain is |
| 320 | specified, all user-defined chains that aren't referenced will be removed. |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 321 | .TP |
| 322 | .B "-E, --rename-chain" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 323 | Rename the specified chain to a new name. Besides renaming a user-defined |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 324 | chain, you can rename a standard chain to a name that suits your |
| 325 | taste. For example, if you like PREFORWARDING more than PREROUTING, |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 326 | then you can use the -E command to rename the PREROUTING chain. If you do |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 327 | rename one of the standard ebtables chain names, please be sure to mention |
| 328 | this fact should you post a question on the ebtables mailing lists. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 329 | It would be wise to use the standard name in your post. Renaming a standard |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 330 | ebtables chain in this fashion has no effect on the structure or functioning |
| 331 | of the ebtables kernel table. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 332 | .TP |
| 333 | .B "--init-table" |
| 334 | Replace the current table data by the initial table data. |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 335 | .TP |
| 336 | .B "--atomic-init" |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 337 | Copy the kernel's initial data of the table to the specified |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 338 | file. This can be used as the first action, after which rules are added |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 339 | to the file. The file can be specified using the |
| 340 | .B --atomic-file |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 341 | command or through the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 342 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 343 | .TP |
| 344 | .B "--atomic-save" |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 345 | Copy the kernel's current data of the table to the specified |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 346 | file. This can be used as the first action, after which rules are added |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 347 | to the file. The file can be specified using the |
| 348 | .B --atomic-file |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 349 | command or through the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 350 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 351 | .TP |
| 352 | .B "--atomic-commit" |
| 353 | Replace the kernel table data with the data contained in the specified |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 354 | file. This is a useful command that allows you to load all your rules of a |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 355 | certain table into the kernel at once, saving the kernel a lot of precious |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 356 | time and allowing atomic updates of the tables. The file which contains |
| 357 | the table data is constructed by using either the |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 358 | .B "--atomic-init" |
| 359 | or the |
| 360 | .B "--atomic-save" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 361 | command to generate a starting file. After that, using the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 362 | .B "--atomic-file" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 363 | command when constructing rules or setting the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 364 | .IR EBTABLES_ATOMIC_FILE " environment variable" |
| 365 | allows you to extend the file and build the complete table before |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 366 | committing it to the kernel. This command can be very useful in boot scripts |
| 367 | to populate the ebtables tables in a fast way. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 368 | .SS MISCELLANOUS COMMANDS |
| 369 | .TP |
| 370 | .B "-V, --version" |
| 371 | Show the version of the ebtables userspace program. |
| 372 | .TP |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 373 | .BR "-h, --help " "[\fIlist of module names\fP]" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 374 | Give a brief description of the command syntax. Here you can also specify |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 375 | names of extensions and ebtables will try to write help about those |
| 376 | extensions. E.g. |
| 377 | .IR "ebtables -h snat log ip arp" . |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 378 | Specify |
| 379 | .I list_extensions |
| 380 | to list all extensions supported by the userspace |
| 381 | utility. |
| 382 | .TP |
| 383 | .BR "-j, --jump " "\fItarget\fP" |
| 384 | The target of the rule. This is one of the following values: |
| 385 | .BR ACCEPT , |
| 386 | .BR DROP , |
| 387 | .BR CONTINUE , |
| 388 | .BR RETURN , |
| 389 | a target extension (see |
| 390 | .BR "TARGET EXTENSIONS" ")" |
| 391 | or a user-defined chain name. |
| 392 | .TP |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 393 | .B --atomic-file "\fIfile\fP" |
| 394 | Let the command operate on the specified |
| 395 | .IR file . |
| 396 | The data of the table to |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 397 | operate on will be extracted from the file and the result of the operation |
| 398 | will be saved back into the file. If specified, this option should come |
| 399 | before the command specification. An alternative that should be preferred, |
| 400 | is setting the |
| 401 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
| 402 | .TP |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 403 | .B -M, --modprobe "\fIprogram\fP" |
| 404 | When talking to the kernel, use this |
| 405 | .I program |
| 406 | to try to automatically load missing kernel modules. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 407 | |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 408 | .SS |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 409 | RULE SPECIFICATIONS |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 410 | The following command line arguments make up a rule specification (as used |
| 411 | in the add and delete commands). A "!" option before the specification |
| 412 | inverts the test for that specification. Apart from these standard rule |
| 413 | specifications there are some other command line arguments of interest. |
| 414 | See both the |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 415 | .BR "MATCH EXTENSIONS" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 416 | and the |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 417 | .BR "WATCHER EXTENSIONS" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 418 | below. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 419 | .TP |
| 420 | .BR "-p, --protocol " "[!] \fIprotocol\fP" |
| 421 | The protocol that was responsible for creating the frame. This can be a |
| 422 | hexadecimal number, above |
| 423 | .IR 0x0600 , |
| 424 | a name (e.g. |
| 425 | .I ARP |
| 426 | ) or |
| 427 | .BR LENGTH . |
| 428 | The protocol field of the Ethernet frame can be used to denote the |
| 429 | length of the header (802.2/802.3 networks). When the value of that field is |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 430 | below or equals |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 431 | .IR 0x0600 , |
| 432 | the value equals the size of the header and shouldn't be used as a |
| 433 | protocol number. Instead, all frames where the protocol field is used as |
| 434 | the length field are assumed to be of the same 'protocol'. The protocol |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 435 | name used in ebtables for these frames is |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 436 | .BR LENGTH . |
| 437 | .br |
| 438 | The file |
| 439 | .B /etc/ethertypes |
| 440 | can be used to show readable |
| 441 | characters instead of hexadecimal numbers for the protocols. For example, |
| 442 | .I 0x0800 |
| 443 | will be represented by |
| 444 | .IR IPV4 . |
| 445 | The use of this file is not case sensitive. |
| 446 | See that file for more information. The flag |
| 447 | .B --proto |
| 448 | is an alias for this option. |
| 449 | .TP |
| 450 | .BR "-i, --in-interface " "[!] \fIname\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 451 | The interface (bridge port) via which a frame is received (this option is useful in the |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 452 | .BR INPUT , |
| 453 | .BR FORWARD , |
| 454 | .BR PREROUTING " and " BROUTING |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 455 | chains). If the interface name ends with '+', then |
| 456 | any interface name that begins with this name (disregarding '+') will match. |
| 457 | The flag |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 458 | .B --in-if |
| 459 | is an alias for this option. |
| 460 | .TP |
| 461 | .BR "--logical-in " "[!] \fIname\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 462 | The (logical) bridge interface via which a frame is received (this option is useful in the |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 463 | .BR INPUT , |
| 464 | .BR FORWARD , |
| 465 | .BR PREROUTING " and " BROUTING |
| 466 | chains). |
Bart De Schuymer | 37d520d | 2004-10-24 07:36:15 +0000 | [diff] [blame] | 467 | If the interface name ends with '+', then |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 468 | any interface name that begins with this name (disregarding '+') will match. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 469 | .TP |
| 470 | .BR "-o, --out-interface " "[!] \fIname\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 471 | The interface (bridge port) via which a frame is going to be sent (this option is useful in the |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 472 | .BR OUTPUT , |
| 473 | .B FORWARD |
| 474 | and |
| 475 | .B POSTROUTING |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 476 | chains). If the interface name ends with '+', then |
| 477 | any interface name that begins with this name (disregarding '+') will match. |
| 478 | The flag |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 479 | .B --out-if |
| 480 | is an alias for this option. |
| 481 | .TP |
| 482 | .BR "--logical-out " "[!] \fIname\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 483 | The (logical) bridge interface via which a frame is going to be sent (this option |
| 484 | is useful in the |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 485 | .BR OUTPUT , |
| 486 | .B FORWARD |
| 487 | and |
| 488 | .B POSTROUTING |
| 489 | chains). |
Bart De Schuymer | 37d520d | 2004-10-24 07:36:15 +0000 | [diff] [blame] | 490 | If the interface name ends with '+', then |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 491 | any interface name that begins with this name (disregarding '+') will match. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 492 | .TP |
| 493 | .BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 494 | The source MAC address. Both mask and address are written as 6 hexadecimal |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 495 | numbers separated by colons. Alternatively one can specify Unicast, |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 496 | Multicast, Broadcast or BGA (Bridge Group Address): |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 497 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 498 | .IR "Unicast" "=00:00:00:00:00:00/01:00:00:00:00:00," |
| 499 | .IR "Multicast" "=01:00:00:00:00:00/01:00:00:00:00:00," |
| 500 | .IR "Broadcast" "=ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff or" |
| 501 | .IR "BGA" "=01:80:c2:00:00:00/ff:ff:ff:ff:ff:ff." |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 502 | Note that a broadcast |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 503 | address will also match the multicast specification. The flag |
| 504 | .B --src |
| 505 | is an alias for this option. |
| 506 | .TP |
| 507 | .BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 508 | The destination MAC address. See |
| 509 | .B -s |
| 510 | (above) for more details on MAC addresses. The flag |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 511 | .B --dst |
| 512 | is an alias for this option. |
Bart De Schuymer | ab611e2 | 2005-02-14 20:20:03 +0000 | [diff] [blame] | 513 | .TP |
| 514 | .BR "-c, --set-counter " "\fIpcnt bcnt\fP" |
| 515 | If used with |
| 516 | .BR -A " or " -I ", then the packet and byte counters of the new rule will be set to |
| 517 | .IR pcnt ", resp. " bcnt ". |
| 518 | If used with the |
| 519 | .BR -C " or " -D " commands, only rules with a packet and byte count equal to" |
| 520 | .IR pcnt ", resp. " bcnt " will match." |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 521 | |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 522 | .SS MATCH EXTENSIONS |
| 523 | Ebtables extensions are dynamically loaded into the userspace tool, |
| 524 | there is therefore no need to explicitly load them with a |
| 525 | -m option like is done in iptables. |
| 526 | These extensions deal with functionality supported by kernel modules supplemental to |
| 527 | the core ebtables code. |
| 528 | .SS 802_3 |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 529 | Specify 802.3 DSAP/SSAP fields or SNAP type. The protocol must be specified as |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 530 | .IR "LENGTH " "(see the option " " -p " above). |
Bart De Schuymer | 7350b04 | 2003-06-24 19:53:19 +0000 | [diff] [blame] | 531 | .TP |
| 532 | .BR "--802_3-sap " "[!] \fIsap\fP" |
| 533 | DSAP and SSAP are two one byte 802.3 fields. The bytes are always |
| 534 | equal, so only one byte (hexadecimal) is needed as an argument. |
| 535 | .TP |
| 536 | .BR "--802_3-type " "[!] \fItype\fP" |
| 537 | If the 802.3 DSAP and SSAP values are 0xaa then the SNAP type field must |
| 538 | be consulted to determine the payload protocol. This is a two byte |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 539 | (hexadecimal) argument. Only 802.3 frames with DSAP/SSAP 0xaa are |
Bart De Schuymer | 7350b04 | 2003-06-24 19:53:19 +0000 | [diff] [blame] | 540 | checked for type. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 541 | .SS among |
Bart De Schuymer | 538f880 | 2004-12-05 14:46:55 +0000 | [diff] [blame] | 542 | Match a MAC address or MAC/IP address pair versus a list of MAC addresses |
| 543 | and MAC/IP address pairs. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 544 | A list entry has the following format: |
| 545 | .IR xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip][,] ". Multiple" |
Bart De Schuymer | 538f880 | 2004-12-05 14:46:55 +0000 | [diff] [blame] | 546 | list entries are separated by a comma, specifying an IP address corresponding to |
| 547 | the MAC address is optional. Multiple MAC/IP address pairs with the same MAC address |
| 548 | but different IP address (and vice versa) can be specified. If the MAC address doesn't |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 549 | match any entry from the list, the frame doesn't match the rule (unless "!" was used). |
Bart De Schuymer | 538f880 | 2004-12-05 14:46:55 +0000 | [diff] [blame] | 550 | .TP |
| 551 | .BR "--among-dst " "[!] \fIlist\fP" |
| 552 | Compare the MAC destination to the given list. If the Ethernet frame has type |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 553 | .IR IPv4 " or " ARP , |
Bart De Schuymer | 538f880 | 2004-12-05 14:46:55 +0000 | [diff] [blame] | 554 | then comparison with MAC/IP destination address pairs from the |
| 555 | list is possible. |
| 556 | .TP |
| 557 | .BR "--among-src " "[!] \fIlist\fP" |
| 558 | Compare the MAC source to the given list. If the Ethernet frame has type |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 559 | .IR IPv4 " or " ARP , |
Bart De Schuymer | 538f880 | 2004-12-05 14:46:55 +0000 | [diff] [blame] | 560 | then comparison with MAC/IP source address pairs from the list |
| 561 | is possible. |
Bart De Schuymer | 8069b5a | 2006-08-17 10:18:02 +0000 | [diff] [blame] | 562 | .TP |
| 563 | .BR "--among-dst-file " "[!] \fIfile\fP" |
| 564 | Same as |
| 565 | .BR --among-dst " but the list is read in from the specified file." |
| 566 | .TP |
| 567 | .BR "--among-src-file " "[!] \fIfile\fP" |
| 568 | Same as |
| 569 | .BR --among-src " but the list is read in from the specified file." |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 570 | .SS arp |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 571 | Specify (R)ARP fields. The protocol must be specified as |
| 572 | .IR ARP " or " RARP . |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 573 | .TP |
| 574 | .BR "--arp-opcode " "[!] \fIopcode\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 575 | The (R)ARP opcode (decimal or a string, for more details see |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 576 | .BR "ebtables -h arp" ). |
| 577 | .TP |
| 578 | .BR "--arp-htype " "[!] \fIhardware type\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 579 | The hardware type, this can be a decimal or the string |
| 580 | .I Ethernet |
| 581 | (which sets |
| 582 | .I type |
| 583 | to 1). Most (R)ARP packets have Eternet as hardware type. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 584 | .TP |
| 585 | .BR "--arp-ptype " "[!] \fIprotocol type\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 586 | The protocol type for which the (r)arp is used (hexadecimal or the string |
| 587 | .IR IPv4 , |
| 588 | denoting 0x0800). |
| 589 | Most (R)ARP packets have protocol type IPv4. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 590 | .TP |
| 591 | .BR "--arp-ip-src " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 592 | The (R)ARP IP source address specification. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 593 | .TP |
| 594 | .BR "--arp-ip-dst " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 595 | The (R)ARP IP destination address specification. |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 596 | .TP |
| 597 | .BR "--arp-mac-src " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 598 | The (R)ARP MAC source address specification. |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 599 | .TP |
| 600 | .BR "--arp-mac-dst " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 601 | The (R)ARP MAC destination address specification. |
Bart De Schuymer | 29d6211 | 2007-03-28 16:54:04 +0000 | [diff] [blame] | 602 | .TP |
| 603 | .BR "" "[!]" " --arp-gratuitous" |
| 604 | Checks for ARP gratuitous packets: checks equality of IPv4 source |
| 605 | address and IPv4 destination address inside the ARP header. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 606 | .SS ip |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 607 | Specify IPv4 fields. The protocol must be specified as |
| 608 | .IR IPv4 . |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 609 | .TP |
| 610 | .BR "--ip-source " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 611 | The source IP address. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 612 | The flag |
| 613 | .B --ip-src |
| 614 | is an alias for this option. |
| 615 | .TP |
| 616 | .BR "--ip-destination " "[!] \fIaddress\fP[/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 617 | The destination IP address. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 618 | The flag |
| 619 | .B --ip-dst |
| 620 | is an alias for this option. |
| 621 | .TP |
| 622 | .BR "--ip-tos " "[!] \fItos\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 623 | The IP type of service, in hexadecimal numbers. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 624 | .BR IPv4 . |
| 625 | .TP |
| 626 | .BR "--ip-protocol " "[!] \fIprotocol\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 627 | The IP protocol. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 628 | The flag |
| 629 | .B --ip-proto |
| 630 | is an alias for this option. |
Bart De Schuymer | 4883ba5 | 2002-09-19 21:10:45 +0000 | [diff] [blame] | 631 | .TP |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 632 | .BR "--ip-source-port " "[!] \fIport1\fP[:\fIport2\fP]" |
Bart De Schuymer | 1902d18 | 2006-01-23 19:02:18 +0000 | [diff] [blame] | 633 | The source port or port range for the IP protocols 6 (TCP), 17 |
| 634 | (UDP), 33 (DCCP) or 132 (SCTP). The |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 635 | .B --ip-protocol |
| 636 | option must be specified as |
Bart De Schuymer | 1902d18 | 2006-01-23 19:02:18 +0000 | [diff] [blame] | 637 | .IR TCP ", " UDP ", " DCCP " or " SCTP . |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 638 | If |
| 639 | .IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used." |
| 640 | The flag |
Bart De Schuymer | 4883ba5 | 2002-09-19 21:10:45 +0000 | [diff] [blame] | 641 | .B --ip-sport |
| 642 | is an alias for this option. |
| 643 | .TP |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 644 | .BR "--ip-destination-port " "[!] \fIport1\fP[:\fIport2\fP]" |
Bart De Schuymer | 1902d18 | 2006-01-23 19:02:18 +0000 | [diff] [blame] | 645 | The destination port or port range for ip protocols 6 (TCP), 17 |
| 646 | (UDP), 33 (DCCP) or 132 (SCTP). The |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 647 | .B --ip-protocol |
| 648 | option must be specified as |
Bart De Schuymer | 1902d18 | 2006-01-23 19:02:18 +0000 | [diff] [blame] | 649 | .IR TCP ", " UDP ", " DCCP " or " SCTP . |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 650 | If |
| 651 | .IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used." |
| 652 | The flag |
Bart De Schuymer | 4883ba5 | 2002-09-19 21:10:45 +0000 | [diff] [blame] | 653 | .B --ip-dport |
| 654 | is an alias for this option. |
Bart De Schuymer | 005837e | 2008-02-21 21:32:25 +0000 | [diff] [blame] | 655 | .SS ip6 |
| 656 | Specify IPv6 fields. The protocol must be specified as |
| 657 | .IR IPv6 . |
| 658 | .TP |
| 659 | .BR "--ip6-source " "[!] \fIaddress\fP[/\fImask\fP]" |
| 660 | The source IPv6 address. |
| 661 | The flag |
| 662 | .B --ip6-src |
| 663 | is an alias for this option. |
| 664 | .TP |
| 665 | .BR "--ip6-destination " "[!] \fIaddress\fP[/\fImask\fP]" |
| 666 | The destination IPv6 address. |
| 667 | The flag |
| 668 | .B --ip6-dst |
| 669 | is an alias for this option. |
| 670 | .TP |
| 671 | .BR "--ip6-tclass " "[!] \fItclass\fP" |
| 672 | The IPv6 traffic class, in hexadecimal numbers. |
| 673 | .TP |
| 674 | .BR "--ip6-protocol " "[!] \fIprotocol\fP" |
| 675 | The IP protocol. |
| 676 | The flag |
| 677 | .B --ip6-proto |
| 678 | is an alias for this option. |
| 679 | .TP |
| 680 | .BR "--ip6-source-port " "[!] \fIport1\fP[:\fIport2\fP]" |
| 681 | The source port or port range for the IPv6 protocols 6 (TCP), 17 |
| 682 | (UDP), 33 (DCCP) or 132 (SCTP). The |
| 683 | .B --ip6-protocol |
| 684 | option must be specified as |
| 685 | .IR TCP ", " UDP ", " DCCP " or " SCTP . |
| 686 | If |
| 687 | .IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used." |
| 688 | The flag |
| 689 | .B --ip6-sport |
| 690 | is an alias for this option. |
| 691 | .TP |
| 692 | .BR "--ip6-destination-port " "[!] \fIport1\fP[:\fIport2\fP]" |
| 693 | The destination port or port range for IPv6 protocols 6 (TCP), 17 |
| 694 | (UDP), 33 (DCCP) or 132 (SCTP). The |
| 695 | .B --ip6-protocol |
| 696 | option must be specified as |
| 697 | .IR TCP ", " UDP ", " DCCP " or " SCTP . |
| 698 | If |
| 699 | .IR port1 " is omitted, " 0:port2 " is used; if " port2 " is omitted but a colon is specified, " port1:65535 " is used." |
| 700 | The flag |
| 701 | .B --ip6-dport |
| 702 | is an alias for this option. |
Bart De Schuymer | 1b4ccfa | 2004-10-23 11:20:34 +0000 | [diff] [blame] | 703 | .SS limit |
| 704 | This module matches at a limited rate using a token bucket filter. |
| 705 | A rule using this extension will match until this limit is reached. |
| 706 | It can be used with the |
| 707 | .B --log |
Bart De Schuymer | 538f880 | 2004-12-05 14:46:55 +0000 | [diff] [blame] | 708 | watcher to give limited logging, for example. Its use is the same |
| 709 | as the limit match of iptables. |
Bart De Schuymer | 1b4ccfa | 2004-10-23 11:20:34 +0000 | [diff] [blame] | 710 | .TP |
| 711 | .BR "--limit " "[\fIvalue\fP]" |
| 712 | Maximum average matching rate: specified as a number, with an optional |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 713 | .IR /second ", " /minute ", " /hour ", or " /day " suffix; the default is " 3/hour . |
Bart De Schuymer | 1b4ccfa | 2004-10-23 11:20:34 +0000 | [diff] [blame] | 714 | .TP |
| 715 | .BR "--limit-burst " "[\fInumber\fP]" |
| 716 | Maximum initial number of packets to match: this number gets recharged by |
| 717 | one every time the limit specified above is not reached, up to this |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 718 | number; the default is |
| 719 | .IR 5 . |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 720 | .SS mark_m |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 721 | .TP |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 722 | .BR "--mark " "[!] [\fIvalue\fP][/\fImask\fP]" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 723 | Matches frames with the given unsigned mark value. If a |
| 724 | .IR value " and " mask " are specified, the logical AND of the mark value of the frame and" |
| 725 | the user-specified |
| 726 | .IR mask " is taken before comparing it with the" |
| 727 | user-specified mark |
| 728 | .IR value ". When only a mark " |
| 729 | .IR value " is specified, the packet" |
Bart De Schuymer | 8b0c58a | 2004-12-05 21:54:45 +0000 | [diff] [blame] | 730 | only matches when the mark value of the frame equals the user-specified |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 731 | mark |
| 732 | .IR value . |
| 733 | If only a |
| 734 | .IR mask " is specified, the logical" |
| 735 | AND of the mark value of the frame and the user-specified |
| 736 | .IR mask " is taken and the frame matches when the result of this logical AND is" |
| 737 | non-zero. Only specifying a |
| 738 | .IR mask " is useful to match multiple mark values." |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 739 | .SS pkttype |
| 740 | .TP |
| 741 | .BR "--pkttype-type " "[!] \fItype\fP" |
| 742 | Matches on the Ethernet "class" of the frame, which is determined by the |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 743 | generic networking code. Possible values: |
| 744 | .IR broadcast " (MAC destination is the broadcast address)," |
| 745 | .IR multicast " (MAC destination is a multicast address)," |
| 746 | .IR host " (MAC destination is the receiving network device), or " |
| 747 | .IR otherhost " (none of the above)." |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 748 | .SS stp |
| 749 | Specify stp BPDU (bridge protocol data unit) fields. The destination |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 750 | address |
| 751 | .BR "" ( -d ") must be specified as the bridge group address" |
| 752 | .IR "" ( BGA ). |
| 753 | For all options for which a range of values can be specified, it holds that |
| 754 | if the lower bound is omitted (but the colon is not), then the lowest possible lower bound |
| 755 | for that option is used, while if the upper bound is omitted (but the colon again is not), the |
| 756 | highest possible upper bound for that option is used. |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 757 | .TP |
| 758 | .BR "--stp-type " "[!] \fItype\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 759 | The BPDU type (0-255), recognized non-numerical types are |
| 760 | .IR config ", denoting a configuration BPDU (=0), and" |
| 761 | .IR tcn ", denothing a topology change notification BPDU (=128)." |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 762 | .TP |
| 763 | .BR "--stp-flags " "[!] \fIflag\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 764 | The BPDU flag (0-255), recognized non-numerical flags are |
| 765 | .IR topology-change ", denoting the topology change flag (=1), and" |
| 766 | .IR topology-change-ack ", denoting the topology change acknowledgement flag (=128)." |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 767 | .TP |
| 768 | .BR "--stp-root-prio " "[!] [\fIprio\fP][:\fIprio\fP]" |
| 769 | The root priority (0-65535) range. |
| 770 | .TP |
| 771 | .BR "--stp-root-addr " "[!] [\fIaddress\fP][/\fImask\fP]" |
| 772 | The root mac address, see the option |
| 773 | .BR -s " for more details." |
| 774 | .TP |
| 775 | .BR "--stp-root-cost " "[!] [\fIcost\fP][:\fIcost\fP]" |
| 776 | The root path cost (0-4294967295) range. |
| 777 | .TP |
| 778 | .BR "--stp-sender-prio " "[!] [\fIprio\fP][:\fIprio\fP]" |
| 779 | The BPDU's sender priority (0-65535) range. |
| 780 | .TP |
| 781 | .BR "--stp-sender-addr " "[!] [\fIaddress\fP][/\fImask\fP]" |
| 782 | The BPDU's sender mac address, see the option |
| 783 | .BR -s " for more details." |
| 784 | .TP |
| 785 | .BR "--stp-port " "[!] [\fIport\fP][:\fIport\fP]" |
| 786 | The port identifier (0-65535) range. |
| 787 | .TP |
| 788 | .BR "--stp-msg-age " "[!] [\fIage\fP][:\fIage\fP]" |
| 789 | The message age timer (0-65535) range. |
| 790 | .TP |
| 791 | .BR "--stp-max-age " "[!] [\fIage\fP][:\fIage\fP]" |
| 792 | The max age timer (0-65535) range. |
| 793 | .TP |
| 794 | .BR "--stp-hello-time " "[!] [\fItime\fP][:\fItime\fP]" |
| 795 | The hello time timer (0-65535) range. |
| 796 | .TP |
| 797 | .BR "--stp-forward-delay " "[!] [\fIdelay\fP][:\fIdelay\fP]" |
| 798 | The forward delay timer (0-65535) range. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 799 | .SS vlan |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 800 | Specify 802.1Q Tag Control Information fields. |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 801 | The protocol must be specified as |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 802 | .IR 802_1Q " (0x8100)." |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 803 | .TP |
| 804 | .BR "--vlan-id " "[!] \fIid\fP" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 805 | The VLAN identifier field (VID). Decimal number from 0 to 4095. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 806 | .TP |
| 807 | .BR "--vlan-prio " "[!] \fIprio\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 808 | The user priority field, a decimal number from 0 to 7. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 809 | The VID should be set to 0 ("null VID") or unspecified |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 810 | (in the latter case the VID is deliberately set to 0). |
fnm3 | f794d5a | 2002-06-14 17:28:13 +0000 | [diff] [blame] | 811 | .TP |
fnm3 | ed7e901 | 2002-06-25 16:43:23 +0000 | [diff] [blame] | 812 | .BR "--vlan-encap " "[!] \fItype\fP" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 813 | The encapsulated Ethernet frame type/length. |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 814 | Specified as a hexadecimal |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 815 | number from 0x0000 to 0xFFFF or as a symbolic name |
| 816 | from |
| 817 | .BR /etc/ethertypes . |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 818 | |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 819 | .SS WATCHER EXTENSIONS |
| 820 | Watchers only look at frames passing by, they don't modify them nor decide |
| 821 | to accept the frames or not. These watchers only |
| 822 | see the frame if the frame matches the rule, and they see it before the |
Bart De Schuymer | 61b4d72 | 2004-11-21 23:08:19 +0000 | [diff] [blame] | 823 | target is executed. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 824 | .SS log |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 825 | The log watcher writes descriptive data about a frame to the syslog. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 826 | .TP |
| 827 | .B "--log" |
| 828 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 829 | Log with the default loggin options: log-level= |
| 830 | .IR info , |
| 831 | log-prefix="", no ip logging, no arp logging. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 832 | .TP |
| 833 | .B --log-level "\fIlevel\fP" |
| 834 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 835 | Defines the logging level. For the possible values, see |
| 836 | .BR "ebtables -h log" . |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 837 | The default level is |
| 838 | .IR info . |
| 839 | .TP |
| 840 | .BR --log-prefix " \fItext\fP" |
| 841 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 842 | Defines the prefix |
| 843 | .I text |
| 844 | to be printed at the beginning of the line with the logging information. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 845 | .TP |
| 846 | .B --log-ip |
| 847 | .br |
Bart De Schuymer | 61b4d72 | 2004-11-21 23:08:19 +0000 | [diff] [blame] | 848 | Will log the ip information when a frame made by the ip protocol matches |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 849 | the rule. The default is no ip information logging. |
| 850 | .TP |
Bart De Schuymer | 005837e | 2008-02-21 21:32:25 +0000 | [diff] [blame] | 851 | .B --log-ip6 |
| 852 | .br |
| 853 | Will log the ipv6 information when a frame made by the ipv6 protocol matches |
| 854 | the rule. The default is no ipv6 information logging. |
| 855 | .TP |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 856 | .B --log-arp |
| 857 | .br |
Bart De Schuymer | 61b4d72 | 2004-11-21 23:08:19 +0000 | [diff] [blame] | 858 | Will log the (r)arp information when a frame made by the (r)arp protocols |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 859 | matches the rule. The default is no (r)arp information logging. |
Bart De Schuymer | 03e6000 | 2008-03-17 22:10:49 +0000 | [diff] [blame] | 860 | .SS nflog |
| 861 | The nflog watcher passes the packet to the loaded logging backend |
| 862 | in order to log the packet. This is usually used in combination with |
| 863 | nfnetlink_log as logging backend, which will multicast the packet |
| 864 | through a |
| 865 | .IR netlink |
| 866 | socket to the specified multicast group. One or more userspace processes |
| 867 | may subscribe to the group to receive the packets. |
| 868 | .TP |
| 869 | .B "--nflog" |
| 870 | .br |
| 871 | Log with the default logging options |
| 872 | .TP |
| 873 | .B --nflog-group "\fInlgroup\fP" |
| 874 | .br |
| 875 | The netlink group (1 - 2^32-1) to which packets are (only applicable for |
| 876 | nfnetlink_log). The default value is 1. |
| 877 | .TP |
| 878 | .B --nflog-prefix "\fIprefix\fP" |
| 879 | .br |
| 880 | A prefix string to include in the log message, up to 30 characters |
| 881 | long, useful for distinguishing messages in the logs. |
| 882 | .TP |
| 883 | .B --nflog-range "\fIsize\fP" |
| 884 | .br |
| 885 | The number of bytes to be copied to userspace (only applicable for |
| 886 | nfnetlink_log). nfnetlink_log instances may specify their own |
| 887 | range, this option overrides it. |
| 888 | .TP |
| 889 | .B --nflog-threshold "\fIsize\fP" |
| 890 | .br |
| 891 | Number of packets to queue inside the kernel before sending them |
| 892 | to userspace (only applicable for nfnetlink_log). Higher values |
| 893 | result in less overhead per packet, but increase delay until the |
| 894 | packets reach userspace. The default value is 1. |
Bart De Schuymer | 61b4d72 | 2004-11-21 23:08:19 +0000 | [diff] [blame] | 895 | .SS ulog |
| 896 | The ulog watcher passes the packet to a userspace |
| 897 | logging daemon using netlink multicast sockets. This differs |
| 898 | from the log watcher in the sense that the complete packet is |
| 899 | sent to userspace instead of a descriptive text and that |
| 900 | netlink multicast sockets are used instead of the syslog. |
| 901 | This watcher enables parsing of packets with userspace programs, the |
| 902 | physical bridge in and out ports are also included in the netlink messages. |
| 903 | The ulog watcher module accepts 2 parameters when the module is loaded |
| 904 | into the kernel (e.g. with modprobe): |
| 905 | .B nlbufsiz |
| 906 | specifies how big the buffer for each netlink multicast |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 907 | group is. If you say |
| 908 | .IR nlbufsiz=8192 , |
| 909 | for example, up to eight kB of packets will |
Bart De Schuymer | 61b4d72 | 2004-11-21 23:08:19 +0000 | [diff] [blame] | 910 | get accumulated in the kernel until they are sent to userspace. It is |
| 911 | not possible to allocate more than 128kB. Please also keep in mind that |
| 912 | this buffer size is allocated for each nlgroup you are using, so the |
| 913 | total kernel memory usage increases by that factor. The default is 4096. |
| 914 | .B flushtimeout |
| 915 | specifies after how many hundredths of a second the queue should be |
| 916 | flushed, even if it is not full yet. The default is 10 (one tenth of |
| 917 | a second). |
| 918 | .TP |
| 919 | .B "--ulog" |
| 920 | .br |
| 921 | Use the default settings: ulog-prefix="", ulog-nlgroup=1, |
| 922 | ulog-cprange=4096, ulog-qthreshold=1. |
| 923 | .TP |
| 924 | .B --ulog-prefix "\fItext\fP" |
| 925 | .br |
| 926 | Defines the prefix included with the packets sent to userspace. |
| 927 | .TP |
| 928 | .BR --ulog-nlgroup " \fIgroup\fP" |
| 929 | .br |
| 930 | Defines which netlink group number to use (a number from 1 to 32). |
| 931 | Make sure the netlink group numbers used for the iptables ULOG |
| 932 | target differ from those used for the ebtables ulog watcher. |
| 933 | The default group number is 1. |
| 934 | .TP |
| 935 | .BR --ulog-cprange " \fIrange\fP" |
| 936 | .br |
| 937 | Defines the maximum copy range to userspace, for packets matching the |
| 938 | rule. The default range is 0, which means the maximum copy range is |
| 939 | given by |
| 940 | .BR nlbufsiz . |
| 941 | A maximum copy range larger than |
| 942 | 128*1024 is meaningless as the packets sent to userspace have an upper |
| 943 | size limit of 128*1024. |
| 944 | .TP |
| 945 | .BR --ulog-qthreshold " \fIthreshold\fP" |
| 946 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 947 | Queue at most |
| 948 | .I threshold |
| 949 | number of packets before sending them to |
Bart De Schuymer | 61b4d72 | 2004-11-21 23:08:19 +0000 | [diff] [blame] | 950 | userspace with a netlink socket. Note that packets can be sent to |
| 951 | userspace before the queue is full, this happens when the ulog |
| 952 | kernel timer goes off (the frequency of this timer depends on |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 953 | .BR flushtimeout ). |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 954 | .SS TARGET EXTENSIONS |
Bart De Schuymer | 4cd1da6 | 2006-01-23 19:51:30 +0000 | [diff] [blame] | 955 | .SS arpreply |
Bart De Schuymer | 3a339f2 | 2003-08-14 19:33:11 +0000 | [diff] [blame] | 956 | The |
| 957 | .B arpreply |
| 958 | target can be used in the |
| 959 | .BR PREROUTING " chain of the " nat " table." |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 960 | If this target sees an ARP request it will automatically reply |
| 961 | with an ARP reply. The used MAC address for the reply can be specified. |
| 962 | The protocol must be specified as |
| 963 | .IR ARP . |
| 964 | When the ARP message is not an ARP request or when the ARP request isn't |
| 965 | for an IP address on an Ethernet network, it is ignored by this target |
| 966 | .BR "" ( CONTINUE ). |
| 967 | When the ARP request is malformed, it is dropped |
| 968 | .BR "" ( DROP ). |
Bart De Schuymer | 3a339f2 | 2003-08-14 19:33:11 +0000 | [diff] [blame] | 969 | .TP |
| 970 | .BR "--arpreply-mac " "\fIaddress\fP" |
| 971 | Specifies the MAC address to reply with: the Ethernet source MAC and the |
| 972 | ARP payload source MAC will be filled in with this address. |
| 973 | .TP |
| 974 | .BR "--arpreply-target " "\fItarget\fP" |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 975 | Specifies the standard target. After sending the ARP reply, the rule still |
| 976 | has to give a standard target so ebtables knows what to do with the ARP request. |
| 977 | The default target |
| 978 | .BR "" "is " DROP . |
Bart De Schuymer | 4cd1da6 | 2006-01-23 19:51:30 +0000 | [diff] [blame] | 979 | .SS dnat |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 980 | The |
| 981 | .B dnat |
| 982 | target can only be used in the |
| 983 | .BR BROUTING " chain of the " broute " table and the " |
| 984 | .BR PREROUTING " and " OUTPUT " chains of the " nat " table." |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 985 | It specifies that the destination MAC address has to be changed. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 986 | .TP |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 987 | .BR "--to-destination " "\fIaddress\fP" |
| 988 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 989 | Change the destination MAC address to the specified |
| 990 | .IR address . |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 991 | The flag |
| 992 | .B --to-dst |
| 993 | is an alias for this option. |
| 994 | .TP |
| 995 | .BR "--dnat-target " "\fItarget\fP" |
| 996 | .br |
| 997 | Specifies the standard target. After doing the dnat, the rule still has to |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 998 | give a standard target so ebtables knows what to do with the dnated frame. |
| 999 | The default target is |
| 1000 | .BR ACCEPT . |
| 1001 | Making it |
| 1002 | .BR CONTINUE " could let you use" |
| 1003 | multiple target extensions on the same frame. Making it |
| 1004 | .BR DROP " only makes" |
| 1005 | sense in the |
| 1006 | .BR BROUTING " chain but using the " redirect " target is more logical there. " RETURN " is also allowed. Note that using " RETURN |
| 1007 | in a base chain is not allowed (for obvious reasons). |
Bart De Schuymer | 4cd1da6 | 2006-01-23 19:51:30 +0000 | [diff] [blame] | 1008 | .SS mark |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1009 | .BR "" "The " mark " target can be used in every chain of every table. It is possible" |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1010 | to use the marking of a frame/packet in both ebtables and iptables, |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1011 | if the bridge-nf code is compiled into the kernel. Both put the marking at the |
| 1012 | same place. This allows for a form of communication between ebtables and iptables. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1013 | .TP |
Bart De Schuymer | 8b0c58a | 2004-12-05 21:54:45 +0000 | [diff] [blame] | 1014 | .BR "--mark-set " "\fIvalue\fP" |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1015 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1016 | Mark the frame with the specified non-negative |
| 1017 | .IR value . |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1018 | .TP |
Bart De Schuymer | 4546270 | 2006-10-03 10:04:46 +0000 | [diff] [blame] | 1019 | .BR "--mark-or " "\fIvalue\fP" |
| 1020 | .br |
| 1021 | Or the frame with the specified non-negative |
| 1022 | .IR value . |
| 1023 | .TP |
| 1024 | .BR "--mark-and " "\fIvalue\fP" |
| 1025 | .br |
| 1026 | And the frame with the specified non-negative |
| 1027 | .IR value . |
| 1028 | .TP |
| 1029 | .BR "--mark-xor " "\fIvalue\fP" |
| 1030 | .br |
| 1031 | Xor the frame with the specified non-negative |
| 1032 | .IR value . |
| 1033 | .TP |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1034 | .BR "--mark-target " "\fItarget\fP" |
| 1035 | .br |
| 1036 | Specifies the standard target. After marking the frame, the rule |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1037 | still has to give a standard target so ebtables knows what to do. |
| 1038 | The default target is |
| 1039 | .BR ACCEPT ". Making it " CONTINUE " can let you do other" |
| 1040 | things with the frame in subsequent rules of the chain. |
Bart De Schuymer | 4cd1da6 | 2006-01-23 19:51:30 +0000 | [diff] [blame] | 1041 | .SS redirect |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1042 | The |
| 1043 | .B redirect |
| 1044 | target will change the MAC target address to that of the bridge device the |
| 1045 | frame arrived on. This target can only be used in the |
| 1046 | .BR BROUTING " chain of the " broute " table and the " |
| 1047 | .BR PREROUTING " chain of the " nat " table." |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1048 | In the |
| 1049 | .BR BROUTING " chain, the MAC address of the bridge port is used as destination address," |
| 1050 | .BR "" "in the " PREROUTING " chain, the MAC address of the bridge is used." |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1051 | .TP |
| 1052 | .BR "--redirect-target " "\fItarget\fP" |
| 1053 | .br |
| 1054 | Specifies the standard target. After doing the MAC redirect, the rule |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1055 | still has to give a standard target so ebtables knows what to do. |
| 1056 | The default target is |
| 1057 | .BR ACCEPT ". Making it " CONTINUE " could let you use" |
| 1058 | multiple target extensions on the same frame. Making it |
| 1059 | .BR DROP " in the " BROUTING " chain will let the frames be routed. " RETURN " is also allowed. Note" |
| 1060 | .BR "" "that using " RETURN " in a base chain is not allowed." |
Bart De Schuymer | 4cd1da6 | 2006-01-23 19:51:30 +0000 | [diff] [blame] | 1061 | .SS snat |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1062 | The |
| 1063 | .B snat |
| 1064 | target can only be used in the |
| 1065 | .BR POSTROUTING " chain of the " nat " table." |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1066 | It specifies that the source MAC address has to be changed. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1067 | .TP |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1068 | .BR "--to-source " "\fIaddress\fP" |
| 1069 | .br |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1070 | Changes the source MAC address to the specified |
| 1071 | .IR address ". The flag" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1072 | .B --to-src |
| 1073 | is an alias for this option. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 1074 | .TP |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1075 | .BR "--snat-target " "\fItarget\fP" |
| 1076 | .br |
| 1077 | Specifies the standard target. After doing the snat, the rule still has |
Bart De Schuymer | 00bbac8 | 2004-12-21 20:29:12 +0000 | [diff] [blame] | 1078 | to give a standard target so ebtables knows what to do. |
| 1079 | .BR "" "The default target is " ACCEPT ". Making it " CONTINUE " could let you use" |
| 1080 | .BR "" "multiple target extensions on the same frame. Making it " DROP " doesn't" |
| 1081 | .BR "" "make sense, but you could do that too. " RETURN " is also allowed. Note" |
| 1082 | .BR "" "that using " RETURN " in a base chain is not allowed." |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 1083 | .br |
Bart De Schuymer | 592d565 | 2006-12-15 11:36:30 +0000 | [diff] [blame] | 1084 | .TP |
| 1085 | .BR "--snat-arp " |
| 1086 | .br |
| 1087 | Also change the hardware source address inside the arp header if the packet is an |
| 1088 | arp message and the hardware address length in the arp header is 6 bytes. |
| 1089 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1090 | .SH FILES |
| 1091 | .I /etc/ethertypes |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 1092 | .SH ENVIRONMENT VARIABLES |
| 1093 | .I EBTABLES_ATOMIC_FILE |
Bart De Schuymer | 3006c8c | 2003-03-15 17:07:44 +0000 | [diff] [blame] | 1094 | .SH MAILINGLISTS |
| 1095 | .I ebtables-user@lists.sourceforge.net |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 1096 | .br |
Bart De Schuymer | 3006c8c | 2003-03-15 17:07:44 +0000 | [diff] [blame] | 1097 | .I ebtables-devel@lists.sourceforge.net |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1098 | .SH SEE ALSO |
Bart De Schuymer | 3006c8c | 2003-03-15 17:07:44 +0000 | [diff] [blame] | 1099 | .BR iptables "(8), " brctl "(8), " ifconfig "(8), " route (8) |