Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 1 | .TH EBTABLES 8 "03 December 2002" |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 2 | .\" |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +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 | .\" |
| 6 | .\" Iptables page by Herve Eychenne March 2000. |
| 7 | .\" |
| 8 | .\" This program is free software; you can redistribute it and/or modify |
| 9 | .\" it under the terms of the GNU General Public License as published by |
| 10 | .\" the Free Software Foundation; either version 2 of the License, or |
| 11 | .\" (at your option) any later version. |
| 12 | .\" |
| 13 | .\" This program is distributed in the hope that it will be useful, |
| 14 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | .\" GNU General Public License for more details. |
| 17 | .\" |
| 18 | .\" You should have received a copy of the GNU General Public License |
| 19 | .\" along with this program; if not, write to the Free Software |
| 20 | .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | .\" |
| 22 | .\" |
| 23 | .SH NAME |
Bart De Schuymer | 63e2c70 | 2002-08-01 15:30:15 +0000 | [diff] [blame] | 24 | ebtables (v.2.0) \- Ethernet bridge frame table administration |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 25 | .SH SYNOPSIS |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 26 | .BR "ebtables -[ADI] " "chain rule-specification " [ options ] |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 27 | .br |
| 28 | .BR "ebtables -P " "chain target" |
| 29 | .br |
| 30 | .BR "ebtables -[FLZ] [" "chain" "]" |
| 31 | .br |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 32 | .BR "ebtables -[NX] " chain |
| 33 | .br |
| 34 | .BR "ebtables -E " "old-chain-name new-chain-name" |
| 35 | .br |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 36 | .BR "ebtables --init-table" |
| 37 | .br |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 38 | .BR "ebtables --atomic-init " |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 39 | .br |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 40 | .BR "ebtables --atomic-save " |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 41 | .br |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 42 | .BR "ebtables --atomic-commit " |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 43 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 44 | .SH DESCRIPTION |
| 45 | .B ebtables |
| 46 | is used to set up, maintain, and inspect the tables of Ethernet frame |
| 47 | rules in the Linux kernel. It works analogous as iptables, but is less |
| 48 | complicated. This man page is written with the man page of iptables |
| 49 | next to it, so don't be surprised to see copied sentences and structure. |
| 50 | |
| 51 | There are three tables with built-in chains. Each chain is a list |
| 52 | of rules which can match frames: each rule specifies what to do with a |
| 53 | frame which matches. This is called a 'target'. The tables are used to |
| 54 | divide functionality into different sets of chains. |
| 55 | |
| 56 | .SS TARGETS |
| 57 | A firewall rule specifies criteria for a frame, and a target. If the |
| 58 | frame does not match, the next rule in the chain is the examined one; if |
| 59 | it does match, then the next thing to do is specified by the target. |
| 60 | This target can be one of these values: |
| 61 | .IR ACCEPT , |
| 62 | .IR DROP , |
| 63 | .IR CONTINUE , |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 64 | .IR RETURN , |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 65 | an extention. |
| 66 | .PP |
| 67 | .I ACCEPT |
| 68 | means to let the frame through. |
| 69 | .I DROP |
| 70 | means the frame has to be dropped. |
| 71 | .I CONTINUE |
| 72 | 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] | 73 | frames pass a certain point in the chain or to log those frames. |
| 74 | .I RETURN |
| 75 | means stop traversing this chain and resume at the next rule in the |
| 76 | previous (calling) chain. |
| 77 | For the |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 78 | other targets see the |
| 79 | .B "TARGET EXTENSIONS" |
| 80 | section. |
| 81 | .SS TABLES |
| 82 | There are three tables. |
| 83 | .TP |
| 84 | .B "-t, --table" |
| 85 | This option specifies the frame matching table which the command should |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 86 | operate on. If specified it should be the first option. The tables are: |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 87 | .BR filter , |
| 88 | this is the default table and contains three chains: |
| 89 | .B INPUT |
| 90 | (for frames destined for the bridge itself), |
| 91 | .B OUTPUT |
| 92 | (for locally-generated frames) and |
| 93 | .B FORWARD |
| 94 | (for frames being bridged). |
| 95 | .BR nat , |
| 96 | this table is used to change the mac addresses and contains three chains: |
| 97 | .B PREROUTING |
| 98 | (for altering frames as soon as they come in), |
| 99 | .B OUTPUT |
| 100 | (for altering locally generated frames before they are bridged) and |
| 101 | .B POSTROUTING |
| 102 | (for altering frames as they are about to go out). A small note on the naming |
| 103 | of chains POSTROUTING and PREROUTING: it would be more accurate to call them |
| 104 | PREFORWARDING and POSTFORWARDING, but for all those who come from the |
| 105 | .BR iptables " world to " ebtables |
| 106 | it is easier to have the same names. |
| 107 | .BR broute , |
| 108 | this table is used to make a brouter, it has one chain: |
| 109 | .BR BROUTING . |
| 110 | The targets |
| 111 | .BR DROP " and " ACCEPT |
| 112 | have special meaning in this table. |
| 113 | .B DROP |
| 114 | actually means the frame has to be routed, while |
| 115 | .B ACCEPT |
| 116 | means the frame has to be bridged. The |
| 117 | .B BROUTING |
| 118 | chain is traversed very early. It is only traversed by frames entering on |
| 119 | a bridge enslaved nic that is in forwarding state. Normally those frames |
| 120 | would be bridged, but you can decide otherwise here. The |
| 121 | .B redirect |
| 122 | target is very handy here. |
| 123 | .SH OPTIONS |
| 124 | The options can be divided into several different groups. |
| 125 | .SS COMMANDS |
| 126 | These options specify the specific actions to perform; only one of them |
| 127 | can be specified on the command line (the |
| 128 | .B -Z |
| 129 | command is an exception). All these options only apply to the selected |
| 130 | (or default) table. |
| 131 | .TP |
| 132 | .B "-A, --append" |
| 133 | Append a rule to the end of the selected chain. |
| 134 | .TP |
| 135 | .B "-D, --delete" |
Bart De Schuymer | abc8417 | 2002-11-06 21:02:33 +0000 | [diff] [blame] | 136 | Delete the specified rule from the selected chain. There are two ways to |
| 137 | use this command. The first is by specifying an interval of rule numbers |
| 138 | to delete, syntax: start_nr[:end_nr]. The second usage is by specifying |
| 139 | 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] | 140 | .TP |
| 141 | .B "-I, --insert" |
| 142 | Insert the specified rule into the selected chain at the specified rule number (1 meaning |
| 143 | the head of the chain). |
| 144 | .TP |
| 145 | .B "-L, --list" |
| 146 | List all rules in the selected chain. If no chain is selected, all chains |
Bart De Schuymer | aac3114 | 2002-08-11 11:57:52 +0000 | [diff] [blame] | 147 | are listed. |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 148 | .br |
Bart De Schuymer | aac3114 | 2002-08-11 11:57:52 +0000 | [diff] [blame] | 149 | The following three options change the output: |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 150 | .br |
| 151 | .B "--Ln" |
| 152 | .br |
| 153 | Puts rule numbers in front of every rule. |
| 154 | .br |
| 155 | .B "--Lc" |
| 156 | .br |
Bart De Schuymer | ee83c67 | 2002-10-17 21:59:43 +0000 | [diff] [blame] | 157 | Shows the counters at the end of every rule, there is a frame counter |
| 158 | (pcnt) and a byte counter (bcnt). |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 159 | .br |
| 160 | .B "--Lx" |
| 161 | .br |
| 162 | The output is directly usable as executable commands in a script, to be |
| 163 | run f.e. at bootup. This option is incompatible with the previous two |
| 164 | options. When no chain name was specified for the |
| 165 | .B "-L" |
| 166 | command, all necessary commands for making the user defined chains and |
| 167 | renaming the standard chains will be made. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 168 | .TP |
| 169 | .B "-F, --flush" |
| 170 | Flush the selected chain. If no chain is selected, every chain will be |
| 171 | flushed. This does not change the policy of the chain. |
| 172 | .TP |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 173 | .B "--init-table" |
| 174 | Replace the current table data by the initial table data. |
| 175 | .TP |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 176 | .B "-Z, --zero" |
| 177 | Put the counters of the selected chain on zero. If no chain is selected, all the counters |
| 178 | are put on zero. This can be used in conjunction with the -L command (see above). |
| 179 | This will cause the rule counters to be printed on the screen before they are put on zero. |
| 180 | .TP |
| 181 | .B "-P, --policy" |
| 182 | Set the policy for the chain to the given target. The policy is either |
| 183 | .B ACCEPT |
| 184 | , either |
| 185 | .BR DROP . |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 186 | .TP |
| 187 | .B "-N, --new-chain" |
Bart De Schuymer | 63e2c70 | 2002-08-01 15:30:15 +0000 | [diff] [blame] | 188 | Create a new user-defined chain by the given name. The number of |
| 189 | user-defined chains is unlimited. A chain name has max length of 31. |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 190 | .TP |
| 191 | .B "-X, --delete-chain" |
| 192 | Delete the specified user-defined chain. There must be no references to the |
| 193 | chain, |
| 194 | .B ebtables |
| 195 | will complain if there are. |
| 196 | .TP |
| 197 | .B "-E, --rename-chain" |
| 198 | Rename the specified chain to the new name. This has no effect on the |
| 199 | structure of the table. It is also allowed to rename a base chain, f.e. |
| 200 | if you like PREBRIDGING more than PREROUTING. Be sure to talk about the |
| 201 | standard chain names when you would ask a question on a mailing list. |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 202 | .TP |
| 203 | .B "--atomic-init" |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 204 | 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] | 205 | 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] | 206 | to the file. The file can be specified using the |
| 207 | .B --atomic-file |
| 208 | option or through the |
| 209 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 210 | .TP |
| 211 | .B "--atomic-save" |
Bart De Schuymer | a02773a | 2002-07-15 19:42:11 +0000 | [diff] [blame] | 212 | 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] | 213 | 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] | 214 | to the file. The file can be specified using the |
| 215 | .B --atomic-file |
| 216 | option or through the |
| 217 | .IR EBTABLES_ATOMIC_FILE " environment variable." |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 218 | .TP |
| 219 | .B "--atomic-commit" |
| 220 | Replace the kernel table data with the data contained in the specified |
| 221 | file. This is a useful command that allows you to put all your rules of a |
| 222 | 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] | 223 | time and allowing atomic updates of the tables. The file which contains |
| 224 | the table data is constructed by using either the |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 225 | .B "--atomic-init" |
| 226 | or the |
| 227 | .B "--atomic-save" |
| 228 | command to get a starting file. After that, using the |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 229 | .B "--atomic-file" |
| 230 | option when constructing rules or setting the |
| 231 | .IR EBTABLES_ATOMIC_FILE " environment variable" |
| 232 | allows you to extend the file and build the complete table before |
| 233 | commiting it to the kernel. |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 234 | .SS |
| 235 | PARAMETERS |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 236 | The following parameters make up a rule specification (as used in the add |
| 237 | and delete commands). A "!" argument before the specification inverts the |
| 238 | test for that specification. Apart from these standard parameters, there are others, see |
| 239 | .BR "MATCH EXTENSIONS" . |
| 240 | .TP |
| 241 | .BR "-p, --protocol " "[!] \fIprotocol\fP" |
| 242 | The protocol that was responsible for creating the frame. This can be a |
| 243 | hexadecimal number, above |
| 244 | .IR 0x0600 , |
| 245 | a name (e.g. |
| 246 | .I ARP |
| 247 | ) or |
| 248 | .BR LENGTH . |
| 249 | The protocol field of the Ethernet frame can be used to denote the |
| 250 | length of the header (802.2/802.3 networks). When the value of that field is |
| 251 | below (or equals) |
| 252 | .IR 0x0600 , |
| 253 | the value equals the size of the header and shouldn't be used as a |
| 254 | protocol number. Instead, all frames where the protocol field is used as |
| 255 | the length field are assumed to be of the same 'protocol'. The protocol |
| 256 | name used in |
| 257 | .B ebtables |
| 258 | for these frames is |
| 259 | .BR LENGTH . |
| 260 | .br |
| 261 | The file |
| 262 | .B /etc/ethertypes |
| 263 | can be used to show readable |
| 264 | characters instead of hexadecimal numbers for the protocols. For example, |
| 265 | .I 0x0800 |
| 266 | will be represented by |
| 267 | .IR IPV4 . |
| 268 | The use of this file is not case sensitive. |
| 269 | See that file for more information. The flag |
| 270 | .B --proto |
| 271 | is an alias for this option. |
| 272 | .TP |
| 273 | .BR "-i, --in-interface " "[!] \fIname\fP" |
| 274 | The interface via which a frame is received (for the |
| 275 | .BR INPUT , |
| 276 | .BR FORWARD , |
| 277 | .BR PREROUTING " and " BROUTING |
| 278 | chains). The flag |
| 279 | .B --in-if |
| 280 | is an alias for this option. |
| 281 | .TP |
| 282 | .BR "--logical-in " "[!] \fIname\fP" |
| 283 | The (logical) bridge interface via which a frame is received (for the |
| 284 | .BR INPUT , |
| 285 | .BR FORWARD , |
| 286 | .BR PREROUTING " and " BROUTING |
| 287 | chains). |
| 288 | .TP |
| 289 | .BR "-o, --out-interface " "[!] \fIname\fP" |
| 290 | The interface via which a frame is going to be sent (for the |
| 291 | .BR OUTPUT , |
| 292 | .B FORWARD |
| 293 | and |
| 294 | .B POSTROUTING |
| 295 | chains). The flag |
| 296 | .B --out-if |
| 297 | is an alias for this option. |
| 298 | .TP |
| 299 | .BR "--logical-out " "[!] \fIname\fP" |
| 300 | The (logical) bridge interface via which a frame is going to be sent (for |
| 301 | the |
| 302 | .BR OUTPUT , |
| 303 | .B FORWARD |
| 304 | and |
| 305 | .B POSTROUTING |
| 306 | chains). |
| 307 | .TP |
| 308 | .BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]" |
| 309 | The source mac address. Both mask and address are written as 6 hexadecimal |
| 310 | numbers seperated by colons. Alternatively one can specify Unicast, |
| 311 | Multicast or Broadcast. |
| 312 | .br |
| 313 | Unicast=00:00:00:00:00:00/01:00:00:00:00:00, |
| 314 | Multicast=01:00:00:00:00:00/01:00:00:00:00:00 and |
| 315 | Broadcast=ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff. Note that a broadcast |
| 316 | address will also match the multicast specification. The flag |
| 317 | .B --src |
| 318 | is an alias for this option. |
| 319 | .TP |
| 320 | .BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]" |
| 321 | The destination mac address. See -s (above) for more details. The flag |
| 322 | .B --dst |
| 323 | is an alias for this option. |
| 324 | |
| 325 | .SS OTHER OPTIONS |
| 326 | .TP |
| 327 | .B "-V, --version" |
| 328 | Show the version of the userprogram. |
| 329 | .TP |
| 330 | .B "-h, --help" |
| 331 | Give a brief description of the command syntax. Here you can also specify |
| 332 | names of extensions and |
| 333 | .B ebtables |
| 334 | will try to write help about those extensions. E.g. ebtables -h snat log ip arp. |
| 335 | .TP |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 336 | .BR "-j, --jump " "\fItarget\fP" |
| 337 | The target of the rule. This is one of the following values: |
| 338 | .BR ACCEPT , |
| 339 | .BR DROP , |
| 340 | .BR CONTINUE , |
Bart De Schuymer | 63e2c70 | 2002-08-01 15:30:15 +0000 | [diff] [blame] | 341 | .BR RETURN , |
| 342 | a target extension (see |
| 343 | .BR "TARGET EXTENSIONS" ")" |
| 344 | or a user defined chain name. |
Bart De Schuymer | 86fe860 | 2002-06-15 08:16:41 +0000 | [diff] [blame] | 345 | .TP |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 346 | .B --atomic-file file |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 347 | Let the command operate on the specified file. The data of the table to |
| 348 | operate on will be extracted from the file and the result of the operation |
| 349 | will be saved back into the file. If specified, this option should come |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 350 | before the command specification. An alternative that should be preferred, |
| 351 | is setting the |
| 352 | .BR EBTABLES_ATOMIC_FILE "environment variable." |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 353 | .TP |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 354 | .B -M, --modprobe program |
Bart De Schuymer | 234bce9 | 2002-07-14 21:25:08 +0000 | [diff] [blame] | 355 | When talking to the kernel, use this program to try to automatically load |
| 356 | missing kernel modules. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 357 | .SH MATCH EXTENSIONS |
| 358 | .B ebtables |
| 359 | extensions are precompiled into the userspace tool. So there is no need |
| 360 | to explicitly load them with a -m option like in iptables. However, these |
| 361 | extensions deal with functionality supported by supplemental kernel modules. |
| 362 | .SS ip |
| 363 | Specify ip specific fields. These will only work if the protocol equals |
| 364 | .BR IPv4 . |
| 365 | .TP |
| 366 | .BR "--ip-source " "[!] \fIaddress\fP[/\fImask\fP]" |
| 367 | The source ip address. |
| 368 | The flag |
| 369 | .B --ip-src |
| 370 | is an alias for this option. |
| 371 | .TP |
| 372 | .BR "--ip-destination " "[!] \fIaddress\fP[/\fImask\fP]" |
| 373 | The destination ip address. |
| 374 | The flag |
| 375 | .B --ip-dst |
| 376 | is an alias for this option. |
| 377 | .TP |
| 378 | .BR "--ip-tos " "[!] \fItos\fP" |
| 379 | The ip type of service, in hexadecimal numbers. |
| 380 | .BR IPv4 . |
| 381 | .TP |
| 382 | .BR "--ip-protocol " "[!] \fIprotocol\fP" |
| 383 | The ip protocol. |
| 384 | The flag |
| 385 | .B --ip-proto |
| 386 | is an alias for this option. |
Bart De Schuymer | 4883ba5 | 2002-09-19 21:10:45 +0000 | [diff] [blame] | 387 | .TP |
| 388 | .BR "--ip-source-port " "[!] \fIport\fP[:\fIport\fP]" |
| 389 | The source port or port range for the ip protocols 6 (TCP) and 17 |
| 390 | (UDP). If the first port is omitted, "0" is assumed; if the last |
| 391 | is omitted, "65535" is assumed. The flag |
| 392 | .B --ip-sport |
| 393 | is an alias for this option. |
| 394 | .TP |
| 395 | .BR "--ip-destination-port " "[!] \fIport\fP[:\fIport\fP]" |
| 396 | The destination port or port range for ip protocols 6 (TCP) and |
| 397 | 17 (UDP). The flag |
| 398 | .B --ip-dport |
| 399 | is an alias for this option. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 400 | .SS arp |
| 401 | Specify arp specific fields. These will only work if the protocol equals |
| 402 | .BR ARP " or " RARP . |
| 403 | .TP |
| 404 | .BR "--arp-opcode " "[!] \fIopcode\fP" |
Bart De Schuymer | 9553d9c | 2002-07-23 21:13:05 +0000 | [diff] [blame] | 405 | The (r)arp opcode (decimal or a string, for more details see |
| 406 | .BR "ebtables -h arp" ). |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 407 | .TP |
| 408 | .BR "--arp-htype " "[!] \fIhardware type\fP" |
| 409 | The hardware type, this can be a decimal or the string "Ethernet". This |
| 410 | is normally Ethernet (value 1). |
| 411 | .TP |
| 412 | .BR "--arp-ptype " "[!] \fIprotocol type\fP" |
| 413 | The protocol type for which the (r)arp is used (hexadecimal or the string "IPv4"). |
| 414 | This is normally IPv4 (0x0800). |
| 415 | .TP |
| 416 | .BR "--arp-ip-src " "[!] \fIaddress\fP[/\fImask\fP]" |
| 417 | The ARP IP source address specification. |
| 418 | .TP |
| 419 | .BR "--arp-ip-dst " "[!] \fIaddress\fP[/\fImask\fP]" |
| 420 | The ARP IP destination address specification. |
| 421 | .SS vlan |
fnm3 | f794d5a | 2002-06-14 17:28:13 +0000 | [diff] [blame] | 422 | Specify 802.1Q Tag Control Information fields. These will only work if the protocol equals |
fnm3 | ed7e901 | 2002-06-25 16:43:23 +0000 | [diff] [blame] | 423 | .BR 802_1Q. |
| 424 | Also see extension help by |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 425 | .BR "ebtables -h vlan" . |
| 426 | .TP |
| 427 | .BR "--vlan-id " "[!] \fIid\fP" |
fnm3 | ed7e901 | 2002-06-25 16:43:23 +0000 | [diff] [blame] | 428 | The VLAN identifier field, VID (decimal number from 0 to 4094). |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 429 | .TP |
| 430 | .BR "--vlan-prio " "[!] \fIprio\fP" |
fnm3 | ed7e901 | 2002-06-25 16:43:23 +0000 | [diff] [blame] | 431 | The user_priority field, this can be a decimal number from 0 to 7. |
| 432 | Required VID to be 0 (null VID) or not specified vlan-id parameter (in this case VID deliberately be set to 0). |
fnm3 | f794d5a | 2002-06-14 17:28:13 +0000 | [diff] [blame] | 433 | .TP |
fnm3 | ed7e901 | 2002-06-25 16:43:23 +0000 | [diff] [blame] | 434 | .BR "--vlan-encap " "[!] \fItype\fP" |
Bart De Schuymer | 9553d9c | 2002-07-23 21:13:05 +0000 | [diff] [blame] | 435 | The encapsulated Ethernet frame type/length, this can be a hexadecimal |
| 436 | number from 0x0000 to 0xFFFF. |
fnm3 | ed7e901 | 2002-06-25 16:43:23 +0000 | [diff] [blame] | 437 | Usually it's 0x0800 (IPv4). See also |
| 438 | .B /etc/ethertypes |
| 439 | file. |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 440 | .SS mark_m |
| 441 | .TP |
Bart De Schuymer | 8a8ca61 | 2002-07-21 15:18:07 +0000 | [diff] [blame] | 442 | .BR "--mark " "[!] [\fIvalue\fP][/\fImask\fP]" |
| 443 | Matches frames with the given unsigned mark value. If a mark value and |
| 444 | mask is specified, the logical AND of the mark value of the frame and |
| 445 | the user specified mask is taken before comparing with the user specified |
| 446 | mark value. If only a mask is specified (start with '/') the logical AND |
| 447 | of the mark value of the frame and the user specified mark is taken and |
| 448 | the result is compared with zero. |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 449 | |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 450 | .SH WATCHER EXTENSION(S) |
Bart De Schuymer | 9553d9c | 2002-07-23 21:13:05 +0000 | [diff] [blame] | 451 | Watchers are things that only look at frames passing by. These watchers only |
| 452 | see the frame if the frame passes all the matches of the rule. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 453 | .SS log |
| 454 | The fact that the log module is a watcher lets us log stuff while giving a target |
| 455 | by choice. Note that the log module therefore is not a target. |
| 456 | .TP |
| 457 | .B "--log" |
| 458 | .br |
| 459 | Use this if you won't specify any other log options, so if you want to use the default |
| 460 | settings: log-prefix="", no arp logging, no ip logging, log-level=info. |
| 461 | .TP |
| 462 | .B --log-level "\fIlevel\fP" |
| 463 | .br |
| 464 | defines the logging level. For the possible values: ebtables -h log. |
| 465 | The default level is |
| 466 | .IR info . |
| 467 | .TP |
| 468 | .BR --log-prefix " \fItext\fP" |
| 469 | .br |
| 470 | defines the prefix to be printed before the logging information. |
| 471 | .TP |
| 472 | .B --log-ip |
| 473 | .br |
| 474 | will log the ip information when a frame made by the ip protocol matches |
| 475 | the rule. The default is no ip information logging. |
| 476 | .TP |
| 477 | .B --log-arp |
| 478 | .br |
| 479 | will log the (r)arp information when a frame made by the (r)arp protocols |
| 480 | matches the rule. The default is no (r)arp information logging. |
| 481 | .SS TARGET EXTENSIONS |
| 482 | .TP |
| 483 | .B snat |
| 484 | The |
| 485 | .B snat |
| 486 | target can only be used in the |
| 487 | .BR POSTROUTING " chain of the " nat " table." |
| 488 | It specifies that the source mac address has to be changed. |
| 489 | .br |
| 490 | .BR "--to-source " "\fIaddress\fP" |
| 491 | .br |
| 492 | The flag |
| 493 | .B --to-src |
| 494 | is an alias for this option. |
| 495 | .br |
| 496 | .BR "--snat-target " "\fItarget\fP" |
| 497 | .br |
| 498 | Specifies the standard target. After doing the snat, the rule still has |
| 499 | to give a standard target so |
| 500 | .B ebtables |
| 501 | knows what to do. |
| 502 | The default target is ACCEPT. Making it CONTINUE could let you use |
| 503 | 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] | 504 | 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] | 505 | that using RETURN in a base chain is not allowed. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 506 | .TP |
| 507 | .B dnat |
| 508 | The |
| 509 | .B dnat |
| 510 | target can only be used in the |
| 511 | .BR BROUTING " chain of the " broute " table and the " |
| 512 | .BR PREROUTING " and " OUTPUT " chains of the " nat " table." |
| 513 | It specifies that the destination mac address has to be changed. |
| 514 | .br |
| 515 | .BR "--to-destination " "\fIaddress\fP" |
| 516 | .br |
| 517 | The flag |
| 518 | .B --to-dst |
| 519 | is an alias for this option. |
| 520 | .br |
| 521 | .BR "--dnat-target " "\fItarget\fP" |
| 522 | .br |
| 523 | Specifies the standard target. After doing the dnat, the rule still has to |
| 524 | give a standard target so |
| 525 | .B ebtables |
| 526 | knows what to do. |
| 527 | The default target is ACCEPT. Making it CONTINUE could let you use |
| 528 | multiple target extensions on the same frame. Making it DROP only makes |
| 529 | sense in the BROUTING chain but using the redirect target is more logical |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 530 | there. RETURN is also allowed. Note |
Bart De Schuymer | 4c4447d | 2002-07-25 14:55:14 +0000 | [diff] [blame] | 531 | that using RETURN in a base chain is not allowed. |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 532 | .TP |
| 533 | .B redirect |
| 534 | The |
| 535 | .B redirect |
| 536 | target will change the MAC target address to that of the bridge device the |
| 537 | frame arrived on. This target can only be used in the |
| 538 | .BR BROUTING " chain of the " broute " table and the " |
| 539 | .BR PREROUTING " chain of the " nat " table." |
| 540 | .br |
| 541 | .BR "--redirect-target " "\fItarget\fP" |
| 542 | .br |
| 543 | Specifies the standard target. After doing the MAC redirect, the rule |
| 544 | still has to give a standard target so |
| 545 | .B ebtables |
| 546 | knows what to do. |
| 547 | The default target is ACCEPT. Making it CONTINUE could let you use |
| 548 | multiple target extensions on the same frame. Making it DROP in the |
Bart De Schuymer | 29749c6 | 2002-06-25 21:27:57 +0000 | [diff] [blame] | 549 | BROUTING chain will let the frames be routed. RETURN is also allowed. Note |
Bart De Schuymer | 4c4447d | 2002-07-25 14:55:14 +0000 | [diff] [blame] | 550 | that using RETURN in a base chain is not allowed. |
Bart De Schuymer | 2ac6b74 | 2002-07-20 16:14:38 +0000 | [diff] [blame] | 551 | .TP |
| 552 | .B mark |
| 553 | The mark target can be used in every chain of every table. It is possible |
| 554 | to use the marking of a frame/packet in both ebtables and iptables, |
| 555 | if the br-nf code is compiled into the kernel. Both put the marking at the |
| 556 | same place. So, you can consider this fact as a feature, or as something to |
| 557 | watch out for. |
| 558 | .br |
| 559 | .BR "--mark-target " "\fItarget\fP" |
| 560 | .br |
| 561 | Specifies the standard target. After marking the frame, the rule |
| 562 | still has to give a standard target so |
| 563 | .B ebtables |
| 564 | knows what to do. |
| 565 | The default target is ACCEPT. Making it CONTINUE can let you do other |
| 566 | things with the frame in other rules of the chain. |
| 567 | .br |
| 568 | .BR "--set-mark " "\fIvalue\fP" |
| 569 | .br |
| 570 | Mark the frame with the specified unsigned value. |
| 571 | .br |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 572 | .SH FILES |
| 573 | .I /etc/ethertypes |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 574 | .SH ENVIRONMENT VARIABLES |
| 575 | .I EBTABLES_ATOMIC_FILE |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 576 | .SH BUGS |
| 577 | This won't work on an architecture with a user32/kernel64 situation like the Sparc64. |
| 578 | .SH AUTHOR |
Bart De Schuymer | eecff42 | 2002-12-03 20:50:30 +0000 | [diff] [blame] | 579 | .IR "" "Bart De Schuymer <" bdschuym@pandora.be > |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 580 | .SH SEE ALSO |
| 581 | .BR iptables "(8), " brctl (8) |