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