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