Blame extensions/libxt_tcp.man

Packit 7b22a4
These extensions can be used if `\-\-protocol tcp' is specified. It
Packit 7b22a4
provides the following options:
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-source\-port\fP,\fB\-\-sport\fP \fIport\fP[\fB:\fP\fIport\fP]
Packit 7b22a4
Source port or port range specification. This can either be a service
Packit 7b22a4
name or a port number. An inclusive range can also be specified,
Packit 7b22a4
using the format \fIfirst\fP\fB:\fP\fIlast\fP.
Packit 7b22a4
If the first port is omitted, "0" is assumed; if the last is omitted,
Packit 7b22a4
"65535" is assumed.
Packit 7b22a4
The flag
Packit 7b22a4
\fB\-\-sport\fP
Packit 7b22a4
is a convenient alias for this option.
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-destination\-port\fP,\fB\-\-dport\fP \fIport\fP[\fB:\fP\fIport\fP]
Packit 7b22a4
Destination port or port range specification.  The flag
Packit 7b22a4
\fB\-\-dport\fP
Packit 7b22a4
is a convenient alias for this option.
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-tcp\-flags\fP \fImask\fP \fIcomp\fP
Packit 7b22a4
Match when the TCP flags are as specified.  The first argument \fImask\fP is the
Packit 7b22a4
flags which we should examine, written as a comma-separated list, and
Packit 7b22a4
the second argument \fIcomp\fP is a comma-separated list of flags which must be
Packit 7b22a4
set.  Flags are:
Packit 7b22a4
.BR "SYN ACK FIN RST URG PSH ALL NONE" .
Packit 7b22a4
Hence the command
Packit 7b22a4
.nf
Packit 7b22a4
 iptables \-A FORWARD \-p tcp \-\-tcp\-flags SYN,ACK,FIN,RST SYN
Packit 7b22a4
.fi
Packit 7b22a4
will only match packets with the SYN flag set, and the ACK, FIN and
Packit 7b22a4
RST flags unset.
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-syn\fP
Packit 7b22a4
Only match TCP packets with the SYN bit set and the ACK,RST and FIN bits
Packit 7b22a4
cleared.  Such packets are used to request TCP connection initiation;
Packit 7b22a4
for example, blocking such packets coming in an interface will prevent
Packit 7b22a4
incoming TCP connections, but outgoing TCP connections will be
Packit 7b22a4
unaffected.
Packit 7b22a4
It is equivalent to \fB\-\-tcp\-flags SYN,RST,ACK,FIN SYN\fP.
Packit 7b22a4
If the "!" flag precedes the "\-\-syn", the sense of the
Packit 7b22a4
option is inverted.
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-tcp\-option\fP \fInumber\fP
Packit 7b22a4
Match if TCP option set.