Bart De Schuymer | 1e9aca9 | 2003-11-09 21:18:26 +0000 | [diff] [blame] | 1 | .TH EBTABLES 8 "09 November 2003" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 2 | .\" |
Bart De Schuymer | 03aa2d6 | 2003-11-09 21:16:50 +0000 | [diff] [blame] | 3 | .\" Man page written and maintained 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 | 63e2c70 | 2002-08-01 15:30:15 +0000 | [diff] [blame] | 27 | ebtables (v.2.0) \- Ethernet bridge frame table administration |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 28 | .SH SYNOPSIS |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +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 | 637ecd2 | 2003-07-13 18:53:50 +0000 | [diff] [blame] | 39 | .BR "ebtables " [ "-t table" ] " -N chain" |
| 40 | .br |
| 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 | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +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 | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 51 | .BR "ebtables " [ "-t table" "] [" "--atomic-file file" ] " --atomic-save" |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 52 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 53 | .SH DESCRIPTION |
| 54 | .B ebtables |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 55 | is a user space tool, it is used to set up and maintain the |
| 56 | tables of Ethernet frame rules in the Linux kernel. These rules inspect |
| 57 | the Ethernet frames which they see. |
| 58 | .B ebtables |
| 59 | is analogous to the |
| 60 | .B iptables |
| 61 | user space tool, but |
| 62 | .B ebtables |
| 63 | is less complicated. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 64 | |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 65 | .SS CHAINS |
| 66 | There are three Ethernet frame tables with built-in chains in the |
| 67 | Linux kernel. The kernel tables are used to divide functionality into |
| 68 | different sets of rules. Each set of rules is called a chain. |
| 69 | Each chain is an ordered list of rules that can match Ethernet frames. If a |
| 70 | rule matches an Ethernet frame, then a processing specification tells |
| 71 | what to do with that matching frame. The processing specification is |
| 72 | called a 'target'. However, if the frame does not match the current |
| 73 | rule in the chain, then the next rule in the chain is examined and so forth. |
| 74 | The user can create new (user-defined) chains which can be used as the 'target' of a rule. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 75 | |
| 76 | .SS TARGETS |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 77 | A firewall rule specifies criteria for an Ethernet frame and a frame |
| 78 | processing specification called a target. When a frame matches a rule, |
| 79 | then the next action performed by the kernel is specified by the target. |
| 80 | The target can be one of these values: |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 81 | .IR ACCEPT , |
| 82 | .IR DROP , |
| 83 | .IR CONTINUE , |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 84 | .IR RETURN , |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 85 | an 'extension' (see below) or a user-defined chain. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 86 | .PP |
| 87 | .I ACCEPT |
| 88 | means to let the frame through. |
| 89 | .I DROP |
| 90 | means the frame has to be dropped. |
| 91 | .I CONTINUE |
| 92 | means the next rule has to be checked. This can be handy to know how many |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 93 | frames pass a certain point in the chain or to log those frames. |
| 94 | .I RETURN |
| 95 | means stop traversing this chain and resume at the next rule in the |
| 96 | previous (calling) chain. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 97 | For the extension targets please see 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 | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 101 | As stated earlier, there are three Ethernet frame tables in the Linux |
| 102 | kernel. The tables are |
| 103 | .BR filter ", " nat " and " broute . |
| 104 | Of these three tables, |
| 105 | the filter table is the default table that the |
| 106 | .B ebtables |
| 107 | command operates on. |
| 108 | If you are working with the filter table, then you can drop the '-t filter' |
| 109 | argument to the ebtables command. However, you will need to provide |
| 110 | the -t argument for the other two tables. The -t argument must be the |
| 111 | first argument on the ebtables command line, if used. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 112 | .TP |
| 113 | .B "-t, --table" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 114 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 115 | .BR filter , |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 116 | is the default table and contains three built-in chains: |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 117 | .B INPUT |
| 118 | (for frames destined for the bridge itself), |
| 119 | .B OUTPUT |
| 120 | (for locally-generated frames) and |
| 121 | .B FORWARD |
| 122 | (for frames being bridged). |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 123 | .br |
| 124 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 125 | .BR nat , |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 126 | is 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] | 127 | .B PREROUTING |
| 128 | (for altering frames as soon as they come in), |
| 129 | .B OUTPUT |
| 130 | (for altering locally generated frames before they are bridged) and |
| 131 | .B POSTROUTING |
| 132 | (for altering frames as they are about to go out). A small note on the naming |
| 133 | of chains POSTROUTING and PREROUTING: it would be more accurate to call them |
| 134 | PREFORWARDING and POSTFORWARDING, but for all those who come from the |
| 135 | .BR iptables " world to " ebtables |
| 136 | it is easier to have the same names. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 137 | .br |
| 138 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 139 | .BR 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 | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 144 | have special meaning in the broute table. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 145 | .B DROP |
| 146 | actually means the frame has to be routed, while |
| 147 | .B ACCEPT |
| 148 | means the frame has to be bridged. The |
| 149 | .B BROUTING |
| 150 | chain is traversed very early. It is only traversed by frames entering on |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 151 | a bridge enslaved NIC that is in forwarding state. Normally those frames |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 152 | would be bridged, but you can decide otherwise here. The |
| 153 | .B redirect |
| 154 | target is very handy here. |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 155 | .SH EBTABLES COMMAND LINE ARGUMENTS |
| 156 | After the initial ebtables -t, table command line argument, the remaining |
| 157 | arguments can be divided into several different groups. These groups |
| 158 | are commands, miscellaneous commands, rule-specifications, match-extensions, |
| 159 | and watcher-extensions. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 160 | .SS COMMANDS |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 161 | The ebtables command arguments specify the actions to perform on the table |
| 162 | defined with the -t argument. If you do not use the -t argument to name |
| 163 | a table, the commands apply to the default filter table. |
| 164 | With the exception of both the |
| 165 | .B "-Z" |
| 166 | and |
| 167 | .B "--atomic-file" |
| 168 | commands, only one command may be used on the command line at a time. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 169 | .TP |
| 170 | .B "-A, --append" |
| 171 | Append a rule to the end of the selected chain. |
| 172 | .TP |
| 173 | .B "-D, --delete" |
Bart De Schuymer | abc8417 | 2002-11-06 21:02:33 +0000 | [diff] [blame] | 174 | Delete the specified rule from the selected chain. There are two ways to |
| 175 | use this command. The first is by specifying an interval of rule numbers |
Bart De Schuymer | 6a3af1d | 2003-04-17 17:16:58 +0000 | [diff] [blame] | 176 | to delete, syntax: start_nr[:end_nr]. Using negative numbers is allowed, for more |
| 177 | details about using negative numbers, see the -I command. The second usage is by |
| 178 | specifying the complete rule as it would have been specified when it was added. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 179 | .TP |
| 180 | .B "-I, --insert" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 181 | Insert the specified rule into the selected chain at the specified rule number. |
Bart De Schuymer | 6a3af1d | 2003-04-17 17:16:58 +0000 | [diff] [blame] | 182 | If the current number of rules equals N, then the specified number can be |
| 183 | between -N and N+1. For a positive number i, it holds that i and i-N-1 specify the |
| 184 | same place in the chain where the rule should be inserted. The number 0 specifies |
| 185 | the place past the last rule in the chain and using this number is therefore |
| 186 | equivalent with using the -A command. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 187 | .TP |
| 188 | .B "-P, --policy" |
Bart De Schuymer | efc3c86 | 2002-12-07 11:36:47 +0000 | [diff] [blame] | 189 | Set the policy for the chain to the given target. The policy can be |
| 190 | .BR ACCEPT ", " DROP " or " RETURN . |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 191 | .TP |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 192 | .B "-F, --flush" |
| 193 | Flush the selected chain. If no chain is selected, then every chain will be |
| 194 | flushed. Flushing the chain does not change the policy of the |
| 195 | chain, however. |
| 196 | .TP |
| 197 | .B "-Z, --zero" |
| 198 | Set the counters of the selected chain to zero. If no chain is selected, all the counters |
| 199 | are set to zero. The |
| 200 | .B "-Z" |
| 201 | command can be used in conjunction with the |
| 202 | .B "-L" |
| 203 | command. |
| 204 | When both the |
| 205 | .B "-Z" |
| 206 | and |
| 207 | .B "-L" |
| 208 | commands are used together in this way, the rule counters are printed on the screen |
| 209 | before they are set to zero. |
| 210 | .TP |
| 211 | .B "-L, --list" |
| 212 | List all rules in the selected chain. If no chain is selected, all chains |
| 213 | are listed. |
| 214 | .br |
| 215 | The following three options change the output of the |
| 216 | .B "-L" |
| 217 | list command: |
| 218 | .br |
| 219 | .B "--Ln" |
| 220 | .br |
| 221 | Places the rule number in front of every rule. |
| 222 | .br |
| 223 | .B "--Lc" |
| 224 | .br |
| 225 | Shows the counters at the end of each rule displayed by the |
| 226 | .B "-L" |
| 227 | command. Both a frame counter (pcnt) and a byte counter (bcnt) are displayed. |
| 228 | .br |
| 229 | .B "--Lx" |
| 230 | .br |
| 231 | The output of the |
| 232 | .B "--Lx" |
| 233 | option may be used to create a set of |
| 234 | .B ebtables |
| 235 | commands. You may use this set of commands in an |
| 236 | .B ebtables |
| 237 | boot or reload |
| 238 | script. For example the output could be used at system startup. |
| 239 | The |
| 240 | .B "--Lx" |
| 241 | option is incompatible with both of the other |
| 242 | .B "--Ln" |
| 243 | and |
| 244 | .B "--Lc" |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 245 | chain listing options. |
| 246 | .br |
| 247 | .B "--Lmac2" |
| 248 | .br |
| 249 | Shows all MAC addresses with the same length, adding leading zeroes |
| 250 | if necessary. The default representation omits zeroes in the addresses |
| 251 | when they are not needed. |
| 252 | .br |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 253 | All necessary |
| 254 | .B ebtables |
| 255 | commands for making the current list of |
| 256 | user-defined chains in the kernel and any commands issued by the user to |
| 257 | rename the standard |
| 258 | .B ebtables |
| 259 | chains will be listed, when no chain name is |
| 260 | supplied for the |
| 261 | .B "-L" |
| 262 | command while using the |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 263 | .B "--Lx" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 264 | option. |
| 265 | .TP |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 266 | .B "-N, --new-chain" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 267 | Create a new user-defined chain with the given name. The number of |
| 268 | user-defined chains is unlimited. A user-defined chain name has maximum |
| 269 | length of 31 characters. |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 270 | .TP |
| 271 | .B "-X, --delete-chain" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 272 | Delete the specified user-defined chain. There must be no remaining references |
Bart De Schuymer | 637ecd2 | 2003-07-13 18:53:50 +0000 | [diff] [blame] | 273 | to the specified chain, otherwise |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 274 | .B ebtables |
Bart De Schuymer | 637ecd2 | 2003-07-13 18:53:50 +0000 | [diff] [blame] | 275 | will refuse to delete it. If no chain is specified, all user-defined |
| 276 | chains that aren't referenced will be removed. |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 277 | .TP |
| 278 | .B "-E, --rename-chain" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 279 | Rename the specified chain to a new name. Besides renaming a user-defined |
| 280 | chain, you may rename a standard chain name to a name that suits your |
| 281 | taste. For example, if you like PREBRIDGING more than PREROUTING, |
| 282 | then you can use the -E command to rename the PREROUTING chain. If you do |
| 283 | rename one of the standard |
| 284 | .B ebtables |
| 285 | chain names, please be sure to mention |
| 286 | this fact should you post a question on the |
| 287 | .B ebtables |
| 288 | mailing lists. |
| 289 | It would be wise to use the standard name in your post. Renaming a standard |
| 290 | .B ebtables |
| 291 | chain in this fashion has no effect on the structure or function |
| 292 | of the |
| 293 | .B ebtables |
| 294 | kernel table. |
| 295 | .TP |
| 296 | .B "--init-table" |
| 297 | Replace the current table data by the initial table data. |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 298 | .TP |
| 299 | .B "--atomic-init" |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 300 | 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] | 301 | 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] | 302 | to the file. The file can be specified using the |
| 303 | .B --atomic-file |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 304 | command or through the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 305 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 306 | .TP |
| 307 | .B "--atomic-save" |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 308 | 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] | 309 | 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] | 310 | to the file. The file can be specified using the |
| 311 | .B --atomic-file |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 312 | command or through the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 313 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 314 | .TP |
| 315 | .B "--atomic-commit" |
| 316 | 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] | 317 | 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] | 318 | 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] | 319 | time and allowing atomic updates of the tables. The file which contains |
| 320 | the table data is constructed by using either the |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 321 | .B "--atomic-init" |
| 322 | or the |
| 323 | .B "--atomic-save" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 324 | command to generate a starting file. After that, using the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 325 | .B "--atomic-file" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 326 | command when constructing rules or setting the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 327 | .IR EBTABLES_ATOMIC_FILE " environment variable" |
| 328 | allows you to extend the file and build the complete table before |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 329 | committing it to the kernel. |
| 330 | .TP |
| 331 | .B "--atomic-file -Z" |
| 332 | The counters stored in a file with, say, |
| 333 | .B "--atomic-init" |
| 334 | can be optionally zeroed by supplying the |
| 335 | .B "-Z" |
| 336 | command. You may also zero the counters by setting the |
| 337 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
| 338 | |
| 339 | .SS MISCELLANOUS COMMANDS |
| 340 | .TP |
| 341 | .B "-V, --version" |
| 342 | Show the version of the ebtables userspace program. |
| 343 | .TP |
| 344 | .B "-h, --help" |
| 345 | Give a brief description of the command syntax. Here you can also specify |
| 346 | names of extensions and |
| 347 | .B ebtables |
| 348 | will try to write help about those extensions. E.g. ebtables -h snat log ip arp. |
| 349 | Specify |
| 350 | .I list_extensions |
| 351 | to list all extensions supported by the userspace |
| 352 | utility. |
| 353 | .TP |
| 354 | .BR "-j, --jump " "\fItarget\fP" |
| 355 | The target of the rule. This is one of the following values: |
| 356 | .BR ACCEPT , |
| 357 | .BR DROP , |
| 358 | .BR CONTINUE , |
| 359 | .BR RETURN , |
| 360 | a target extension (see |
| 361 | .BR "TARGET EXTENSIONS" ")" |
| 362 | or a user-defined chain name. |
| 363 | .TP |
| 364 | .B --atomic-file file |
| 365 | Let the command operate on the specified file. The data of the table to |
| 366 | operate on will be extracted from the file and the result of the operation |
| 367 | will be saved back into the file. If specified, this option should come |
| 368 | before the command specification. An alternative that should be preferred, |
| 369 | is setting the |
| 370 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
| 371 | .TP |
| 372 | .B -M, --modprobe program |
| 373 | When talking to the kernel, use this program to try to automatically load |
| 374 | missing kernel modules. |
| 375 | |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 376 | .SS |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 377 | RULE-SPECIFICATIONS |
| 378 | The following command line arguments make up a rule specification (as used |
| 379 | in the add and delete commands). A "!" option before the specification |
| 380 | inverts the test for that specification. Apart from these standard rule |
| 381 | specifications there are some other command line arguments of interest. |
| 382 | See both the |
| 383 | .BR "MATCH-EXTENSIONS" |
| 384 | and the |
| 385 | .BR "WATCHER-EXTENSION(S)" |
| 386 | below. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 387 | .TP |
| 388 | .BR "-p, --protocol " "[!] \fIprotocol\fP" |
| 389 | The protocol that was responsible for creating the frame. This can be a |
| 390 | hexadecimal number, above |
| 391 | .IR 0x0600 , |
| 392 | a name (e.g. |
| 393 | .I ARP |
| 394 | ) or |
| 395 | .BR LENGTH . |
| 396 | The protocol field of the Ethernet frame can be used to denote the |
| 397 | length of the header (802.2/802.3 networks). When the value of that field is |
| 398 | below (or equals) |
| 399 | .IR 0x0600 , |
| 400 | the value equals the size of the header and shouldn't be used as a |
| 401 | protocol number. Instead, all frames where the protocol field is used as |
| 402 | the length field are assumed to be of the same 'protocol'. The protocol |
| 403 | name used in |
| 404 | .B ebtables |
| 405 | for these frames is |
| 406 | .BR LENGTH . |
| 407 | .br |
| 408 | The file |
| 409 | .B /etc/ethertypes |
| 410 | can be used to show readable |
| 411 | characters instead of hexadecimal numbers for the protocols. For example, |
| 412 | .I 0x0800 |
| 413 | will be represented by |
| 414 | .IR IPV4 . |
| 415 | The use of this file is not case sensitive. |
| 416 | See that file for more information. The flag |
| 417 | .B --proto |
| 418 | is an alias for this option. |
| 419 | .TP |
| 420 | .BR "-i, --in-interface " "[!] \fIname\fP" |
| 421 | The interface via which a frame is received (for the |
| 422 | .BR INPUT , |
| 423 | .BR FORWARD , |
| 424 | .BR PREROUTING " and " BROUTING |
| 425 | chains). The flag |
| 426 | .B --in-if |
| 427 | is an alias for this option. |
| 428 | .TP |
| 429 | .BR "--logical-in " "[!] \fIname\fP" |
| 430 | The (logical) bridge interface via which a frame is received (for the |
| 431 | .BR INPUT , |
| 432 | .BR FORWARD , |
| 433 | .BR PREROUTING " and " BROUTING |
| 434 | chains). |
| 435 | .TP |
| 436 | .BR "-o, --out-interface " "[!] \fIname\fP" |
| 437 | The interface via which a frame is going to be sent (for the |
| 438 | .BR OUTPUT , |
| 439 | .B FORWARD |
| 440 | and |
| 441 | .B POSTROUTING |
| 442 | chains). The flag |
| 443 | .B --out-if |
| 444 | is an alias for this option. |
| 445 | .TP |
| 446 | .BR "--logical-out " "[!] \fIname\fP" |
| 447 | The (logical) bridge interface via which a frame is going to be sent (for |
| 448 | the |
| 449 | .BR OUTPUT , |
| 450 | .B FORWARD |
| 451 | and |
| 452 | .B POSTROUTING |
| 453 | chains). |
| 454 | .TP |
| 455 | .BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]" |
| 456 | 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] | 457 | numbers separated by colons. Alternatively one can specify Unicast, |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 458 | Multicast, Broadcast or BGA (Bridge Group Address). |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 459 | .br |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 460 | .BR "Unicast " "= 00:00:00:00:00:00/01:00:00:00:00:00," |
| 461 | .BR "Multicast " "= 01:00:00:00:00:00/01:00:00:00:00:00," |
| 462 | .BR "Broadcast " "= ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff or" |
| 463 | .BR "BGA " "= 01:80:c2:00:00:00/ff:ff:ff:ff:ff:ff." |
| 464 | Note that a broadcast |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 465 | address will also match the multicast specification. The flag |
| 466 | .B --src |
| 467 | is an alias for this option. |
| 468 | .TP |
| 469 | .BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]" |
| 470 | The destination mac address. See -s (above) for more details. The flag |
| 471 | .B --dst |
| 472 | is an alias for this option. |
| 473 | |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 474 | .SS MATCH-EXTENSIONS |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 475 | .B ebtables |
| 476 | extensions are precompiled into the userspace tool. So there is no need |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 477 | to explicitly load them with a -m option like in |
| 478 | .BR iptables . |
| 479 | However, these |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 480 | extensions deal with functionality supported by supplemental kernel modules. |
Bart De Schuymer | 7350b04 | 2003-06-24 19:53:19 +0000 | [diff] [blame] | 481 | .SS 802.3 |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 482 | Specify 802.3 DSAP/SSAP fields or SNAP type. The protocol must be specified as |
Bart De Schuymer | 7350b04 | 2003-06-24 19:53:19 +0000 | [diff] [blame] | 483 | .BR "LENGTH " (see " protocol " above). |
| 484 | .TP |
| 485 | .BR "--802_3-sap " "[!] \fIsap\fP" |
| 486 | DSAP and SSAP are two one byte 802.3 fields. The bytes are always |
| 487 | equal, so only one byte (hexadecimal) is needed as an argument. |
| 488 | .TP |
| 489 | .BR "--802_3-type " "[!] \fItype\fP" |
| 490 | If the 802.3 DSAP and SSAP values are 0xaa then the SNAP type field must |
| 491 | 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] | 492 | (hexadecimal) argument. Only 802.3 frames with DSAP/SSAP 0xaa are |
Bart De Schuymer | 7350b04 | 2003-06-24 19:53:19 +0000 | [diff] [blame] | 493 | checked for type. |
Bart De Schuymer | a87790b | 2003-10-12 14:59:29 +0000 | [diff] [blame] | 494 | .SS among |
| 495 | Match a MAC address or MAC/IP address pair versus a list of MAC addresses |
| 496 | and MAC/IP address pairs. |
| 497 | A list entry has the following format: xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip][,]. Multiple |
| 498 | list entries are separated by a comma, specifying an IP address corresponding to |
| 499 | the MAC address is optional. Multiple MAC/IP address pairs with the same MAC address |
| 500 | but different IP address (and vice versa) can be specified. If the MAC address doesn't |
| 501 | match any entry from the list, the frame doesn't match the rule (unless '!' was used). |
| 502 | .TP |
| 503 | .BR "--among-dst " "[!] \fIlist\fP" |
| 504 | Compare the MAC destination to the given list. If the Ethernet frame has type |
| 505 | .BR IPv4 " or " ARP , |
| 506 | then comparison with MAC/IP destination address pairs from the |
| 507 | list is possible. |
| 508 | |
| 509 | .TP |
| 510 | .BR "--among-src " "[!] \fIlist\fP" |
| 511 | Compare the MAC source to the given list. If the Ethernet frame has type |
| 512 | .BR IPv4 " or " ARP , |
| 513 | then comparison with MAC/IP source address pairs from the list |
| 514 | is possible. |
| 515 | |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 516 | .SS arp |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 517 | Specify arp fields. The protocol must be specified as |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 518 | .BR ARP " or " RARP . |
| 519 | .TP |
| 520 | .BR "--arp-opcode " "[!] \fIopcode\fP" |
| 521 | The (r)arp opcode (decimal or a string, for more details see |
| 522 | .BR "ebtables -h arp" ). |
| 523 | .TP |
| 524 | .BR "--arp-htype " "[!] \fIhardware type\fP" |
| 525 | The hardware type, this can be a decimal or the string "Ethernet". This |
| 526 | is normally Ethernet (value 1). |
| 527 | .TP |
| 528 | .BR "--arp-ptype " "[!] \fIprotocol type\fP" |
| 529 | The protocol type for which the (r)arp is used (hexadecimal or the string "IPv4"). |
| 530 | This is normally IPv4 (0x0800). |
| 531 | .TP |
| 532 | .BR "--arp-ip-src " "[!] \fIaddress\fP[/\fImask\fP]" |
| 533 | The ARP IP source address specification. |
| 534 | .TP |
| 535 | .BR "--arp-ip-dst " "[!] \fIaddress\fP[/\fImask\fP]" |
| 536 | The ARP IP destination address specification. |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 537 | .TP |
| 538 | .BR "--arp-mac-src " "[!] \fIaddress\fP[/\fImask\fP]" |
| 539 | The ARP MAC source address specification. |
| 540 | .TP |
| 541 | .BR "--arp-mac-dst " "[!] \fIaddress\fP[/\fImask\fP]" |
| 542 | The ARP MAC destination address specification. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 543 | .SS ip |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 544 | Specify ip fields. The protocol must be specified as |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 545 | .BR IPv4 . |
| 546 | .TP |
| 547 | .BR "--ip-source " "[!] \fIaddress\fP[/\fImask\fP]" |
| 548 | The source ip address. |
| 549 | The flag |
| 550 | .B --ip-src |
| 551 | is an alias for this option. |
| 552 | .TP |
| 553 | .BR "--ip-destination " "[!] \fIaddress\fP[/\fImask\fP]" |
| 554 | The destination ip address. |
| 555 | The flag |
| 556 | .B --ip-dst |
| 557 | is an alias for this option. |
| 558 | .TP |
| 559 | .BR "--ip-tos " "[!] \fItos\fP" |
| 560 | The ip type of service, in hexadecimal numbers. |
| 561 | .BR IPv4 . |
| 562 | .TP |
| 563 | .BR "--ip-protocol " "[!] \fIprotocol\fP" |
| 564 | The ip protocol. |
| 565 | The flag |
| 566 | .B --ip-proto |
| 567 | is an alias for this option. |
Bart De Schuymer | 4883ba5 | 2002-09-19 21:10:45 +0000 | [diff] [blame] | 568 | .TP |
| 569 | .BR "--ip-source-port " "[!] \fIport\fP[:\fIport\fP]" |
| 570 | The source port or port range for the ip protocols 6 (TCP) and 17 |
| 571 | (UDP). If the first port is omitted, "0" is assumed; if the last |
| 572 | is omitted, "65535" is assumed. The flag |
| 573 | .B --ip-sport |
| 574 | is an alias for this option. |
| 575 | .TP |
| 576 | .BR "--ip-destination-port " "[!] \fIport\fP[:\fIport\fP]" |
| 577 | The destination port or port range for ip protocols 6 (TCP) and |
| 578 | 17 (UDP). The flag |
| 579 | .B --ip-dport |
| 580 | is an alias for this option. |
Bart De Schuymer | ebf9886 | 2003-09-27 19:55:15 +0000 | [diff] [blame] | 581 | .SS limit |
| 582 | Matches at a limited rate using a token bucket filter. A rule using |
| 583 | this extension will match until this limit is reached (unless the '!' |
| 584 | flag is used). It can be used in combination with the log watcher to |
| 585 | give limited logging, for example. The usage/implementation is completely |
| 586 | similar to that of the iptables limit match. |
| 587 | .TP |
| 588 | .BR --limit " \fIrate" |
| 589 | Maximum average matching rate: specified as a number, with an optional |
| 590 | '/second', '/minute', '/hour', or '/day' suffix; the default is 3/hour. |
| 591 | .TP |
| 592 | .BR --limit-burst " \fInumber" |
| 593 | Maximum initial number of packets to match: this number gets recharged by |
| 594 | one every time the limit specified above is not reached, up to this number; |
| 595 | the default is 5. |
| 596 | |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 597 | .SS mark_m |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 598 | .TP |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 599 | .BR "--mark " "[!] [\fIvalue\fP][/\fImask\fP]" |
| 600 | Matches frames with the given unsigned mark value. If a mark value and |
| 601 | mask is specified, the logical AND of the mark value of the frame and |
| 602 | the user-specified mask is taken before comparing it with the user-specified |
| 603 | mark value. If only a mask is specified (start with '/') the logical AND |
| 604 | of the mark value of the frame and the user-specified mark is taken and |
| 605 | the result is compared with zero. |
Bart De Schuymer | 21aa50f | 2003-05-03 21:07:39 +0000 | [diff] [blame] | 606 | .SS pkttype |
| 607 | .TP |
| 608 | .BR "--pkttype-type " "[!] \fItype\fP" |
| 609 | Matches on the Ethernet "class" of the frame, which is determined by the |
| 610 | generic networking code. Possible values: broadcast (MAC destination is |
| 611 | broadcast address), multicast (MAC destination is multicast address), |
| 612 | host (MAC destination is the receiving network device) or otherhost |
| 613 | (none of the above). |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 614 | .SS stp |
| 615 | Specify stp BPDU (bridge protocol data unit) fields. The destination |
| 616 | address must be specified as the bridge group address (BGA). |
| 617 | .TP |
| 618 | .BR "--stp-type " "[!] \fItype\fP" |
| 619 | The BPDU type (0-255), special recognized types: |
| 620 | .BR config ": configuration BPDU (=0) and" |
| 621 | .BR tcn ": topology change notification BPDU (=128)." |
| 622 | .TP |
| 623 | .BR "--stp-flags " "[!] \fIflag\fP" |
| 624 | The BPDU flag (0-255), special recognized flags: |
| 625 | .BR topology-change ": the topology change flag (=1)" |
| 626 | .BR topology-change-ack ": the topology change acknowledgement flag (=128)." |
| 627 | .TP |
| 628 | .BR "--stp-root-prio " "[!] [\fIprio\fP][:\fIprio\fP]" |
| 629 | The root priority (0-65535) range. |
| 630 | .TP |
| 631 | .BR "--stp-root-addr " "[!] [\fIaddress\fP][/\fImask\fP]" |
| 632 | The root mac address, see the option |
| 633 | .BR -s " for more details." |
| 634 | .TP |
| 635 | .BR "--stp-root-cost " "[!] [\fIcost\fP][:\fIcost\fP]" |
| 636 | The root path cost (0-4294967295) range. |
| 637 | .TP |
| 638 | .BR "--stp-sender-prio " "[!] [\fIprio\fP][:\fIprio\fP]" |
| 639 | The BPDU's sender priority (0-65535) range. |
| 640 | .TP |
| 641 | .BR "--stp-sender-addr " "[!] [\fIaddress\fP][/\fImask\fP]" |
| 642 | The BPDU's sender mac address, see the option |
| 643 | .BR -s " for more details." |
| 644 | .TP |
| 645 | .BR "--stp-port " "[!] [\fIport\fP][:\fIport\fP]" |
| 646 | The port identifier (0-65535) range. |
| 647 | .TP |
| 648 | .BR "--stp-msg-age " "[!] [\fIage\fP][:\fIage\fP]" |
| 649 | The message age timer (0-65535) range. |
| 650 | .TP |
| 651 | .BR "--stp-max-age " "[!] [\fIage\fP][:\fIage\fP]" |
| 652 | The max age timer (0-65535) range. |
| 653 | .TP |
| 654 | .BR "--stp-hello-time " "[!] [\fItime\fP][:\fItime\fP]" |
| 655 | The hello time timer (0-65535) range. |
| 656 | .TP |
| 657 | .BR "--stp-forward-delay " "[!] [\fIdelay\fP][:\fIdelay\fP]" |
| 658 | The forward delay timer (0-65535) range. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 659 | .SS vlan |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 660 | Specify 802.1Q Tag Control Information fields. |
Bart De Schuymer | 38cd75e | 2003-07-25 17:44:30 +0000 | [diff] [blame] | 661 | The protocol must be specified as |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 662 | .BR 802_1Q " (0x8100)." |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 663 | .TP |
| 664 | .BR "--vlan-id " "[!] \fIid\fP" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 665 | The VLAN identifier field (VID). Decimal number from 0 to 4095. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 666 | .TP |
| 667 | .BR "--vlan-prio " "[!] \fIprio\fP" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 668 | The user_priority field. Decimal number from 0 to 7. |
| 669 | The VID should be set to 0 ("null VID") or unspecified |
| 670 | (for this case the VID is deliberately set to 0). |
fnm3 | f794d5a | 2002-06-14 17:28:13 +0000 | [diff] [blame] | 671 | .TP |
fnm3 | ed7e901 | 2002-06-25 16:43:23 +0000 | [diff] [blame] | 672 | .BR "--vlan-encap " "[!] \fItype\fP" |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 673 | The encapsulated Ethernet frame type/length. |
| 674 | Specified as hexadecimal |
| 675 | number from 0x0000 to 0xFFFF or as a symbolic name |
| 676 | from |
| 677 | .BR /etc/ethertypes . |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 678 | |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 679 | .SS WATCHER-EXTENSION(S) |
Bart De Schuymer | 9553d9c | 2002-07-23 21:13:05 +0000 | [diff] [blame] | 680 | Watchers are things that only look at frames passing by. These watchers only |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 681 | see the frame if the frame matches the rule. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 682 | .SS log |
| 683 | The fact that the log module is a watcher lets us log stuff while giving a target |
| 684 | by choice. Note that the log module therefore is not a target. |
| 685 | .TP |
| 686 | .B "--log" |
| 687 | .br |
| 688 | Use this if you won't specify any other log options, so if you want to use the default |
| 689 | settings: log-prefix="", no arp logging, no ip logging, log-level=info. |
| 690 | .TP |
| 691 | .B --log-level "\fIlevel\fP" |
| 692 | .br |
| 693 | defines the logging level. For the possible values: ebtables -h log. |
| 694 | The default level is |
| 695 | .IR info . |
| 696 | .TP |
| 697 | .BR --log-prefix " \fItext\fP" |
| 698 | .br |
| 699 | defines the prefix to be printed before the logging information. |
| 700 | .TP |
| 701 | .B --log-ip |
| 702 | .br |
| 703 | will log the ip information when a frame made by the ip protocol matches |
| 704 | the rule. The default is no ip information logging. |
| 705 | .TP |
| 706 | .B --log-arp |
| 707 | .br |
| 708 | will log the (r)arp information when a frame made by the (r)arp protocols |
| 709 | matches the rule. The default is no (r)arp information logging. |
| 710 | .SS TARGET EXTENSIONS |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 711 | .SS |
Bart De Schuymer | 3a339f2 | 2003-08-14 19:33:11 +0000 | [diff] [blame] | 712 | .B arpreply |
| 713 | The |
| 714 | .B arpreply |
| 715 | target can be used in the |
| 716 | .BR PREROUTING " chain of the " nat " table." |
| 717 | If this target sees an arp request it will automatically reply |
| 718 | with an arp reply. The used MAC address for the reply can be specified. |
| 719 | When the arp message is not an arp request, it is ignored by this target. |
| 720 | .TP |
| 721 | .BR "--arpreply-mac " "\fIaddress\fP" |
| 722 | Specifies the MAC address to reply with: the Ethernet source MAC and the |
| 723 | ARP payload source MAC will be filled in with this address. |
| 724 | .TP |
| 725 | .BR "--arpreply-target " "\fItarget\fP" |
| 726 | Specifies the standard target. After sending the arp reply, the rule still |
| 727 | has to give a standard target so |
| 728 | .B ebtables |
| 729 | knows what to do. The default target is DROP. |
| 730 | .SS |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 731 | .B dnat |
| 732 | The |
| 733 | .B dnat |
| 734 | target can only be used in the |
| 735 | .BR BROUTING " chain of the " broute " table and the " |
| 736 | .BR PREROUTING " and " OUTPUT " chains of the " nat " table." |
| 737 | It specifies that the destination mac address has to be changed. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 738 | .TP |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 739 | .BR "--to-destination " "\fIaddress\fP" |
| 740 | .br |
| 741 | The flag |
| 742 | .B --to-dst |
| 743 | is an alias for this option. |
| 744 | .TP |
| 745 | .BR "--dnat-target " "\fItarget\fP" |
| 746 | .br |
| 747 | Specifies the standard target. After doing the dnat, the rule still has to |
| 748 | give a standard target so |
| 749 | .B ebtables |
| 750 | knows what to do. |
| 751 | The default target is ACCEPT. Making it CONTINUE could let you use |
| 752 | multiple target extensions on the same frame. Making it DROP only makes |
| 753 | sense in the BROUTING chain but using the redirect target is more logical |
| 754 | there. RETURN is also allowed. Note |
| 755 | that using RETURN in a base chain is not allowed. |
| 756 | .SS |
| 757 | .B mark |
| 758 | The mark target can be used in every chain of every table. It is possible |
| 759 | to use the marking of a frame/packet in both ebtables and iptables, |
| 760 | if the br-nf code is compiled into the kernel. Both put the marking at the |
| 761 | same place. So, you can consider this fact as a feature, or as something to |
| 762 | watch out for. |
| 763 | .TP |
| 764 | .BR "--set-mark " "\fIvalue\fP" |
| 765 | .br |
| 766 | Mark the frame with the specified unsigned value. |
| 767 | .TP |
| 768 | .BR "--mark-target " "\fItarget\fP" |
| 769 | .br |
| 770 | Specifies the standard target. After marking the frame, the rule |
| 771 | still has to give a standard target so |
| 772 | .B ebtables |
| 773 | knows what to do. |
| 774 | The default target is ACCEPT. Making it CONTINUE can let you do other |
| 775 | things with the frame in other rules of the chain. |
| 776 | .SS |
| 777 | .B redirect |
| 778 | The |
| 779 | .B redirect |
| 780 | target will change the MAC target address to that of the bridge device the |
| 781 | frame arrived on. This target can only be used in the |
| 782 | .BR BROUTING " chain of the " broute " table and the " |
| 783 | .BR PREROUTING " chain of the " nat " table." |
| 784 | .TP |
| 785 | .BR "--redirect-target " "\fItarget\fP" |
| 786 | .br |
| 787 | Specifies the standard target. After doing the MAC redirect, the rule |
| 788 | still has to give a standard target so |
| 789 | .B ebtables |
| 790 | knows what to do. |
| 791 | The default target is ACCEPT. Making it CONTINUE could let you use |
| 792 | multiple target extensions on the same frame. Making it DROP in the |
| 793 | BROUTING chain will let the frames be routed. RETURN is also allowed. Note |
| 794 | that using RETURN in a base chain is not allowed. |
| 795 | .SS |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 796 | .B snat |
| 797 | The |
| 798 | .B snat |
| 799 | target can only be used in the |
| 800 | .BR POSTROUTING " chain of the " nat " table." |
| 801 | It specifies that the source mac address has to be changed. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 802 | .TP |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 803 | .BR "--to-source " "\fIaddress\fP" |
| 804 | .br |
| 805 | The flag |
| 806 | .B --to-src |
| 807 | is an alias for this option. |
Bart De Schuymer | ff852ce | 2003-03-19 19:53:37 +0000 | [diff] [blame] | 808 | .TP |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 809 | .BR "--snat-target " "\fItarget\fP" |
| 810 | .br |
| 811 | Specifies the standard target. After doing the snat, the rule still has |
| 812 | to give a standard target so |
| 813 | .B ebtables |
| 814 | knows what to do. |
| 815 | The default target is ACCEPT. Making it CONTINUE could let you use |
| 816 | multiple target extensions on the same frame. Making it DROP doesn't |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 817 | make sense, but you could do that too. RETURN is also allowed. Note |
Bart De Schuymer | 4c4447d | 2002-07-25 14:55:14 +0000 | [diff] [blame] | 818 | that using RETURN in a base chain is not allowed. |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 819 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 820 | .SH FILES |
| 821 | .I /etc/ethertypes |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 822 | .SH ENVIRONMENT VARIABLES |
| 823 | .I EBTABLES_ATOMIC_FILE |
Bart De Schuymer | 3006c8c | 2003-03-15 17:07:44 +0000 | [diff] [blame] | 824 | .SH MAILINGLISTS |
| 825 | .I ebtables-user@lists.sourceforge.net |
Bart De Schuymer | 7085d66 | 2003-02-25 22:33:28 +0000 | [diff] [blame] | 826 | .br |
Bart De Schuymer | 3006c8c | 2003-03-15 17:07:44 +0000 | [diff] [blame] | 827 | .I ebtables-devel@lists.sourceforge.net |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 828 | .SH SEE ALSO |
Bart De Schuymer | 3006c8c | 2003-03-15 17:07:44 +0000 | [diff] [blame] | 829 | .BR iptables "(8), " brctl "(8), " ifconfig "(8), " route (8) |