blob: c397f74292b80612fb508f6679c401aba4e97fa4 [file] [log] [blame]
Jan Engelhardta80b6042008-01-20 13:34:07 +00001This module, when combined with connection tracking, allows access to the
2connection tracking state for this packet/connection.
3.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +02004[\fB!\fP] \fB\-\-ctstate\fP \fIstatelist\fP
5\fIstatelist\fP is a comma separated list of the connection states to match.
Jan Engelhardta80b6042008-01-20 13:34:07 +00006Possible states are listed below.
7.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +02008[\fB!\fP] \fB\-\-ctproto\fP \fIl4proto\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +00009Layer-4 protocol to match (by number or name)
10.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020011[\fB!\fP] \fB\-\-ctorigsrc\fP \fIaddress\fP[\fB/\fP\fImask\fP]
Jan Engelhardta80b6042008-01-20 13:34:07 +000012.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020013[\fB!\fP] \fB\-\-ctorigdst\fP \fIaddress\fP[\fB/\fP\fImask\fP]
Jan Engelhardta80b6042008-01-20 13:34:07 +000014.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020015[\fB!\fP] \fB\-\-ctreplsrc\fP \fIaddress\fP[\fB/\fP\fImask\fP]
Jan Engelhardta80b6042008-01-20 13:34:07 +000016.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020017[\fB!\fP] \fB\-\-ctrepldst\fP \fIaddress\fP[\fB/\fP\fImask\fP]
Jan Engelhardta8ad34c2008-01-29 13:37:21 +000018Match against original/reply source/destination address
19.TP
Patrick McHardyc8f28cc2011-01-20 11:45:12 +010020[\fB!\fP] \fB\-\-ctorigsrcport\fP \fIport\fP[\fB:\fP\fIport\fP]
Jan Engelhardta8ad34c2008-01-29 13:37:21 +000021.TP
Patrick McHardyc8f28cc2011-01-20 11:45:12 +010022[\fB!\fP] \fB\-\-ctorigdstport\fP \fIport\fP[\fB:\fP\fIport\fP]
Jan Engelhardta8ad34c2008-01-29 13:37:21 +000023.TP
Patrick McHardyc8f28cc2011-01-20 11:45:12 +010024[\fB!\fP] \fB\-\-ctreplsrcport\fP \fIport\fP[\fB:\fP\fIport\fP]
Jan Engelhardta8ad34c2008-01-29 13:37:21 +000025.TP
Patrick McHardyc8f28cc2011-01-20 11:45:12 +010026[\fB!\fP] \fB\-\-ctrepldstport\fP \fIport\fP[\fB:\fP\fIport\fP]
Jan Engelhardta8ad34c2008-01-29 13:37:21 +000027Match against original/reply source/destination port (TCP/UDP/etc.) or GRE key.
Patrick McHardyc8f28cc2011-01-20 11:45:12 +010028Matching against port ranges is only supported in kernel versions above 2.6.38.
Jan Engelhardta80b6042008-01-20 13:34:07 +000029.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020030[\fB!\fP] \fB\-\-ctstatus\fP \fIstatelist\fP
31\fIstatuslist\fP is a comma separated list of the connection statuses to match.
Jan Engelhardta80b6042008-01-20 13:34:07 +000032Possible statuses are listed below.
33.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020034[\fB!\fP] \fB\-\-ctexpire\fP \fItime\fP[\fB:\fP\fItime\fP]
Jan Engelhardta80b6042008-01-20 13:34:07 +000035Match remaining lifetime in seconds against given value or range of values
36(inclusive)
Jan Engelhardta8ad34c2008-01-29 13:37:21 +000037.TP
Jan Engelhardtfea74bf2009-01-12 04:53:18 +010038\fB\-\-ctdir\fP {\fBORIGINAL\fP|\fBREPLY\fP}
Jan Engelhardta8ad34c2008-01-29 13:37:21 +000039Match packets that are flowing in the specified direction. If this flag is not
40specified at all, matches packets in both directions.
Jan Engelhardta80b6042008-01-20 13:34:07 +000041.PP
Jan Engelhardtfea74bf2009-01-12 04:53:18 +010042States for \fB\-\-ctstate\fP:
Jan Engelhardta80b6042008-01-20 13:34:07 +000043.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020044\fBINVALID\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000045meaning that the packet is associated with no known connection
46.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020047\fBNEW\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000048meaning that the packet has started a new connection, or otherwise associated
49with a connection which has not seen packets in both directions, and
50.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020051\fBESTABLISHED\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000052meaning that the packet is associated with a connection which has seen packets
53in both directions,
54.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020055\fBRELATED\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000056meaning that the packet is starting a new connection, but is associated with an
57existing connection, such as an FTP data transfer, or an ICMP error.
58.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020059\fBUNTRACKED\fP
Simon Lodalafbac0d2010-05-10 01:02:21 +020060meaning that the packet is not tracked at all, which happens if you use
61the NOTRACK target in raw table.
62.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020063\fBSNAT\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000064A virtual state, matching if the original source address differs from the reply
65destination.
66.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020067\fBDNAT\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000068A virtual state, matching if the original destination differs from the reply
69source.
70.PP
Jan Engelhardtfea74bf2009-01-12 04:53:18 +010071Statuses for \fB\-\-ctstatus\fP:
Jan Engelhardta80b6042008-01-20 13:34:07 +000072.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020073\fBNONE\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000074None of the below.
75.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020076\fBEXPECTED\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000077This is an expected connection (i.e. a conntrack helper set it up)
78.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020079\fBSEEN_REPLY\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000080Conntrack has seen packets in both directions.
81.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020082\fBASSURED\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000083Conntrack entry should never be early-expired.
84.TP
Jan Engelhardtc6775d62010-07-23 21:23:05 +020085\fBCONFIRMED\fP
Jan Engelhardta80b6042008-01-20 13:34:07 +000086Connection is confirmed: originating packet has left box.