1 This module sets the Type of Service field in the IPv4 header (including the 2 "precedence" bits) or the Priority field in the IPv6 header. Note that TOS 3 shares the same bits as DSCP and ECN. The TOS target is only valid in the 4 \fBmangle\fP table. 5 .TP 6 \fB\-\-set\-tos\fP \fIvalue\fP[\fB/\fP\fImask\fP] 7 Zeroes out the bits given by \fImask\fP (see NOTE below) and XORs \fIvalue\fP 8 into the TOS/Priority field. If \fImask\fP is omitted, 0xFF is assumed. 9 .TP 10 \fB\-\-set\-tos\fP \fIsymbol\fP 11 You can specify a symbolic name when using the TOS target for IPv4. It implies 12 a mask of 0xFF (see NOTE below). The list of recognized TOS names can be 13 obtained by calling iptables with \fB\-j TOS \-h\fP. 14 .PP 15 The following mnemonics are available: 16 .TP 17 \fB\-\-and\-tos\fP \fIbits\fP 18 Binary AND the TOS value with \fIbits\fP. (Mnemonic for \fB\-\-set\-tos 19 0/\fP\fIinvbits\fP, where \fIinvbits\fP is the binary negation of \fIbits\fP. 20 See NOTE below.) 21 .TP 22 \fB\-\-or\-tos\fP \fIbits\fP 23 Binary OR the TOS value with \fIbits\fP. (Mnemonic for \fB\-\-set\-tos\fP 24 \fIbits\fP\fB/\fP\fIbits\fP. See NOTE below.) 25 .TP 26 \fB\-\-xor\-tos\fP \fIbits\fP 27 Binary XOR the TOS value with \fIbits\fP. (Mnemonic for \fB\-\-set\-tos\fP 28 \fIbits\fP\fB/0\fP. See NOTE below.) 29 .PP 30 NOTE: In Linux kernels up to and including 2.6.38, with the exception of 31 longterm releases 2.6.32 (>=.42), 2.6.33 (>=.15), and 2.6.35 (>=.14), there is 32 a bug whereby IPv6 TOS mangling does not behave as documented and differs from 33 the IPv4 version. The TOS mask indicates the bits one wants to zero out, so it 34 needs to be inverted before applying it to the original TOS field. However, the 35 aformentioned kernels forgo the inversion which breaks --set-tos and its 36 mnemonics. 37