Jan Engelhardt | f4b737f | 2008-01-20 13:31:13 +0000 | [diff] [blame] | 1 | This target is used to set the Netfilter mark value associated with the packet. |
Jan Engelhardt | c9be7f1 | 2010-03-16 20:28:30 +0100 | [diff] [blame] | 2 | It can, for example, be used in conjunction with routing based on fwmark (needs |
| 3 | iproute2). If you plan on doing so, note that the mark needs to be set in the |
| 4 | PREROUTING chain of the mangle table to affect routing. |
| 5 | The mark field is 32 bits wide. |
Jan Engelhardt | f4b737f | 2008-01-20 13:31:13 +0000 | [diff] [blame] | 6 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 7 | \fB\-\-set\-xmark\fP \fIvalue\fP[\fB/\fP\fImask\fP] |
Jan Engelhardt | c6775d6 | 2010-07-23 21:23:05 +0200 | [diff] [blame] | 8 | Zeroes out the bits given by \fImask\fP and XORs \fIvalue\fP into the packet |
| 9 | mark ("nfmark"). If \fImask\fP is omitted, 0xFFFFFFFF is assumed. |
Jan Engelhardt | f4b737f | 2008-01-20 13:31:13 +0000 | [diff] [blame] | 10 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 11 | \fB\-\-set\-mark\fP \fIvalue\fP[\fB/\fP\fImask\fP] |
Jan Engelhardt | c6775d6 | 2010-07-23 21:23:05 +0200 | [diff] [blame] | 12 | Zeroes out the bits given by \fImask\fP and ORs \fIvalue\fP into the packet |
| 13 | mark. If \fImask\fP is omitted, 0xFFFFFFFF is assumed. |
Jan Engelhardt | f4b737f | 2008-01-20 13:31:13 +0000 | [diff] [blame] | 14 | .PP |
| 15 | The following mnemonics are available: |
| 16 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 17 | \fB\-\-and\-mark\fP \fIbits\fP |
Jan Engelhardt | c6775d6 | 2010-07-23 21:23:05 +0200 | [diff] [blame] | 18 | Binary AND the nfmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark |
| 19 | 0/\fP\fIinvbits\fP, where \fIinvbits\fP is the binary negation of \fIbits\fP.) |
Jan Engelhardt | f4b737f | 2008-01-20 13:31:13 +0000 | [diff] [blame] | 20 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 21 | \fB\-\-or\-mark\fP \fIbits\fP |
Jan Engelhardt | c6775d6 | 2010-07-23 21:23:05 +0200 | [diff] [blame] | 22 | Binary OR the nfmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark\fP |
| 23 | \fIbits\fP\fB/\fP\fIbits\fP.) |
Jan Engelhardt | f4b737f | 2008-01-20 13:31:13 +0000 | [diff] [blame] | 24 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 25 | \fB\-\-xor\-mark\fP \fIbits\fP |
Jan Engelhardt | c6775d6 | 2010-07-23 21:23:05 +0200 | [diff] [blame] | 26 | Binary XOR the nfmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark\fP |
| 27 | \fIbits\fP\fB/0\fP.) |